progs/demos: call glutDestroyWindow() upon exit
This commit is contained in:
@@ -26,6 +26,8 @@
|
|||||||
/* Target engine speed: */
|
/* Target engine speed: */
|
||||||
const int RPM = 100.0;
|
const int RPM = 100.0;
|
||||||
|
|
||||||
|
static int Win = 0;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Engine description.
|
* Engine description.
|
||||||
@@ -1154,6 +1156,7 @@ OptRotate(void)
|
|||||||
static void
|
static void
|
||||||
OptExit(void)
|
OptExit(void)
|
||||||
{
|
{
|
||||||
|
glutDestroyWindow(Win);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1323,7 +1326,7 @@ main(int argc, char *argv[])
|
|||||||
glutInitWindowSize(WinWidth, WinHeight);
|
glutInitWindowSize(WinWidth, WinHeight);
|
||||||
glutInit(&argc, argv);
|
glutInit(&argc, argv);
|
||||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||||
glutCreateWindow("OpenGL Engine Demo");
|
Win = glutCreateWindow("OpenGL Engine Demo");
|
||||||
glewInit();
|
glewInit();
|
||||||
glutReshapeFunc(Reshape);
|
glutReshapeFunc(Reshape);
|
||||||
glutMouseFunc(Mouse);
|
glutMouseFunc(Mouse);
|
||||||
|
Reference in New Issue
Block a user