summaryrefslogtreecommitdiffstats
path: root/src/core/AssetManager.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/AssetManager.hpp')
-rw-r--r--src/core/AssetManager.hpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/core/AssetManager.hpp b/src/core/AssetManager.hpp
new file mode 100644
index 0000000..23b2ba6
--- /dev/null
+++ b/src/core/AssetManager.hpp
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <experimental/filesystem>
+#include <map>
+#include <GL/glew.h>
+#include <glm/vec4.hpp>
+#include <nlohmann/json.hpp>
+#include "../world/Block.hpp"
+#include "../graphics/Texture.hpp"
+
+struct TextureCoord{
+ unsigned int x,y,w,h;
+};
+
+class AssetManager {
+ Texture *textureAtlas;
+ std::map<std::string,Block> assetIds;
+ std::map<std::string,TextureCoord> assetTextures;
+public:
+ AssetManager();
+
+ ~AssetManager();
+
+ void LoadTextureResources();
+
+ TextureCoord GetTextureByAssetName(std::string AssetName);
+
+ std::string GetTextureAssetNameByBlockId(unsigned short BlockId, unsigned char BlockSide = 0);
+
+ const GLuint GetTextureAtlas();
+
+ void LoadIds();
+};