-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleTimeManager.h
More file actions
68 lines (54 loc) · 1.29 KB
/
Copy pathModuleTimeManager.h
File metadata and controls
68 lines (54 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef __ModuleTimeManager_H__
#define __ModuleTimeManager_H__
#include "Globals.h"
#include "Module.h"
#include "Timer.h"
class Application;
class ModuleTimeManager : public Module
{
public:
ModuleTimeManager();
~ModuleTimeManager();
//Core
bool Init();
update_status PreUpdate();
update_status Update();
update_status PostUpdate();
bool CleanUp();
//Methods
void InitDeltaTimes();
void FinalDeltaTimes();
float GetGameTime() const;
float GetRealGameTime() const;
float GetDeltaTime() const;
float GetRealDeltaTime() const;
float GetTimeBeforeVsync() const;
void ComputeTimeBeforeVsync();
void PauseGame();
void ExecuteNextFrames(int numberFrames);
void Wait(float timeToWait);
void PlayGame();
//Variables
long long frameCount = 0;
float timeBeforeVsync = 0.0f;
int FPS = 60;
int fixedFPS = 60;
float timeScale = 1.0f;
bool isPaused = false;
bool waitingToPause = false;
bool fixFPS = false;
bool isPlaying = false;
private:
Timer* realTimer;
float gameTime = 0.0f;
float deltaTime = 0.0f;
float realGameTime = 0.0f;
float realDeltaTime = 0.0f;
float initialGameFrameTime = 0.0f;
float initialRealFrameTime = 0.0f;
float timePaused = 0.0f;
long long framesToPause = 0;
unsigned int counterFPS = 0;
float counterTimeFPS = 0.0f;
};
#endif __ModuleTimeManager_H__