00001 #ifndef TIME_H
00002 #define TIMER_H
00003
00004 #include <SDL.h>
00005
00006 class Timer
00007 {
00008 public:
00009 Timer();
00010 ~Timer();
00011
00012 static inline float deltaTime();
00013 static inline float time();
00014
00015 void begginFrame();
00016 void endFrame();
00017 void delay();
00018
00019 private:
00020
00021 static float timeSinceStartup;
00022 static float deltatime;
00023 Uint32 last_time;
00024 Uint32 current_time;
00025 Uint32 elapsed_time;
00026 Uint32 start_time;
00027 Uint32 stop_time;
00028
00029 };
00030
00031 inline float Timer::deltaTime(){
00032 return deltatime;
00033 }
00034
00035 inline float Timer::time(){
00036 return timeSinceStartup;
00037 }
00038
00039 #endif