aboutsummaryrefslogtreecommitdiffstats
path: root/yage/entity/engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'yage/entity/engine.cpp')
-rw-r--r--yage/entity/engine.cpp14
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();
}
}