-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApplication.h
85 lines (65 loc) · 1.95 KB
/
Application.h
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#pragma once
#include "p2List.h"
#include "Globals.h"
#include "Timer.h"
#include "Module.h"
#include "ModuleWindow.h"
#include "ModuleInput.h"
#include "ModuleAudio.h"
#include "ModuleSceneIntro.h"
#include "ModuleRenderer3D.h"
#include "ModuleCamera3D.h"
#include "ModuleGUI.h"
#include "ModuleImporter.h"
#include "ModuleFileSystem.h"
#include "RNGenerator.h"
#include "MeshImporter.h"
#include "MaterialImporter.h"
#include "ModuleResources.h"
class Application
{
public:
ModuleWindow* window;
ModuleInput* input;
ModuleAudio* audio;
ModuleSceneIntro* scene_intro;
ModuleRenderer3D* renderer3D;
ModuleCamera3D* camera;
ModuleGUI* gui;
ModuleImporter* importer;
ModuleResources* resources;
ModuleFileSystem* filesystem;
MeshImporter* mesh_importer;
MaterialImporter* material_importer;
RNGenerator RandomNumberGenerator;
private:
Timer dt_timer; //timer to calculate things related to delta time
float dt; //delta time
Timer frame_time; //timer to calculate how match time does a frame take in miliseconds
Timer last_sec_frame_time; //How much time did last frame cost
Timer ms_timer; //timer to count miliseconds since App::Start()
double frame_count = 0; //number of frames since App::Init();
float last_frame_ms;//last frame milisseconds
float last_sec_frame_count = 0;//frames in last sec
p2List<Module*> list_modules; //All Application modules inside
public:
Application();
~Application();
bool Init();
update_status Update();
const char * GetAppName() const;
void SetAppName(const char * name);
const char * GetOrganizationName() const;
void SetOrganizationName(const char * name);
bool CleanUp();
int framerate_cap = 30;
bool framerate_cap_activated = false;
float prev_last_sec_frame_count = 0; //frames the sec before last sec.
private:
void AddModule(Module* mod);
void PrepareUpdate();
void FinishUpdate();
std::string app_name;
std::string organization_name;
};
extern Application* App;