PDA

View Full Version : About VSync



Benjamin3D
09-12-2012, 12:08 AM
Hi everybody,

I'm currently working on vertical synchronization. The question is simple : On windows I've found a method (wglGetSwapIntervalEXT() in WGL_EXT_swap_control) to know if VSync is activated.

My problem is, I cannot find the method for linux support. I have already checked SGI and ARB even if I don't know so much about extensions.

Thanks
Benjamin

Dark Photon
09-12-2012, 06:08 PM
I'm currently working on vertical synchronization. The question is simple : On windows I've found a method (wglGetSwapIntervalEXT() in WGL_EXT_swap_control) to know if VSync is activated.

My problem is, I cannot find the method for linux support. I have already checked SGI and ARB even if I don't know so much about extensions

http://www.opengl.org/registry/ is your friend. See GLX_EXT_swap_control (http://www.opengl.org/registry/specs/EXT/swap_control.txt). NVidia supports this at least.

If you check the extension spec, you'll see there is a GLX_SWAP_INTERVAL_EXT state on the drawable that can be queried via glXQueryDrawable() -- see the extension spec for full code here. But why can't you just cache this value off in your app space rather than query GLX / the X server for it. Likely to be faster (gets should generally be avoided for performance).

Also you might be interested in the GLX_EXT_swap_control_tear (http://www.opengl.org/registry/specs/EXT/glx_swap_control_tear.txt) extension.