开发者

OpenGl glutIdleFunc(void (*func)(void))

开发者 https://www.devze.com 2022-12-24 08:45 出处:网络
I\'m trying to design very simple animation in OpenGL such as rotating and translating objects. In the red book, I found that using GLUT\'s glutIdleFunc() is okay for a simple animation.

I'm trying to design very simple animation in OpenGL such as rotating and translating objects. In the red book, I found that using GLUT's glutIdleFunc() is okay for a simple animation.

How 开发者_开发百科many times does glutIdleFunc(...) call the function in one second?

Thank you.


glutIdleFunc is "continuously called when events are not being received". The update speed depends heavily on the system on which you are running, and will vary over the lifetime of the program, since it will slow down or even stop being called as events are being received.

In a typical windowed application, though, this gets called regularly enough to provide reasonable behavior. However, if you want a constant speed for rotation/translation, you'll need to implement your own timing to handle keeping the speed constant.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号