call preMainLoop/postMainLoop from glut