aboutsummaryrefslogtreecommitdiff
path: root/source/Texture.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-04-15 20:30:39 -0700
committerrtk0c <[email protected]>2022-04-15 20:30:39 -0700
commitafcac59c7d04f4337d6b04ebed8cac7e871ccc50 (patch)
tree8c32b90b4a0ab762a68f228dc8cc4e7f52fc5bd7 /source/Texture.hpp
parentf2a1481123ac23aeb4937df5f61c57e0e4f1ff52 (diff)
Changeset: 7 Work on Material system
Diffstat (limited to 'source/Texture.hpp')
-rw-r--r--source/Texture.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/Texture.hpp b/source/Texture.hpp
index c372998..c330bb3 100644
--- a/source/Texture.hpp
+++ b/source/Texture.hpp
@@ -2,6 +2,7 @@
#include "RcPtr.hpp"
+#include <absl/container/flat_hash_map.h>
#include <glad/glad.h>
#include <glm/glm.hpp>
#include <memory>
@@ -64,3 +65,17 @@ struct Subregion {
struct TextureSubregion : public Subregion {
RcPtr<Texture> atlasTexture;
};
+
+class TextureManager {
+public:
+ static inline TextureManager* instance = nullptr;
+
+private:
+ absl::flat_hash_map<std::string_view, RcPtr<Texture>> mTextures;
+
+public:
+ void DiscoverTextures();
+
+ const auto& GetTextures() const { return mTextures; }
+ Texture* FindTexture(std::string_view name);
+};