PDA

View Full Version : GL + timer queue



ugluk
01-28-2012, 12:31 PM
If my rendering loop looks like this:

{
issueCommands();
swapBuffers();
}
Where is the best place to process a timer queue (processTimerQueue()), before swapping or after? I am pretty certain that the buffer swapping can block (say for VSync) and hence, the best place might be before the swap? How about the GL commands? Before or after? My guess is after, but I am not certain.

ugluk
01-28-2012, 03:18 PM
Yeah, I think after issueCommands() would be a good place.

Rationale:
Timer callbacks can alter textures, VBOs ... and might stall the pipeline, if they were called before issueCommands().