feat: window is open

This commit is contained in:
2025-10-04 14:56:39 +02:00
parent 81c4e08e36
commit 7f08e28a04
3 changed files with 6 additions and 1 deletions

View File

@ -19,12 +19,15 @@ private:
int m_width; int m_width;
int m_height; int m_height;
bool m_is_open;
public: public:
Window(); Window();
~Window(); ~Window();
public: public:
[[nodiscard]] inline int GetWidth() const { return m_width; } [[nodiscard]] inline int GetWidth() const { return m_width; }
[[nodiscard]] inline int GetHeight() const { return m_height; } [[nodiscard]] inline int GetHeight() const { return m_height; }
[[nodiscard]] inline bool IsOpen() const { return m_is_open; }
public: public:
void ProcessEvents(); void ProcessEvents();
public: public:

View File

@ -31,7 +31,7 @@ Engine::Engine() {
} }
bool Engine::Running() const { bool Engine::Running() const {
return m_isRunning; return m_isRunning && m_window->IsOpen();
} }
void Engine::Stop() { void Engine::Stop() {

View File

@ -61,6 +61,8 @@ Window::Window() {
glDebugMessageCallback(MessageCallback, nullptr); glDebugMessageCallback(MessageCallback, nullptr);
glViewport(0, 0, m_width, m_height); glViewport(0, 0, m_width, m_height);
m_is_open = true;
} }
void Window::ProcessEvents() { void Window::ProcessEvents() {