From fe0e56fb268996f59d96bd9862170c9cf5779031 Mon Sep 17 00:00:00 2001 From: Andy Belle-Isle Date: Sun, 1 Sep 2019 02:24:21 -0400 Subject: All 3 entities now play with idle functions and rendering a bit SUPER BETA --- src/engine.cpp | 1 + src/render.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/engine.cpp b/src/engine.cpp index 4579eb7..99c457b 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -43,6 +43,7 @@ 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 */ diff --git a/src/render.cpp b/src/render.cpp index 5b3a1f1..7c047f6 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -79,9 +79,11 @@ void RenderSystem::update([[maybe_unused]] entityx::EntityManager& entities, * DRAWING * *************/ - entities.each( - [this, a](entityx::Entity, Render, Position &p){ + [this, a](entityx::Entity, Render &r, Position &p){ + + if (!r.visible) + return; GLuint tri_vbo; GLfloat tri_data[] = { -- cgit v1.2.3