refactor: add window::stop() and remove quit flag

Added `window::stop()` (sets GLFW close flag). Updated
signal/timer handlers and Q key check to call it instead of
using a separate `quit` bool in main().

This encapsulates the close state in the window class (no
more external flag + manual checks). The render loop is now
simpler.

(The process_signals lambda and ASIO duration timer are
retained.)
This commit is contained in:
2026-05-05 23:45:46 +02:00
parent 3f78d0978d
commit c3860cc1d3
3 changed files with 13 additions and 7 deletions
+6
View File
@@ -83,4 +83,10 @@ auto window::raw() const -> GLFWwindow* {
return m_window;
}
auto window::stop() -> void {
if (m_window) {
glfwSetWindowShouldClose(m_window, GLFW_TRUE);
}
}
}
+1
View File
@@ -17,6 +17,7 @@ public:
auto swap_buffers() -> void;
auto poll_events() -> void;
auto raw() const -> GLFWwindow*;
auto stop() -> void;
private:
GLFWwindow* m_window = nullptr;