summaryrefslogtreecommitdiff
path: root/game/physical.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/physical.cpp')
-rw-r--r--game/physical.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/game/physical.cpp b/game/physical.cpp
index f4c17d4..5263268 100644
--- a/game/physical.cpp
+++ b/game/physical.cpp
@@ -1,8 +1,14 @@
#include "physical.h"
+#include "gfx/models/mesh.h"
+#include "gfx/models/texture.h"
+#include <cache.h>
#include <gfx/gl/shader.h>
+Cache<Mesh> Physical::cachedMesh;
+Cache<Texture> Physical::cachedTexture;
+
Physical::Physical(glm::vec3 where, const std::string & m, const std::string & t) :
- location {where}, mesh {m}, texture {t}
+ location {where}, mesh {cachedMesh.get(m)}, texture {cachedTexture.get(t)}
{
}
@@ -10,6 +16,6 @@ void
Physical::render(const Shader & shader, const Camera & camera) const
{
shader.Update(location, camera);
- texture.Bind();
- mesh.Draw();
+ texture->Bind();
+ mesh->Draw();
}