diff options
Diffstat (limited to 'progs/demos')
-rw-r--r-- | progs/demos/engine.c | 5 | ||||
-rw-r--r-- | progs/demos/gloss.c | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/progs/demos/engine.c b/progs/demos/engine.c index 7e485111da..a4148357d4 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); diff --git a/progs/demos/gloss.c b/progs/demos/gloss.c index 578736b4e2..450861e577 100644 --- a/progs/demos/gloss.c +++ b/progs/demos/gloss.c @@ -41,6 +41,7 @@ /* for convolution */ #define FILTER_SIZE 7 +static GLint Win; static GLint WinWidth = 500, WinHeight = 500; static GLuint CylinderObj = 0; static GLuint TeapotObj = 0; @@ -214,7 +215,11 @@ static void Key( unsigned char key, int x, int y ) case ' ': ToggleAnimate(); break; + case 'n': + Idle(); + break; case 27: + glutDestroyWindow(Win); exit(0); break; } @@ -439,7 +444,7 @@ int main( int argc, char *argv[] ) glutInitWindowSize(WinWidth, WinHeight); glutInit( &argc, argv ); glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0] ); + Win = glutCreateWindow(argv[0] ); glewInit(); glutReshapeFunc( Reshape ); glutKeyboardFunc( Key ); |