blob: 147769e58805970bec9cc4a7965ab25d5a0bd8df (
plain)
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
|
/** ---------------------------------------------------------------------------
* @file: engine.h
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
* ----------------------------------------------------------------------------
*/
#ifndef YAGE_CORE_ENGINE_H
#define YAGE_CORE_ENGINE_H
#include "../core/window.h"
#include "system.h"
#include <vector>
namespace yage
{
/// Main engine class that contains a systems, the main loop and the update
/// function that updates all the systems.
class Engine
{
public:
/// Initialize window and other aspects of the engine.
void init();
/// Main game loop of the engine.
void mainLoop();
/// Updates the systems.
void update();
/// Adds a system to the engine.
void addSystem(System *system);
/// Returns the instance of the engine, as there is only one instance of the
/// engine.
static Engine &instance();
private:
/// Vector of all the systems in the engine.
std::vector<System *> systems_;
/// Window
Window window_;
};
} // namespace yage
#endif
|