PDA

View Full Version : setting FPS



t3jem
06-04-2005, 12:52 PM
I am writing a program that I want to run at the same speed on all machines that can handle it. I am guessing this probably lies in setting the frames per second, but I don't know how to do that. Could someone post some code to show me how please?

Ehsan Kamrani
06-04-2005, 01:23 PM
Another solution is to use from the timer.As an example:
float elapsedTime;
float oldTime;
float currentTime;
currentTime = <CURRENT_TIME> //Use from the appropriate function
elapsedTime = currentTime - oldTime;
oldTime = currentTime;
<use from the elapsedTime in your program>
-Ehsan-

t3jem
06-04-2005, 01:25 PM
I'm not sure what you mean.

Ehsan Kamrani
06-04-2005, 01:35 PM
Doesn't it solve your problem?
http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=2;t=018648
-Ehsan-

t3jem
06-04-2005, 01:48 PM
I get it now, thanks.