glXWaitVideoSyncSGI usage

I read the specification of the GLX_SGI_video_sync extension, but I’m not too sure about the proper way of using it. For example, is the following correct ?

glXWaitVideoSyncSGI puts the calling process to sleep until (C mod D) = R
In my case, D = 1 and R = 0, so the condition is (C mod 1) = 0, which is always true. Can I rely on glXWaitVideoSync always waiting at least until the next video sync, or is it possible that, the condition being always true, the function return immediately, leaving me in between two video sync ?

Another way would be to use this:

unsigned int count;
glXGetVideoSyncSGI(&count);
glXWaitVideoSyncSGI(2, (count+1) & 1, &count);
glXSwapBuffers(...);

But this feels rather convoluted, and if the retrace happens in between GetVideoSync and WaitVideoSync, it will end up waiting more than necessary.

So, how are people using glXWaitVideoSync ? Any help appreciated; thanks!


Julien Cugnière

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.