Registered by Kazade

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(timer); //Bind it for use
ktiStartGameTimer(); //Start a game timer

/* Each frame */
ktiUpdateFrameTime();
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(timer);
ktiStartFixedStepTimer(30); //Update 30 times per second

/* Each frame */
ktiUpdateFrameTime();

while(ktiTimerCanUpdate()) {
    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

Project information

Maintainer:
Kazade
Driver:
Not yet selected
Licence:
Simplified BSD Licence

RDF metadata

View full history Series and milestones

trunk series is the current focus of development.

All code Code

Version control system:
Bazaar

All bugs Latest bugs reported

Get Involved

Downloads

Kaztimer does not have any download files registered with Launchpad.