setting the FPS

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
RiChArD_fLoOd
Posts: 11
Joined: Fri Sep 23, 2005 10:32 pm
Location: UK, England, Stockport

setting the FPS

Post by RiChArD_fLoOd »

hello all when im making my game the FPS is always really high, i know this may sound stupid but does some1 know how to limit it to a value so the FPS will never go over it, this would just make my game look a little less sloppy as it tends to jump from FPS to FPS all the time trying to be as fast as possible without sticking to a comfortable speed.
thanks in advance :wink:
specialtactics
Posts: 17
Joined: Tue Dec 09, 2003 9:03 am
Location: Germany

Post by specialtactics »

Hi,

i don't think there's direct support for this in irrlicht. Under Windows you can use Sleep(time), under Linux usleep(time) to suspend the program for time in ms. You will have to calculate for how long you have to suspend the program each frame to achieve the wanted framerate.
Guest

Post by Guest »

the FPS jumps are not worrying me ... if the scene runs at 40 fps but if it has jumped down from even 180 fps the human eye is not sensitive to such frequnce jumpdown at all....how can I set a absolute FPS? sleep()? .... if you take a look at a storm lightning, you see it for like a 1/20 of second, in fact hte lightning takes only 1/10 000 of a second, human eye is sampling the space it sees by a frequence around 26, so everything over 30fps is cool...I am sure in irrlicht is a screen drawing frequence too...based on the hardware 100%usage defaultly, but how can it be accessed would be usefull to know I think
RiChArD_fLoOd
Posts: 11
Joined: Fri Sep 23, 2005 10:32 pm
Location: UK, England, Stockport

Post by RiChArD_fLoOd »

oh ok cheers, i'll try to figure out the sleep method but thanks for the help. isnt there a way of doing this with ticks and a tickcounter in win api. ive not heard much on this does anyone know anything?
dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

I did a forum search for "60" and came up with a few things relevant to this topic. here's one. There's some kind of time slicing approach you can use. Irrlicht comes with its own hi resolution timer.


http://irrlicht.sourceforge.net/phpBB2/ ... t=60#52947
Guest

Post by Guest »

yeah use ITimer and set up specific calls to the render functions Only when a certain time is reached (every 30/60 fps or whatever).. also decouple your gamelogic/input while you are at it to be updated every 100fps for instance (to keep it smooth). When you render check the time if it is gone render it now, or wait until it is time that way low frames are allowed through but a cap is put on the upper limit
Post Reply