• Create Account

### #Actualkd7tck

Posted 29 December 2012 - 01:28 PM

Abstract away.  Personaly now that I think about it, as long as you don't blit more than the monitor refresh rate you don't need to worry about this. This should only be implimented to slow down a fast program, v-sync can be used in place of it if you want. In the cases of slow programs just let er rip and use delta time to calculate movements based on time, rather than frame number.

class TimeDif(){
long range = 16;
long lastTime = GetTime();

bool getDif(){
long dif = GetTime() - lastTime;

if(dif >= range){
lastTime = GetTime();
return true;
}

return false;
}

}

### #1kd7tck

Posted 29 December 2012 - 01:26 PM

Abstract away.  Personaly now that I think about it, as long as you don't blit more than the monitor refresh rate you don't need to worry about this. This should only be implimented to slow down a fast program, v-sync can be used in place of it if you want. In the cases of slow programs just let er rip and use delta time to calculate movements based on time, rather than frame number.

class TimeDif(){
long range = 16;
long lastTime = GetTime();

long getDif(){
long dif = GetTime() - lastTime;

if(dif >= range)
lastTime = GetTime();

return dif;
}

}

PARTNERS