Question about glfwPollEvents()

So it seems most often people place glfwPollEvents() inside the render loop. Doesn’t this mean that events such as keyboards presses and mouse clicks will only get handled as often as the frame is updated? Meaning events will be processed slower if running on a monitor with lower framerate. Am I misunderstanding what glfwPollEvents() does? It doesn’t seem possible to put glfwPollEvents() in a different, faster running thread. Is there any way around this?

If you want to call glfwPollEvents() more frequently than you update your rendering then the usual approach is to move the rendering to another thread, and use glfwMakeContextCurrent on that thread (if using OpenGL).

You can find a bit more information in posts here if you search for multithreading, including this one where @elmindreda explains the OS requirements for why glfwPollEvents must be called from the main thread.

1 Like

That works, Thanks!
Also rendering now continues while dragging or resizing the window which is something else I was looking for.