summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2003-08-28 03:07:49 +0000
committerBrian Paul <[email protected]>2003-08-28 03:07:49 +0000
commit0b126507016a9b9d9bae88006f6c21e1e249aff3 (patch)
tree0e53736100dd8b31e2bf941d90ec82cbc87cc910
parent781fb93877ea3a6faeefcdb48d9b463da7d954a3 (diff)
space bar to toggle animation
-rw-r--r--progs/demos/texcyl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/progs/demos/texcyl.c b/progs/demos/texcyl.c
index 61c8d908b06..52f7da0af20 100644
--- a/progs/demos/texcyl.c
+++ b/progs/demos/texcyl.c
@@ -115,6 +115,10 @@ static void ModeMenu(int entry)
{
if (entry==ANIMATE) {
Animate = !Animate;
+ if (Animate)
+ glutIdleFunc(Idle);
+ else
+ glutIdleFunc(NULL);
}
else if (entry==POINT_FILTER) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
@@ -139,6 +143,13 @@ static void Key( unsigned char key, int x, int y )
(void) x;
(void) y;
switch (key) {
+ case ' ':
+ Animate = !Animate;
+ if (Animate)
+ glutIdleFunc(Idle);
+ else
+ glutIdleFunc(NULL);
+ break;
case 27:
exit(0);
break;