Archived

This topic is now archived and is closed to further replies.

Psycho1

Framerates?

Recommended Posts

Is their a function that can refresh at a certain rate? It seems that different size video cards (in memory), it always runs a lot faster... is it a pre set refresh rate?, as fast as the computer can handle it? and can I set it differently using a function?

Share this post


Link to post
Share on other sites
well, if vsynch is turned on, then the framerate will at most be the refresh rate of the monitor, that is one way to limit the framerate. If vsynch is off, then the framerate will be as fast as the computer can update the frames. I would suggest not limmiting the framerate to a set value, but rather implementing timing routines to make sure that everything in the program runs at the same speed regardless of framerate. Then, no matter what the framerate is on a computer, everything will look the same, although a bit choppier on a slower machine.

j.w.

note. vsynch can be turned on and off (in windows anyway) via the display settings control panel. Usually under the advanced settings.

Share this post


Link to post
Share on other sites
Do not time your game to the framerate of your computer. Use something like timeGetTime() or queryPerformanceCounter() / queryPerformanceFrequency, to calculate elapsed time. This way, your actions, animations, etc. will be independant irrespective of framerate. Ex: If you have a bullet travelling 1 meter per second, it will always go one meter per second, not 3 on one machine and .5 on another.

Share this post


Link to post
Share on other sites