00001 /* Crown and Cutlass 00002 * Timer Header 00003 */ 00004 00005 #if !defined ( _TIMER_H_ ) 00006 #define _TIMER_H_ 00007 00008 class Timer { 00009 public: 00010 Timer(); 00011 00012 ~Timer(); 00013 00014 // Returns the ticks since the last call to ResetTimer 00015 // Note: This would be useful if you want to time something 00016 unsigned int GetTicks(); 00017 00018 // Resets the timer and returns ticks since last reset 00019 // Note: This should be called before every frame 00020 unsigned int ResetTimer(); 00021 00022 // Initializes and shutsdown the static timer object 00023 static void Initialize(); 00024 static void Shutdown(); 00025 00026 static Timer *timer; 00027 00028 private: 00029 unsigned int lastTicks; 00030 }; 00031 00032 #endif
1.4.7