in mainLoop im doing:
totalMilliPassed+=millisecondsPassed;
I print the value out every so often to watch time pass. I am seeing the time passing slower then it should as measured by calls to this every so often:
myGameDevice->getTimer()->start();
myGameDevice->getTimer()->tick();
u32 lastTime=myGameDevice->getTimer()->getTime();
u32 timeDiff=0;
u32 nextTime=0;
while(game->running&&myGameDevice->run())
{
myGameDevice->getTimer()->tick();//This is probably not needed since I believe it happens in the irr render function
u32 nextTime=myGameDevice->getTimer()->getTime();
timeDiff=nextTime-lastTime;
lastTime=nextTime;
game->mainLoop(timeDiff);
game->render();
}
myGameDevice->getTimer()->stop();
But i must really not get this cause the time is always comming back as 0. Does anyone know how to use this correctly?
Don't call startTimer() unless you've called stopTimer(). It has a bug that causes it to stop the timer if it is already running. You should be able to write this...