在Win32控制台程序中,标准的OpenGL流程是这样的:
int main(int argc, char *argv[])
{
glutInitWindowSize(500, 250);
glutInitWindowPosition ( 140, 140 );
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE );
glutInit(&argc, argv);
glutCreateWindow( "Demo" );
glClearColor(1.0, 1.0, 1.0, 1.0);
glutDisplayFunc( Display );
glutReshapeFunc( Reshape );
glutMouseFunc ( Mouse ) ;
glutMotionFunc ( Motion ) ;
glutKeyboardFunc( Key );