summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'gfx')
-rw-r--r--gfx/models/texture.cpp3
-rw-r--r--gfx/models/texture.h4
2 files changed, 7 insertions, 0 deletions
diff --git a/gfx/models/texture.cpp b/gfx/models/texture.cpp
index a388b32..90ec016 100644
--- a/gfx/models/texture.cpp
+++ b/gfx/models/texture.cpp
@@ -1,7 +1,10 @@
#include "texture.h"
#include "stb_image.h"
+#include <cache.h>
#include <stdexcept>
+Cache<Texture> Texture::cachedTexture;
+
Texture::Texture(const std::string & fileName) : m_texture {}
{
int width, height, numComponents;
diff --git a/gfx/models/texture.h b/gfx/models/texture.h
index 6ebf88d..30ba953 100644
--- a/gfx/models/texture.h
+++ b/gfx/models/texture.h
@@ -5,6 +5,8 @@
#include <special_members.hpp>
#include <string>
+template<typename Obj> class Cache;
+
class Texture {
public:
explicit Texture(const std::string & fileName);
@@ -14,6 +16,8 @@ public:
NO_COPY(Texture);
NO_MOVE(Texture);
+ static Cache<Texture> cachedTexture;
+
void Bind() const;
private: