Hey there ya all
As the header implies my app runs too fast. It just does everything as fast as it can, which is to fast! I need to control it so it has a fixed speed, not speed related to the numbers of calculations it has to currently do...
What can you do to solve this? 30fps is kind of minimum right?
My app runs to fast!
-
Mike
I would do a pause loop after drawing the scene...
I prefer GeTickCount(), because it has a resolution of 1/1000 seconds...
I prefer GeTickCount(), because it has a resolution of 1/1000 seconds...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:

http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Code: Select all
smgr->addCameraSceneNodeFPS(0,100.0f,300.0f);
-
Mike
-
Guest
instead of implementing all your movement and such according to the framerate you might want to try doing it independent of framerate....
such as...
moveforward()
{
timefactor = currenttime - starttime;
setposition = movevector* timefactor;
}
something like that, so that no matter what fps you get, the movement is still going to be the same.
such as...
moveforward()
{
timefactor = currenttime - starttime;
setposition = movevector* timefactor;
}
something like that, so that no matter what fps you get, the movement is still going to be the same.
-
William Finlayson
- Posts: 61
- Joined: Mon Oct 25, 2004 12:11 am
I always implement my time-based actions with an update(int ticks) method.
lastTime = timer.getTime()
main loop
currentTime = timer.getTime()
ticks = currentTime - lastTime
thing1.update(ticks)
thing2.update(ticks)
lastTime = currentTime
draw stuff etc
end loop
You mentioned that your calculation was done on a tick basis, so I hope this helps.
lastTime = timer.getTime()
main loop
currentTime = timer.getTime()
ticks = currentTime - lastTime
thing1.update(ticks)
thing2.update(ticks)
lastTime = currentTime
draw stuff etc
end loop
You mentioned that your calculation was done on a tick basis, so I hope this helps.