-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEngine.h
More file actions
63 lines (47 loc) · 1.53 KB
/
Engine.h
File metadata and controls
63 lines (47 loc) · 1.53 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
//
// Created by Paul on 14.04.2017.
//
#ifndef PAXENGINE3_MAIN_H
#define PAXENGINE3_MAIN_H
#include <paxutil/lib/LibIncludes.h>
#include <paxcore/function/Updateable.h>
#include <paxcore/service/Services.h>
#include <paxcore/io/Window.h>
#include <paxcore/rendering/Renderer.h>
namespace PAX {
class Game;
class EnginePlugin;
class Engine : private Updateable {
private:
static Engine *instance;
// GAME LOOP VARS ////////////////////////////////////////////////////////////
bool _running {false};
//constraint: core_targetFPS <= core_targetUPS
double _targetFPS = 60;
double _targetUPS = 100;
double _actualFPS = 0;
double _actualUPS = 0;
// ARCHITECTURAL VARS ////////////////////////////////////////////////////////
Services _services;
Renderer _renderer;
Game *_game = nullptr;
std::vector<EnginePlugin*> _plugins;
// FUNCTIONS /////////////////////////////////////////////////////////////////
Engine();
~Engine() override;
void update(UpdateOptions & options) override;
void render(RenderOptions & options);
bool terminate();
public:
/// Takes ownership of game
bool initialize(Game* game, const std::vector<EnginePlugin*> &plugins);
int run();
void stop();
Game* getGame();
Renderer& getRenderer();
double getFPS();
double getUPS();
static Engine& Instance();
};
}
#endif //PAXENGINE3_MAIN_H