diff options
author | Brian Paul <[email protected]> | 2008-06-04 16:04:04 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-06-04 16:04:04 -0600 |
commit | 6d9c3fa0c2aee1bcddc414781ef5ab54873e4de8 (patch) | |
tree | fd4f1f01e4b086026aecb57d7c9727e8ee9ca7b3 | |
parent | c35e021f374e58345bcd1b663fe3ef754bb665fa (diff) |
press 'a' to toggle animation
-rw-r--r-- | progs/xdemos/glxgears.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/progs/xdemos/glxgears.c b/progs/xdemos/glxgears.c index 8dbbc111c81..f8c6c75ce5d 100644 --- a/progs/xdemos/glxgears.c +++ b/progs/xdemos/glxgears.c @@ -94,6 +94,7 @@ static GLfloat angle = 0.0; static GLboolean fullscreen = GL_FALSE; /* Create a single fullscreen window */ static GLboolean stereo = GL_FALSE; /* Enable stereo. */ +static GLboolean animate = GL_TRUE; /* Animation */ static GLfloat eyesep = 5.0; /* Eye separation. */ static GLfloat fix_point = 40.0; /* Fixation point distance. */ static GLfloat left, right, asp; /* Stereo frustum params. */ @@ -541,6 +542,9 @@ handle_event(Display *dpy, Window win, XEvent *event) /* escape */ return 1; } + else if (buffer[0] == 'a' || buffer[0] == 'A') { + animate = !animate; + } } } } @@ -552,7 +556,7 @@ static void event_loop(Display *dpy, Window win) { while (1) { - while (XPending(dpy) > 0) { + while (!animate || XPending(dpy) > 0) { XEvent event; XNextEvent(dpy, &event); if (handle_event(dpy, win, &event)) |