aboutsummaryrefslogtreecommitdiffstats
path: root/src/components.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-11-27 18:49:32 -0500
committerClyne Sullivan <tullivan99@gmail.com>2016-11-27 18:49:32 -0500
commitb1d3354d93187a6bededc280ddb6dee5b159bbe7 (patch)
tree64fb7e7ecdb77e0bc8579720444f23485d439168 /src/components.cpp
parent95f6378e62cc6a7f25305d6f2317ad25d459f9c0 (diff)
menu, indoor fixes
Diffstat (limited to 'src/components.cpp')
-rw-r--r--src/components.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/components.cpp b/src/components.cpp
index 5b85f51..d9b9b60 100644
--- a/src/components.cpp
+++ b/src/components.cpp
@@ -47,9 +47,24 @@ void PhysicsSystem::update(entityx::EntityManager &en, entityx::EventManager &ev
});
}
+GLuint RenderSystem::loadTexture(const std::string& file)
+{
+ loadTexString = file;
+ loadTexResult = 0xFFFF;
+ while (loadTexResult == 0xFFFF)
+ std::this_thread::sleep_for(std::chrono::milliseconds(1));
+ return loadTexResult;
+}
+
void RenderSystem::update(entityx::EntityManager &en, entityx::EventManager &ev, entityx::TimeDelta dt)
{
(void)ev;
+
+ if (!loadTexString.empty()) {
+ loadTexResult = Texture::loadTexture(loadTexString);
+ loadTexString.clear();
+ }
+
Render::worldShader.use();
en.each<Visible, Sprite, Position>([dt](entityx::Entity entity, Visible &visible, Sprite &sprite, Position &pos) {