[nostalgia/core/glfw] Add extra draw before waiting for event to handle possible user input
This commit is contained in:
parent
0e4bebcc3d
commit
c1a374ca04
@ -42,11 +42,15 @@ ox::Error run(Context *ctx) noexcept {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sleepTime = 2;
|
sleepTime = 10;
|
||||||
}
|
}
|
||||||
draw(ctx);
|
draw(ctx);
|
||||||
glfwSwapBuffers(id->window);
|
glfwSwapBuffers(id->window);
|
||||||
if (!ctx->constantRefresh) {
|
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);
|
glfwWaitEventsTimeout(sleepTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user