Whats the difference between glFlush() and glFinish() and why would I want to use these routines?
The OpenGL spec allows an implementation to store commands and data in buffers, which are awaiting execution. glFlush() causes these buffers to be emptied and executed. Thus, any pending rendering commands will be executed, but glFlush() may return before their execution is complete. glFinish() instructs an implementation to not return until the effects of all commands are executed and updated. A typical use of glFlush() might be to ensure rendering commands are exected when rendering to the front buffer. glFinish() might be particularly useful if an app draws using both OpenGL and the window system’s drawing commands. Such an application would first draw OpenGL, then call glFinish() before proceeding to issue the window system’s drawing commands.