gl-adventure
Functions | Variables
time_utils.h File Reference

Declares function to deal with system time. More...

Go to the source code of this file.

Functions

void init_game_time ()
 Init the game time. More...
 
float get_game_time ()
 Get the processed time since the game start. More...
 
void update_fps ()
 Update the fps value. More...
 

Variables

float timeAtGameStart
 Time when the game start.
 
long ticksPerSecond
 The system ticks per second.
 
float lastUpdate
 The time when the last update occur.
 
float fpsUpdateInterval
 Updates every (?? seconds)
 
unsigned int numFrames
 Frames drawn since last FPS update.
 
long fps
 The frame per second number.
 
float lastInGameTimeUpdate
 Ellapsed time since last in-game update.
 
float lastFoodDownTime
 Ellapsed time since last food down.
 
float lastWaterDownTime
 Ellapsed time since last water down.
 

Detailed Description

Declares function to deal with system time.

The following page http://www.programmersheaven.com/2/time-fps was really usefull.

Modifications :

Function Documentation

§ get_game_time()

float get_game_time ( )

Get the processed time since the game start.

Returns
The elapsed time in seconds

§ init_game_time()

void init_game_time ( )

Init the game time.

This must be called only one tile when the game is started.

§ update_fps()

void update_fps ( )

Update the fps value.

This must be called when a frame is drawn.