destroy window during cleanup
authorBrian <brian@yutani.localnet.net>
Tue, 6 Mar 2007 23:33:00 +0000 (16:33 -0700)
committerBrian <brian@yutani.localnet.net>
Tue, 6 Mar 2007 23:33:00 +0000 (16:33 -0700)
progs/tests/fbotest1.c
progs/tests/fbotexture.c

index ed72ab16dd8b95ab9f062bc0c1da4e1bb4956d48..8f4569ff3b4f466cb4b3d71e36fd1de438bfccb6 100644 (file)
@@ -13,6 +13,7 @@
 #include <math.h>
 #include <GL/glut.h>
 
+static int Win;
 static int Width = 400, Height = 400;
 static GLuint MyFB, MyRB;
 
@@ -99,6 +100,7 @@ CleanUp(void)
    glDeleteRenderbuffersEXT(1, &MyRB);
    assert(!glIsFramebufferEXT(MyFB));
    assert(!glIsRenderbufferEXT(MyRB));
+   glutDestroyWindow(Win);
    exit(0);
 }
 
@@ -194,7 +196,7 @@ main( int argc, char *argv[] )
    glutInitWindowPosition( 0, 0 );
    glutInitWindowSize(Width, Height);
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
-   glutCreateWindow(argv[0]);
+   Win = glutCreateWindow(argv[0]);
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );
    glutDisplayFunc( Display );
index 13a29db3f35d556ff17c04eacdf4a72232bb1c60..aa9f6171221ce5950b7d60e22dc38166f06a9d0d 100644 (file)
@@ -23,6 +23,7 @@
 #define DRAW 1
 
 
+static int Win = 0;
 static int Width = 400, Height = 400;
 
 static GLenum TexTarget = GL_TEXTURE_2D; /*GL_TEXTURE_RECTANGLE_ARB;*/
@@ -232,6 +233,8 @@ CleanUp(void)
 
    glDeleteTextures(1, &TexObj);
 
+   glutDestroyWindow(Win);
+
    exit(0);
 }
 
@@ -392,7 +395,7 @@ main(int argc, char *argv[])
    glutInitWindowPosition(0, 0);
    glutInitWindowSize(Width, Height);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
-   glutCreateWindow(argv[0]);
+   Win = glutCreateWindow(argv[0]);
    glutReshapeFunc(Reshape);
    glutKeyboardFunc(Key);
    glutDisplayFunc(Display);