summaryrefslogtreecommitdiffstats
path: root/src/core/AssetManager.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-05-26 16:11:17 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-05-26 16:11:17 +0200
commit8ac4fe6d5ba5091923c7fdf1fa88724d827706fa (patch)
treea4ce203f671f9b8311d09dd36f1f80ae65799a56 /src/core/AssetManager.hpp
parent2017-05-21 (diff)
downloadAltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.tar
AltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.tar.gz
AltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.tar.bz2
AltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.tar.lz
AltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.tar.xz
AltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.tar.zst
AltCraft-8ac4fe6d5ba5091923c7fdf1fa88724d827706fa.zip
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();
+};