How can I force GLFW to manage keyboard callback more than 60 times per second? That is, I want GLFW's keyboard handling speed to be dependent on actual fps. Is that possible?
0
votes
1 Answers
0
votes
GLFW doesn't take control of the 'event loop' - so you might need to avoid glfwWaitEvent, and use glfwPollEvent in conjunction with glfwSwapInterval(1) if you want key event handling with each frame. Otherwise, you're probably wasting CPU/GPU.
glfwMakeContextCurrent(win);
glfwSwapInterval(1);
...
while (!glfwWindowShouldClose(win))
{
// ... redraw ...
glfwSwapBuffers(win);
...
glfwPollEvents(); // process pending events via callbacks.
}