[turbine/glfw] Fix closing when no shutdown handler is set
All checks were successful
Build / build (push) Successful in 1m53s
All checks were successful
Build / build (push) Successful in 1m53s
This commit is contained in:
parent
88a6cd59f3
commit
de8ac10653
@ -96,7 +96,7 @@ static void handleGlfwKeyEvent(GLFWwindow *window, int key, int, int action, int
|
|||||||
static void handleGlfwWindowCloseEvent(GLFWwindow *window) noexcept {
|
static void handleGlfwWindowCloseEvent(GLFWwindow *window) noexcept {
|
||||||
auto &ctx = *static_cast<Context*>(glfwGetWindowUserPointer(window));
|
auto &ctx = *static_cast<Context*>(glfwGetWindowUserPointer(window));
|
||||||
ctx.mandatoryRefreshPeriodEnd = ticksMs(ctx) + config::MandatoryRefreshPeriod;
|
ctx.mandatoryRefreshPeriodEnd = ticksMs(ctx) + config::MandatoryRefreshPeriod;
|
||||||
ctx.running = !ctx.shutdownHandler(ctx);
|
ctx.running = ctx.shutdownHandler ? !ctx.shutdownHandler(ctx) : false;
|
||||||
glfwSetWindowShouldClose(window, !ctx.running);
|
glfwSetWindowShouldClose(window, !ctx.running);
|
||||||
glfwPostEmptyEvent();
|
glfwPostEmptyEvent();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user