frames per second?

Blitz3D Forums/Blitz3D Beginners Area/frames per second?

blade007(Posted 2008) [#1]
is there a way to force a person down to a specific FPS? because some computers can run games 10 times faster...


El Gigante de Yeso(Posted 2008) [#2]
Through the use of timers. Timers allow you to create a sort of "clock" wich "ticks" every x milliseconds (you define the period when creating the timer). After you have your frame calculated, you can use the timer to wait until the next tick, ensuring you're only going to calculate and render a limited number of frames per second.

Example:


Edit: Fix'd


Mortiis(Posted 2008) [#3]
http://membres.lycos.fr/blitzcoder/cgi-bin/articles/Wc3007660fb567.htm


Stevie G(Posted 2008) [#4]
@ El Gigante - createtimer takes FPS as it's parameter. Your example is wrong and assumes 16-17 FPS, rather than 60.

http://www.blitzbasic.com/b3ddocs/command.php?name=CreateTimer&ref=2d_a-z


El Gigante de Yeso(Posted 2008) [#5]
Oh, sorry. I always used Delta Timing to control my world logic, that's why I didn't exactly know wich was the parameter. I assume it was the period in milliseconds, instead of the FPS, just like in most libraries.


blade007(Posted 2008) [#6]
thank you so much

I always thought createtimer was something else...


John Blackledge(Posted 2008) [#7]
http://www.blitzbasic.co.nz/codearcs/codearcs.php?code=1497