Part of Kazade's Game Developer Kit, Kaztimer provides a simple interface for generating game timers so you can update your game based on the frame time, or decouple your game updates from the framerate completely.
-------
USAGE (frame-time based):
/* On initialization */
KTIuint timer;
ktiGenTimers(1, &timer); //Create a timer
ktiBindTimer(
ktiStartGameTim
/* Each frame */
ktiUpdateFrameT
double dt = ktiGetDeltaTime(); //Now updates can be multiplied by dt
ktiDeleteTimers(1, &timer); //Destroy the timer
-------
USAGE (fixed-step):
/* On initialization */
KTIuint timer;
ktiGenTimers(1, &timer); //Create a timer
ktiBindTimer(
ktiStartFixedSt
/* Each frame */
ktiUpdateFrameT
while(ktiTimerC
double dt = ktiGetDeltaTime();
//Now update based on dt
}
//Render game (now updates are decoupled from the frame rate)
/* On quit */
ktiDeleteTimers(1, &timer); //Destroy the timer
View full history Series and milestones
trunk series is the current focus of development.