mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 06:40:11 +01:00
destroy window during cleanup
This commit is contained in:
parent
0af1c6b5d1
commit
2282d81536
2 changed files with 7 additions and 2 deletions
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue