diff options
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index aa3ccc5..2916a6e 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -30,6 +30,10 @@ #include "components/Position.hpp" #include "components/Velocity.hpp" +using namespace std::chrono_literals; +namespace cr = std::chrono; +typedef std::chrono::high_resolution_clock mc; + int Engine::init(void) { systems.add<GameRunSystem>(); @@ -46,10 +50,6 @@ int Engine::init(void) void Engine::logicLoop(void) { - using namespace std::chrono_literals; - namespace cr = std::chrono; - typedef std::chrono::high_resolution_clock mc; - entityx::TimeDelta dt = 0; /**< Elapsed milliseconds since each loop */ double elapsed = 0; @@ -98,9 +98,9 @@ void Engine::logicLoop(void) void Engine::renderLoop(void) { + entityx::TimeDelta dt = 0; /**< Elapsed milliseconds since each loop */ while (shouldRun()) { - systems.update<RenderSystem>(0); - std::this_thread::yield(); + systems.update<RenderSystem>(dt); } } |