diff --git a/src/nostalgia/core/glfw/core.cpp b/src/nostalgia/core/glfw/core.cpp index 9b6a45bd..1302a759 100644 --- a/src/nostalgia/core/glfw/core.cpp +++ b/src/nostalgia/core/glfw/core.cpp @@ -23,7 +23,7 @@ static void handleKeyPress(Context *ctx, int key) { switch (key) { case GLFW_KEY_ESCAPE: case GLFW_KEY_Q: - id->running = false; + glfwSetWindowShouldClose(id->window, true); break; default: break; @@ -50,13 +50,7 @@ ox::Error init(Context *ctx) noexcept { ox::Error run(Context *ctx) noexcept { const auto id = ctx->windowerData(); - id->running = true; - // try adaptive vsync - //if (SDL_GL_SetSwapInterval(config::SdlVsyncOption) < 0) { - // oxTrace("nostalgia::core::sdl", "Could not enable adaptive vsync, falling back on vsync"); - // SDL_GL_SetSwapInterval(1); // fallback on normal vsync - //} - while (id->running && !glfwWindowShouldClose(id->window)) { + while (!glfwWindowShouldClose(id->window)) { glfwPollEvents(); const auto ticks = ticksMs(ctx); if (id->wakeupTime <= ticks && id->eventHandler) { diff --git a/src/nostalgia/core/glfw/core.hpp b/src/nostalgia/core/glfw/core.hpp index eca68d56..602e57c4 100644 --- a/src/nostalgia/core/glfw/core.hpp +++ b/src/nostalgia/core/glfw/core.hpp @@ -15,7 +15,6 @@ namespace nostalgia::core { struct GlfwImplData { struct GLFWwindow *window = nullptr; int64_t startTime = 0; - bool running = false; event_handler eventHandler = nullptr; uint64_t wakeupTime = 0; };