Hello, I’m new here, and I’ve been able to resolve most of my issues by just seaching these forums, but I may now be encountering an issue that no one else seems to have discussed.
I’m developing under both Windows and Linux with a Quadro FX 3400. With vsync enabled, if I draw to a single window, as one would expect, I get no tearing. If I draw to two or more windows, all of my windows tear at about the same physical location down the screen (about 1/6th to 1/5th of the way from the top of the screen). If I drag the windows below that area, then I don’t see the tear. This happens all on one monitor, in single-monitor mode.
The PC itself is a dual-CPU machine, and each window has its own thread, and therefore its own SwapBuffers () call. The threads are synchronized to a main control thread using semaphores.
The logic under Windows looks like this:
control_thread:
[list=a][li]spawn threads[1,2][]loop forever:[]* block until threads[1,2] signal “finish” semaphores.[] release “start” semaphores for threads[1,2][/LIST][/li]thread[n]:
[list=a][li]create and initialize window and context[]loop forever:[]* draw stuff[] swapbuffers[] issue paint message[] handle paint message[] release “finish” semaphores[] wait for “start” semaphore[/LIST][/li]With vsync on, this whole program is effectively synchronized to the refresh rate, but with multiple windows, I still get tearing. Does anyone have any advice on how I can get rid of the tearing? Thanks.