diff options
Diffstat (limited to 'progs/trivial/tri.c')
-rw-r--r-- | progs/trivial/tri.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/progs/trivial/tri.c b/progs/trivial/tri.c index 12fa8d11b6..d3c6b59ea5 100644 --- a/progs/trivial/tri.c +++ b/progs/trivial/tri.c @@ -33,6 +33,7 @@ GLenum doubleBuffer = 1; +int win; static void Init(void) { @@ -56,15 +57,13 @@ static void Reshape(int width, int height) static void Key(unsigned char key, int x, int y) { - - switch (key) { - case 27: - exit(0); - default: - return; - } - - glutPostRedisplay(); + switch (key) { + case 27: + exit(0); + default: + glutPostRedisplay(); + return; + } } static void Draw(void) @@ -120,7 +119,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); } |