call glutDestroyWindow()

This commit is contained in:
Brian Paul 2008-05-08 08:36:49 -06:00
parent 9508293e01
commit 6a3fac8711
1 changed files with 5 additions and 2 deletions

View File

@ -33,6 +33,7 @@
GLenum doubleBuffer;
int win;
static void Init(void)
{
@ -59,7 +60,8 @@ static void Key(unsigned char key, int x, int y)
switch (key) {
case 27:
exit(1);
glutDestroyWindow(win);
exit(0);
default:
return;
}
@ -122,7 +124,8 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
if (glutCreateWindow("First Tri") == GL_FALSE) {
win = glutCreateWindow("First Tri");
if (!win) {
exit(1);
}