diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2018-05-04 18:37:00 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2018-05-04 18:37:00 +0100 |
commit | 35937f1e76402d25fce180c0519bef6ce77769fe (patch) | |
tree | dfbae0532ec2ce4e706fb8ad8fbfe0b1a7ed862d /yage/entity/engine.cpp | |
parent | 09535633913069f4653c270501059c38c2d09a99 (diff) | |
download | YAGE-35937f1e76402d25fce180c0519bef6ce77769fe.tar.gz YAGE-35937f1e76402d25fce180c0519bef6ce77769fe.zip |
Improving ECS and adding documentation.
Diffstat (limited to 'yage/entity/engine.cpp')
-rw-r--r-- | yage/entity/engine.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/yage/entity/engine.cpp b/yage/entity/engine.cpp index 503dc919..f3a056db 100644 --- a/yage/entity/engine.cpp +++ b/yage/entity/engine.cpp @@ -8,20 +8,28 @@ #include "engine.h" +#include "../core/core.h" + #include "space.h" -#include "entity.h" namespace yage { +Engine::~Engine() +{ + quit(); +} + void Engine::init() { + yage::init(); window_.create("Game Engine", 800, 640); } void Engine::mainLoop() { while (!window_.shouldClose()) { + window_.pollEvents(); window_.clearBuffer(); update(); @@ -32,8 +40,8 @@ void Engine::mainLoop() void Engine::update() { - for(auto &space : spaces_) { - + for (auto &space : spaces_) { + space->update(); } } |