feat: window is open
This commit is contained in:
@ -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:
|
||||||
|
@ -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() {
|
||||||
|
@ -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() {
|
||||||
|
Reference in New Issue
Block a user