I am quite new to GLFW and OpenGL in general, and I'm working on a small model renderer. I am currently working on the inputs, and I am facing an issue with how GLFW handles inputs, let me explain : Every tutorials are telling to use glfwGetKey and an "if forest" to see if such and such key has been pressed. The issue I've got with that is that it might become slow if I map a lot of keys, plus it's ugly. So I use function pointers tables and glfwSetKeyCallback in order to speed that up and have a cleaner code. The issue I've got is I'm facing what looks like a race condition, the camera seems to stutter. I'm using a delta time computed on each frame in order to have constant speed. From what I could see, it seems like the key callback function is called every once in a while and not once on each frame when a key is repeated... I am using the latest version of glfw3 from their github, I swap the buffer at the beginning of each loop and use glfwPollEvents() at the end.
My question is the following : is there a way to synchronize the glfwPollEvents call and the rendering in order to avoid the stuttering and the deltatime difference between rendering loop and the callback function ? Thanks in advance for your help !