I'm writting a game with OGL / GLFW in c++.
My game is always running at 60 fps and without any screen tearing. After doing some research, it seems that the glfwSwapInterval()
function should be able to enable/disable V-sync or the 60fps cap.
However, no matter the value I pass to the function, the framerate stays locked at 60 and there is no tearing whatsoever. I have also checked the compositor settings on linux and the nvidia panel, and they take no effect.
This is a common thing I assume, is there a way to get around this fps cap?
glfwSwapInterval(0)
would be the programmatic way, unless you need to override it directly in a driver (GPU) control panel. – VishnuglfwSwapInterval
to 0 or 1 or other number greater than 1 just enables/disables it fully rendering it useless for the vsync purpose. Setting it to 0.5 however, tells glfw to double the framerate limit to twice your screen refresh rate (120 fps in my case) and also disables vsync. So what I did to get this working was to play withglfwSwapInterval()
changing the value between 0 and 1. Hope this helps whoever finds this posts afterwards. – StilaglfwSwapInterval(0)
, but call this function right after the call toglfwMakeContextCurrent
– Barcellona