[nostalgia/core/glfw] Add extra draw before waiting for event to handle possible user input

This commit is contained in:
Gary Talent 2022-02-16 02:32:27 -06:00
parent 0e4bebcc3d
commit c1a374ca04

View File

@ -42,11 +42,15 @@ ox::Error run(Context *ctx) noexcept {
}
}
} else {
sleepTime = 2;
sleepTime = 10;
}
draw(ctx);
glfwSwapBuffers(id->window);
if (!ctx->constantRefresh) {
// redraw before sleeping to update things that may have changed due
// to user input this round
draw(ctx);
glfwSwapBuffers(id->window);
glfwWaitEventsTimeout(sleepTime);
}
}