Skip to main content
replaced http://gamedev.stackexchange.com/ with https://gamedev.stackexchange.com/
Source Link

Your Game loop should look something like this

lastTime =  time();
while (!quit)
{
   currentTime = time();
   deltaTime = currentTime - lastTime;
   lastTime = currentTime;
   UpdateFrame(deltaTime);
}

For a crossplatform way to get the time check out this project https://github.com/rampantpixels/timer_lib

now this is called a variable time step update if your game involves physics check out this link http://gafferongames.com/game-physics/fix-your-timestep/

and also see this question here When should I use a fixed or variable time step?When should I use a fixed or variable time step?

Your Game loop should look something like this

lastTime =  time();
while (!quit)
{
   currentTime = time();
   deltaTime = currentTime - lastTime;
   lastTime = currentTime;
   UpdateFrame(deltaTime);
}

For a crossplatform way to get the time check out this project https://github.com/rampantpixels/timer_lib

now this is called a variable time step update if your game involves physics check out this link http://gafferongames.com/game-physics/fix-your-timestep/

and also see this question here When should I use a fixed or variable time step?

Your Game loop should look something like this

lastTime =  time();
while (!quit)
{
   currentTime = time();
   deltaTime = currentTime - lastTime;
   lastTime = currentTime;
   UpdateFrame(deltaTime);
}

For a crossplatform way to get the time check out this project https://github.com/rampantpixels/timer_lib

now this is called a variable time step update if your game involves physics check out this link http://gafferongames.com/game-physics/fix-your-timestep/

and also see this question here When should I use a fixed or variable time step?

added 534 characters in body
Source Link

checkYour Game loop should look something like this

lastTime =  time();
while (!quit)
{
   currentTime = time();
   deltaTime = currentTime - lastTime;
   lastTime = currentTime;
   UpdateFrame(deltaTime);
}

For a crossplatform way to get the time check out this project https://github.com/rampantpixels/timer_lib

it has support for multiple platformsnow this is called a variable time step update if your game involves physics check out this link http://gafferongames.com/game-physics/fix-your-timestep/

and also see this question here When should I use a fixed or variable time step?

check out this project https://github.com/rampantpixels/timer_lib

it has support for multiple platforms

Your Game loop should look something like this

lastTime =  time();
while (!quit)
{
   currentTime = time();
   deltaTime = currentTime - lastTime;
   lastTime = currentTime;
   UpdateFrame(deltaTime);
}

For a crossplatform way to get the time check out this project https://github.com/rampantpixels/timer_lib

now this is called a variable time step update if your game involves physics check out this link http://gafferongames.com/game-physics/fix-your-timestep/

and also see this question here When should I use a fixed or variable time step?

Source Link

check out this project https://github.com/rampantpixels/timer_lib

it has support for multiple platforms