Making glfwSwapInterval work in GLFW 3.0

martinbis11 wrote on Tuesday, May 14, 2013:


I’m using GLFW 3.0 from GIT and I have a problem with glfwSwapInterval under Windows 7 : it doesn’t work…

It is because _glfwIsCompositionEnabled() returns true (see implementation of _glfwPlatformSwapInterval in wgl_context.c). The comment says “Don’t enabled vsync when desktop compositing is enabled, as it leads to frame jitter”.

So the question is : how can we deal with this? I’d like to use the swap interval thingy to control my frame rate, but now glfwSwapInterval “fails” silently… Since modern window managers use composition, it seems that this should be a common/almost universal problem for applications with a target framerate…

I can disable this check in GLFW, which will cause some frame jittering, but for now it’s a lesser problem… Any suggestion?



miran46 wrote on Friday, August 09, 2013:

Any updates on this? I have this problem with GLFW 3.0.1 and windows7 x64. My Nvidia settings for vertical sync are set to use application settings. SwapInterval works using GLFW 2.7 on the same computer.

elmindreda wrote on Thursday, August 15, 2013:

GLFW 3.0.2 will have the GLFW_USE_DWM_SWAP_INTERVAL CMake option, which will force the use of vsync even on systems using Aero and DWM.