fix some bug for glut and sdl