Mesa (lp-binning): progs/demos: call glutDestroyWindow() upon exit

Brian Paul brianp at kemper.freedesktop.org
Fri Jan 22 02:10:47 UTC 2010


Module: Mesa
Branch: lp-binning
Commit: e5829ccc2b0cb1eed27c89763e8e4c6775dd6d4c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e5829ccc2b0cb1eed27c89763e8e4c6775dd6d4c

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Jan 21 15:41:03 2010 -0700

progs/demos: call glutDestroyWindow() upon exit

---

 progs/demos/engine.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/progs/demos/engine.c b/progs/demos/engine.c
index 7e48511..a414835 100644
--- a/progs/demos/engine.c
+++ b/progs/demos/engine.c
@@ -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);




More information about the mesa-commit mailing list