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 
10 #pragma once
11 
12 #include "system.h"
13 
14 #include "../core/window.h"
15 #include "../util/noncopyable.h"
16 
17 #include <memory>
18 #include <vector>
19 
20 namespace yage
21 {
22 
23 class Space;
24 
29 class Engine : public NonCopyable
30 {
31 public:
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:49
static Engine & instance()
Returns the instance of the engine, as there is only one instance of the engine.
Definition: engine.cpp:54
Definition: window.h:30
Main engine class that contains a systems, the main loop and the update function that updates all the...
Definition: engine.h:29
Definition: noncopyable.h:15
void update()
Updates the systems.
Definition: engine.cpp:42
void init()
Initialize window and other aspects of the engine.
Definition: engine.cpp:24
void mainLoop()
Main game loop of the engine.
Definition: engine.cpp:30
-*- c++ -*-
~Engine()
Definition: engine.cpp:19