From: Brian Paul Date: Thu, 25 Aug 2005 17:46:04 +0000 (+0000) Subject: Update the glut idle function after a new window is created X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e247d52e34793e195e8164c0a461fb428c171af;p=mesa.git Update the glut idle function after a new window is created --- diff --git a/progs/demos/reflect.c b/progs/demos/reflect.c index 9a41a86083a..892930417e2 100644 --- a/progs/demos/reflect.c +++ b/progs/demos/reflect.c @@ -409,6 +409,15 @@ Idle(void) } +static void +UpdateIdleFunc(void) +{ + if (AnyAnimating()) + glutIdleFunc(Idle); + else + glutIdleFunc(NULL); +} + static void Key(unsigned char key, int x, int y) { @@ -436,14 +445,12 @@ Key(unsigned char key, int x, int y) case ' ': w->anim = !w->anim; w->t0 = -1; - if (AnyAnimating()) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); + UpdateIdleFunc(); glutPostRedisplay(); break; case 'n': CreateWindow(); + UpdateIdleFunc(); break; case 'k': KillWindow(w);