EngineLib
 All Classes Functions
Timer.h
1 /*
2  * Timer.h
3  *
4  * Created on: 09.10.2017
5  * Author: robert
6  */
7 
8 #ifndef TIMER_H_
9 #define TIMER_H_
10 
11 #define FRAME_VALUES 10
12 
19 class Timer {
20 public:
21  Timer();
22  virtual ~Timer();
26  void update();
31  float getFrameRate();
36  unsigned int getTicks();
37 private:
38 
39 // An array to store frame times:
40 unsigned int frametimes[FRAME_VALUES];
41 
42 // Last calculated SDL_GetTicks
43 unsigned int frametimelast;
44 
45 // total frames rendered
46 unsigned int framecount;
47 
48 // the value you want
49 float framespersecond;
50 };
51 
52 #endif /* TIMER_H_ */
float getFrameRate()
Definition: Timer.cpp:79
void update()
Definition: Timer.cpp:24
unsigned int getTicks()
Definition: Timer.cpp:75
Definition: Timer.h:19