How can I avoid “Tearing” on screen updates? If i do a aglswapdoublebuffer in the middle of a video update, part of the old image is drawn, and part of the new one is. The problem is that I can’t tell when a video update is going to occur.
Is there someway of manually counting the number of video refreshes since startup? That way I could poll that number, and only redraw when it increases.
At this time aglSwapInterval is not yet implemented so callling this function makes no diference.
The only way to avoid tearing is to install
a VBL task (see Apple developer web site to find more info.) to test when the screen refresh is at the vertical retrace, and only then call aglSwapBuffers.
Also you should make shure to call glFlush() before swaping the buffers .
Unfortunately syncing to the VBL by installing a VBL task, then calling aglFlush(), then calling aglSwapBuffers() still results in tearing.
For futher discussion and a demo, please contact me directly at <adario@softhome.net>.
Thank you.