View Full Version : Lock swapbuffers to frame rate

12-25-2012, 07:02 PM
I am developing an application for research in which I need extreme precision of frame updates.

The graphics is very simple - a high resolution checkerboard which inverts every 4 frames. The key thing is that there must be no dropped frames or variation of the update rate. I thought of simply having the two images in double buffered memory and simply issuing the swapbuffers command to flip them but I don't know a way of tying the code execution to the vsync. The same thing could be achieved by translating the pattern horizontally or vertically by one square except that the image would need to be bigger than the screen so that the edges don't move. Is there any simple way to do this fairly simple task with the required precision?

Any help much appreciated

12-26-2012, 01:59 AM
See glXSwapIntervalSGI. If you can guarantee to call you swapbuffers faster than 16ms, this will give you a steady 60Hz on a 60Hz monitor.

12-29-2012, 05:27 AM