projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
76560af
)
use fmod() to prevent overflow of angle variable
author
Brian Paul
<brian.paul@tungstengraphics.com>
Fri, 30 Sep 2005 15:03:33 +0000
(15:03 +0000)
committer
Brian Paul
<brian.paul@tungstengraphics.com>
Fri, 30 Sep 2005 15:03:33 +0000
(15:03 +0000)
progs/demos/gears.c
patch
|
blob
|
history
diff --git
a/progs/demos/gears.c
b/progs/demos/gears.c
index 679fac44893f260a269f8a1481d734a67ef9e780..ab9bc007421f3d37aecc25abd0cd8e3cb3ed862c 100644
(file)
--- a/
progs/demos/gears.c
+++ b/
progs/demos/gears.c
@@
-234,7
+234,9
@@
idle(void)
dt = t - t0;
t0 = t;
- angle += 70.0 * dt; /* 90 degrees per second */
+ angle += 70.0 * dt; /* 70 degrees per second */
+ angle = fmod(angle, 360.0); /* prevents eventual overflow */
+
glutPostRedisplay();
}