use glFlush instead of glFinish