dEngine
Simple 2D C++ game engine
Time.h
Go to the documentation of this file.
1 #ifndef DENGINE_TIME_H
2 #define DENGINE_TIME_H
3 
4 #include <SDL.h>
5 
6 namespace dengine {
10  class Time {
11  public:
12  Time();
13 
14  float deltaTicks;
18  float frameTicks;
19 
24  void StartTick();
25 
30  void EndTick();
31 
35  static Time &GetInstance();
36 
37  private:
38  Uint32 startTicks = 0;
39  Uint32 endTicks = 0;
40  static Time instance;
41  };
42 }
43 
44 #endif //DENGINE_TIME_H
Uint32 startTicks
Definition: Time.h:38
static Time instance
Definition: Time.h:40
float deltaTicks
Definition: Time.h:14
Time()
Definition: Time.cpp:7
Time is used to help manage gametime, refresh rates, ticks and more.
Definition: Time.h:10
void EndTick()
Perform a tick at the end of the frame.
Definition: Time.cpp:19
Uint32 endTicks
Definition: Time.h:39
static Time & GetInstance()
Returns an instance to Time.
Definition: Time.cpp:26
void StartTick()
Perform a tick at the beginning of the frame.
Definition: Time.cpp:15
The namespace containing the engine&#39;s code.
Definition: Collider.h:9
float frameTicks
The number of ticks per frame.
Definition: Time.h:18