diff options
Diffstat (limited to 'graphics/AssetManager.hpp')
-rw-r--r-- | graphics/AssetManager.hpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/graphics/AssetManager.hpp b/graphics/AssetManager.hpp index 81be7c4..b2ff570 100644 --- a/graphics/AssetManager.hpp +++ b/graphics/AssetManager.hpp @@ -2,19 +2,15 @@ #include <fstream> #include <string> -#include <SOIL.h> #include <map> #include "../json.hpp" +#include "Texture.hpp" struct Asset { std::string name = ""; std::string hash = ""; union AssetData{ - struct TextureData{ - int width; - int height; - unsigned char *imageData; - } texture; + Texture *texture; } data; size_t size = 0; enum AssetType { @@ -38,12 +34,15 @@ class AssetManager { AssetManager &operator=(const AssetManager &); std::map<std::string, Asset> assets; -public: + static AssetManager &instance() { static AssetManager assetManager; return assetManager; } + static std::string GetPathToAsset(std::string AssetName); +public: + static Asset &GetAsset(std::string AssetName); static void LoadAsset(std::string AssetName); |