Jump to content
  • Advertisement
Sign in to follow this  
Tom Backton

OpenGL Disabling Vertical Synchronization (vsync)

This topic is 3194 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...)

Share this post


Link to post
Share on other sites
Advertisement

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);
}

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!