From 6a3fac871104c5cf3cd1c6a7767ba66d10446475 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 8 May 2008 08:36:49 -0600 Subject: call glutDestroyWindow() --- progs/trivial/tri.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'progs/trivial') 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); } -- cgit v1.2.3