]> git.localhorst.tv Git - sdl-test8.git/blob - src/app/Timer.h
997d92c0ba510bf5d5a22dfbd983b262961da8d8
[sdl-test8.git] / src / app / Timer.h
1 /*
2  * Timer.h
3  *
4  *  Created on: Apr 25, 2012
5  *      Author: holy
6  */
7
8 #ifndef APP_TIMER_H_
9 #define APP_TIMER_H_
10
11 namespace app {
12
13 class Timer {
14
15         public:
16                 explicit Timer(double scale = 1.0, double initialTime = 0.0)
17                                 : scale(scale), elapsed(initialTime), delta(0.0) { };
18
19         public:
20                 void Update(double dt);
21
22         public:
23                 double DeltaT(void) const { return delta; };
24                 double Elapsed(void) const;
25
26         private:
27                 double scale, elapsed, delta;
28
29 };
30
31 }
32
33 #endif /* APP_TIMER_H_ */