Synchronizing multiple OpenGL windows to vsync Synchronizing multiple OpenGL windows to vsync multithreading multithreading

Synchronizing multiple OpenGL windows to vsync


In Linux a lot of strange behavior occurred to my applications because of calling video functions from various threads.

I solved these problems using one thread only for display since the start of application, create window, create glcontext, etc., and using semaphores and queues for sharing data between this thread and the others.


You might be able to obtain the output device and use the WaitForVBlank function in a loop from a thread. That can then post messages or signal events for each window that you're interested in.