3 #include "SDL/SDL_opengl.h"
8 //Initialize the variables
23 //Get the current clock time
24 startTicks
= SDL_GetTicks();
38 //If the timer is running and isn't already paused
39 if( ( started
== true ) && ( paused
== false ) )
44 //Calculate the paused ticks
45 pausedTicks
= SDL_GetTicks() - startTicks
;
51 //If the timer is paused
57 //Reset the starting ticks
58 startTicks
= SDL_GetTicks() - pausedTicks
;
60 //Reset the paused ticks
65 int Timer::get_ticks()
67 //If the timer is running
70 //If the timer is paused
73 //Return the number of ticks when the timer was paused
78 //Return the current time minus the start time
79 return SDL_GetTicks() - startTicks
;
83 //If the timer isn't running
87 bool Timer::is_started()
92 bool Timer::is_paused()