glutDisplayFunc fps limit?
Someone know how to limit to 60 fps the glutDisplayFunc in glutGameMode? Thanks
I don't think it can be done simply with GLUT, so maybe the answer is, what do you actually want this for?
One possibility is, in your idle function (where presumably you call glutPostRedisplay(), check if 1/60th of a second has elapsed since you last called it, and if not, don't call it.
If you want Mac OS X only, you could sync to the refresh rate of the monitor like this:
I'm sure you could do something similar with AGL, too, for Carbon.
One possibility is, in your idle function (where presumably you call glutPostRedisplay(), check if 1/60th of a second has elapsed since you last called it, and if not, don't call it.
If you want Mac OS X only, you could sync to the refresh rate of the monitor like this:
Code:
CGLContextObj context = CGLGetCurrentContext();
const long SYNC_TO_REFRESH = 1;
CGLSetParameter(context, kCGLCPSwapInterval, & SYNC_TO_REFRESH);I'm sure you could do something similar with AGL, too, for Carbon.
Quote:Originally posted by OneSadCookie
I don't think it can be done simply with GLUT, so maybe the answer is, what do you actually want this for?
I'm no 3D programmer (yet
), but be sure to put speed checks because in ten years, what if someone with a 2THz computer comes along and wants to play your game 
I am trying to play Descent I on my 400MHz G4, and the ship 'bob' goes so fast that you would think that there was an earthquake! Completely unplayable...

Steven
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| glutDisplayFunc() - "Objective-C" | KidMesh | 1 | 2,344 |
Nov 8, 2009 09:19 AM Last Post: DoG |
|
| texture limit | reubert | 1 | 2,127 |
Jun 20, 2003 09:52 PM Last Post: OneSadCookie |
|

