Working on Window

This commit is contained in:
2026-01-28 00:32:41 +01:00
parent e4eeedda7b
commit b072bba651
6 changed files with 97 additions and 47 deletions

View File

@@ -1,6 +1,7 @@
#include "Engine.hpp" #include "Engine.hpp"
#include "raylib.h" #include "raylib.h"
namespace DREAM {
void Engine::init() { void Engine::init() {
InitWindow(screenWidth, screenHeight, "DREAM Engine 0.0.1"); InitWindow(screenWidth, screenHeight, "DREAM Engine 0.0.1");
@@ -29,3 +30,4 @@ void Engine::run() {
CloseWindow(); CloseWindow();
} }
}

View File

@@ -2,9 +2,10 @@
#include "../Game/src/Game.hpp" #include "../Game/src/Game.hpp"
namespace DREAM {
class Engine { class Engine {
private: private:
Game m_game; GamePlaceholder::Game m_game;
const int screenWidth = 1280; const int screenWidth = 1280;
const int screenHeight = 720; const int screenHeight = 720;
@@ -21,3 +22,4 @@ public:
void run(); void run();
}; };
}

View File

@@ -0,0 +1,3 @@
namespace DREAM {
// TODO: Implement Window functions
}

View File

@@ -0,0 +1,41 @@
#pragma once
#include <string>
namespace DREAM {
struct WindowConfig {
int m_width { 1280 };
int m_height { 720 };
bool m_Fullscreen { false };
bool m_vsync { false };
bool m_resizable { false } ;
};
namespace Window {
void init(WindowConfig& config);
void setWidth(int width);
void setHeight(int height);
void setSize(int width, int height);
void setFullscreen(bool enabled);
void toggleFullscreen();
void setTitle(const std::string& title);
void setPosition(int x, int y);
int getWidth();
int getHeight();
float getAspectRatio();
bool isFullscreen();
bool isVSyncEnabled();
bool isResizable();
int getMonitorIndex();
int getMonitorRefreshRate();
int getMonitorWidth();
int getMonitorHeight();
}
}

View File

@@ -1,5 +1,6 @@
#pragma once #pragma once
namespace GamePlaceholder {
class Game { class Game {
private: private:
@@ -10,3 +11,4 @@ public:
void update(); void update();
void draw(); void draw();
}; };
}

View File

@@ -1,6 +1,6 @@
#include "Engine/Engine.hpp" #include "Engine/Engine.hpp"
int main() { int main() {
Engine engine; DREAM::Engine engine;
engine.run(); engine.run();
} }