Yet Another Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
engine.h
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include "system.h"
12 
13 #include "../core/window.h"
14 #include "../util/noncopyable.h"
15 
16 #include <memory>
17 #include <vector>
18 
19 namespace yage
20 {
21 
22 class Space;
23 
28 class Engine : public NonCopyable
29 {
30 public:
31 
32  ~Engine();
33 
35  void init();
36 
38  void mainLoop();
39 
41  void update();
42 
44  void addSpace(std::unique_ptr<Space> space);
45 
48  static Engine& instance();
49 
50 private:
52  Window window_;
53 
55  std::vector<std::unique_ptr<Space>> spaces_;
56 };
57 
58 } // namespace yage
void addSpace(std::unique_ptr< Space > space)
Add spaces to the engine.
Definition: engine.cpp:48
static Engine & instance()
Returns the instance of the engine, as there is only one instance of the engine.
Definition: engine.cpp:53
Definition: window.h:29
Main engine class that contains a systems, the main loop and the update function that updates all the...
Definition: engine.h:28
Definition: noncopyable.h:6
void update()
Updates the systems.
Definition: engine.cpp:41
void init()
Initialize window and other aspects of the engine.
Definition: engine.cpp:23
void mainLoop()
Main game loop of the engine.
Definition: engine.cpp:29
~Engine()
Definition: engine.cpp:18