[turbine/glfw] Replace uninterruptedRefreshes with mandatoryRefreshPeriodEnd
Some checks failed
Build / build (push) Has been cancelled

This commit is contained in:
2024-12-10 01:49:20 -06:00
parent 7679403742
commit ff05d860c4
3 changed files with 7 additions and 9 deletions

View File

@@ -72,14 +72,16 @@ static void handleKeyPress(Context &ctx, int key, bool down) noexcept {
static void handleGlfwCursorPosEvent(GLFWwindow*, double, double) noexcept {
}
static constexpr TimeMs MandatoryRefreshPeriod = 168;
static void handleGlfwMouseButtonEvent(GLFWwindow *window, int, int, int) noexcept {
auto const ctx = static_cast<Context*>(glfwGetWindowUserPointer(window));
ctx->uninterruptedRefreshes = 25;
ctx->mandatoryRefreshPeriodEnd = MandatoryRefreshPeriod;
}
static void handleGlfwKeyEvent(GLFWwindow *window, int key, int, int action, int) noexcept {
auto const ctx = static_cast<Context*>(glfwGetWindowUserPointer(window));
ctx->uninterruptedRefreshes = 25;
ctx->mandatoryRefreshPeriodEnd = MandatoryRefreshPeriod;
if (action == GLFW_PRESS) {
handleKeyPress(*ctx, key, true);
} else if (action == GLFW_RELEASE) {