progs/demos: call glutDestroyWindow() upon exit
authorBrian Paul <brianp@vmware.com>
Thu, 21 Jan 2010 22:41:03 +0000 (15:41 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 21 Jan 2010 22:41:03 +0000 (15:41 -0700)
progs/demos/engine.c

index 7e485111da7774296c199adde78e3e71d5eda6b4..a4148357d49031a14b0aeeda671729e41727ad77 100644 (file)
@@ -26,6 +26,8 @@
 /* Target engine speed: */
 const int RPM = 100.0;
 
+static int Win = 0;
+
 
 /**
  * Engine description.
@@ -1154,6 +1156,7 @@ OptRotate(void)
 static void
 OptExit(void)
 {
+   glutDestroyWindow(Win);
    exit(0);
 }
 
@@ -1323,7 +1326,7 @@ main(int argc, char *argv[])
    glutInitWindowSize(WinWidth, WinHeight);
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
-   glutCreateWindow("OpenGL Engine Demo");
+   Win = glutCreateWindow("OpenGL Engine Demo");
    glewInit();
    glutReshapeFunc(Reshape);
    glutMouseFunc(Mouse);