Use glFinish instead of glFlush