Demos (master): polys: destroy window before exiting
Brian Paul
brianp at kemper.freedesktop.org
Thu Jul 21 16:11:17 UTC 2011
Module: Demos
Branch: master
Commit: e980752741cb2347b4a287c829bb27a6a2b4f0d3
URL: http://cgit.freedesktop.org/mesa/demos/commit/?id=e980752741cb2347b4a287c829bb27a6a2b4f0d3
Author: Brian Paul <brianp at vmware.com>
Date: Thu Jul 21 09:10:48 2011 -0600
polys: destroy window before exiting
---
src/redbook/polys.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/redbook/polys.c b/src/redbook/polys.c
index 4889c54..3d2ce06 100644
--- a/src/redbook/polys.c
+++ b/src/redbook/polys.c
@@ -44,6 +44,8 @@
#include <stdlib.h>
#include "glut_wrap.h"
+static int win;
+
static void display(void)
{
GLubyte fly[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -111,6 +113,7 @@ key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
+ glutDestroyWindow(win);
exit(0);
break;
default:
@@ -128,7 +131,7 @@ int main(int argc, char** argv)
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (350, 150);
- glutCreateWindow (argv[0]);
+ win = glutCreateWindow (argv[0]);
myinit ();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
More information about the mesa-commit
mailing list