aboutsummaryrefslogtreecommitdiffstats
path: root/yage/entity/engine.h
blob: 6e1bf49a177969125453d66d09bb2e48e59db012 (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
/** ---------------------------------------------------------------------------
 * @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();

    /// Returns the instance of the engine, as there is only one instance of the
    /// engine.
    static Engine &instance();

private:
    /// Window
    Window window_;
};

} // namespace yage

#endif