summaryrefslogtreecommitdiff
path: root/src/xdemos/glxgears.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-06-04 16:04:04 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-06-04 16:04:04 -0600
commitb843b0187e194e111ccf6f8c3e963cfc490543dc (patch)
tree7afec4f6d02c85a96b9f79cc6c2ad461e635a3e2 /src/xdemos/glxgears.c
parent192e2fe3c0e6b3d2ac27ef12a02aa0d152965734 (diff)
press 'a' to toggle animation
Diffstat (limited to 'src/xdemos/glxgears.c')
-rw-r--r--src/xdemos/glxgears.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/xdemos/glxgears.c b/src/xdemos/glxgears.c
index 8dbbc111..f8c6c75c 100644
--- a/src/xdemos/glxgears.c
+++ b/src/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))