Disabling Vertical Synchronization (vsync)

Started by
6 comments, last by SimonForsman 14 years, 3 months ago
On Windows, it's quite simple: calling wglSwapIntervalEXT(0) does that (unless WGL_EXT_swap_control is not supported...). But how can it be done in Linux? The specification of GLX_SGI_swap_control clearly says that a value of 0 is not supported, while the OpenGL Wiki says glxSwapIntervalSGI() does accept 0. Sp does it accept 0 or not? In not, how do I turn off vsync on Linux? (and why does the OpenGL wiki contradict itself and the specifications so often? It confuses beginners like me whose knowledge is based on such resources as they don't have much experience to learn from...)
Advertisement
Why would you even want to turn it off? Screen tearing is a sin
Probably he's having 50 fps.

Sorry can't help with linux
Have you considered using SDL for this? Even if you don't want to port your program to SDL, you could browse the source and see what happens when you set the SDL_GL_SWAP_CONTROL on Linux.
void WindowImplX11::UseVerticalSync(bool Enabled){    const GLubyte* ProcAddress = reinterpret_cast<const GLubyte*>("glXSwapIntervalSGI");    PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = reinterpret_cast<PFNGLXSWAPINTERVALSGIPROC>(glXGetProcAddress(ProcAddress));    if (glXSwapIntervalSGI)        glXSwapIntervalSGI(Enabled ? 1 : 0);}

I probably understand your problem and confusion. In the linux version of my 3D engine, I can change the swap-interval from 2 or 1 to 0, but the frame rate does not increase to "faster-than-vsync-rate" as it should. This drove me nuts too, but eventually I ran the nvidia video/display application and change the vsync settings back and forth - and eventually found a setting that let swap-interval == 0 not wait for vsync before redrawing the window. Until you change that setting in the application, you'll never be able to let your application "freewheel at full speed". Hope this helps.
Using my Nvidia card (and proper driver setting) glxSwapIntervalSGI(0) turns off vsync. (although the function is said to return an error when argument is 0)
Using my ATI card I found out that I have to use wglSwapIntervalEXT under Linux to control vsync! I have reported the bug but as long as I had my ATI card in use it was not fixed.
Quote:Original post by Kambiz
Using my Nvidia card (and proper driver setting) glxSwapIntervalSGI(0) turns off vsync. (although the function is said to return an error when argument is 0)
Using my ATI card I found out that I have to use wglSwapIntervalEXT under Linux to control vsync! I have reported the bug but as long as I had my ATI card in use it was not fixed.


Huh, does ATI support wgl extensions in their Linux driver ?

Thats ... wierd ;)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

This topic is closed to new replies.

Advertisement