summaryrefslogtreecommitdiff
path: root/progs/demos
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-04-20 11:59:18 -0600
committerBrian <brian@yutani.localnet.net>2007-04-21 10:05:05 -0600
commitbc74cb4c0ae6210eab403ee879492fc19644b3f2 (patch)
treeb5e158c7b15886ea8c64ac774b04ce0e05200219 /progs/demos
parent257f799849a1eb3e81851b92a8fd27efa8f93d47 (diff)
destroy window upon exit
Diffstat (limited to 'progs/demos')
-rw-r--r--progs/demos/arbfplight.c4
-rw-r--r--progs/demos/fplight.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/progs/demos/arbfplight.c b/progs/demos/arbfplight.c
index d9c564fbe5..bc2c7e312a 100644
--- a/progs/demos/arbfplight.c
+++ b/progs/demos/arbfplight.c
@@ -24,6 +24,7 @@ static GLuint VertProg;
static GLboolean Anim = GL_TRUE;
static GLboolean Wire = GL_FALSE;
static GLboolean PixelLight = GL_TRUE;
+static GLint Win;
static GLint T0 = 0;
static GLint Frames = 0;
@@ -148,6 +149,7 @@ static void Key( unsigned char key, int x, int y )
case 27:
glDeleteProgramsARB_func(1, &VertProg);
glDeleteProgramsARB_func(1, &FragProg);
+ glutDestroyWindow(Win);
exit(0);
break;
}
@@ -382,7 +384,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 200, 200 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
+ Win = glutCreateWindow(argv[0]);
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/demos/fplight.c b/progs/demos/fplight.c
index c7a38248d3..fb510cccc8 100644
--- a/progs/demos/fplight.c
+++ b/progs/demos/fplight.c
@@ -24,7 +24,7 @@ static GLuint VertProg;
static GLboolean Anim = GL_TRUE;
static GLboolean Wire = GL_FALSE;
static GLboolean PixelLight = GL_TRUE;
-
+static GLint Win;
static GLfloat Xrot = 0, Yrot = 0;
@@ -136,8 +136,8 @@ static void Key( unsigned char key, int x, int y )
}
break;
case 27:
+ glutDestroyWindow(Win);
exit(0);
- break;
}
glutPostRedisplay();
}
@@ -272,7 +272,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 200, 200 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
+ Win = glutCreateWindow(argv[0]);
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );