summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-05-08 08:36:49 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-05-08 08:37:52 -0600
commit6a3fac871104c5cf3cd1c6a7767ba66d10446475 (patch)
tree6f8a22c38e8f0b258ea51703bd981e3e14a7d727
parent9508293e0186ded3be212a377b1fe39d68070da7 (diff)
call glutDestroyWindow()
-rw-r--r--progs/trivial/tri.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/progs/trivial/tri.c b/progs/trivial/tri.c
index 58a650b559..d4a7f08ae3 100644
--- a/progs/trivial/tri.c
+++ b/progs/trivial/tri.c
@@ -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);
}