diff options
Diffstat (limited to 'progs/trivial/tri.c')
-rw-r--r-- | progs/trivial/tri.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/progs/trivial/tri.c b/progs/trivial/tri.c index 12fa8d11b61..aa45adb6c29 100644 --- a/progs/trivial/tri.c +++ b/progs/trivial/tri.c @@ -33,6 +33,7 @@ GLenum doubleBuffer = 1; +int win; static void Init(void) { @@ -59,6 +60,7 @@ static void Key(unsigned char key, int x, int y) switch (key) { case 27: + glutDestroyWindow(win); exit(0); default: return; @@ -120,7 +122,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); } |