1. // This is a Cross Platform generic Timer for simple timing functions, like screen refresh rate
  2.  
  3. //The headers
  4. #ifndef CPTIMER_H
  5. #define CPTIMER_H
  6.  
  7. #include "SDL/SDL.h"
  8.  
  9. typedef unsigned long DWORD; // 4 bytes
  10.  
  11. //The timer
  12. class CPTimer
  13. {
  14.     private:
  15.     //The clock time when the timer started
  16.     int startTicks;
  17.  
  18.     //The ticks stored when the timer was paused
  19.     int pausedTicks;
  20.  
  21.     //The timer status
  22.     bool paused;
  23.     bool started;
  24.  
  25.     public:
  26.     //Initializes variables
  27.     CPTimer();
  28.  
  29.     //The various clock actions
  30.     void start();
  31.     void stop();
  32.     void pause();
  33.     void unpause();
  34.  
  35.     //Gets the timer's time
  36.     int get_ticks();
  37.  
  38.     //Checks the status of the timer
  39.     bool is_started();
  40.     bool is_paused();
  41. };
  42.  
  43. #endif