summaryrefslogtreecommitdiffstats
path: root/progs/demos/renormal.c
diff options
context:
space:
mode:
authorTed Jump <[email protected]>1999-09-17 02:40:51 +0000
committerTed Jump <[email protected]>1999-09-17 02:40:51 +0000
commit83c02efa520eb2f8b3f5430be47bcd9c9749b30f (patch)
tree7e64e011d244460c4c7f3c6e177727249070c81e /progs/demos/renormal.c
parent74783e9936c59b8098f769061c6b216cad73edcf (diff)
Added ESC key handling
Diffstat (limited to 'progs/demos/renormal.c')
-rw-r--r--progs/demos/renormal.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/progs/demos/renormal.c b/progs/demos/renormal.c
index bd099dcdc80..8a86ac7cff6 100644
--- a/progs/demos/renormal.c
+++ b/progs/demos/renormal.c
@@ -1,4 +1,4 @@
-/* $Id: renormal.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
+/* $Id: renormal.c,v 1.2 1999/09/17 02:40:51 tjump Exp $ */
/*
* Test GL_EXT_rescale_normal extension
@@ -6,7 +6,7 @@
*/
/*
- * $Id: renormal.c,v 1.1 1999/08/19 00:55:40 jtg Exp $
+ * $Id: renormal.c,v 1.2 1999/09/17 02:40:51 tjump Exp $
*/
@@ -95,6 +95,18 @@ static void ModeMenu(int entry)
glutPostRedisplay();
}
+static void
+key(unsigned char k, int x, int y)
+{
+ switch (k) {
+ case 27: /* Escape */
+ exit(0);
+ break;
+ default:
+ return;
+ }
+ glutPostRedisplay();
+}
int main( int argc, char *argv[] )
{
@@ -110,6 +122,7 @@ int main( int argc, char *argv[] )
glutIdleFunc( Idle );
glutReshapeFunc( Reshape );
glutDisplayFunc( Display );
+ glutKeyboardFunc(key);
glutCreateMenu(ModeMenu);
glutAddMenuEntry("Unscaled", UNSCALED);