[turbine/glfw] Replace uninterruptedRefreshes with mandatoryRefreshPeriodEnd
Some checks failed
Build / build (push) Has been cancelled
Some checks failed
Build / build (push) Has been cancelled
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user