jubilant-funicular
ResourceManager.h
1 #ifndef NTA_RESOURCEMANAGER_H_INCLUDED
2 #define NTA_RESOURCEMANAGER_H_INCLUDED
3 
4 #include <SDL2/SDL_ttf.h>
5 
6 #include "nta/GLTexture.h"
7 #include "nta/SpriteFont.h"
8 #include "nta/Errors.h"
9 
10 namespace nta {
17  private:
19  static std::map<std::string, RawTexture> m_textureMap;
20  static std::map<std::pair<std::string, int>, TTF_Font*> m_fontMap;
21  public:
23  static Result<RawTexture> getTexture(crstring imagePath, crvec2 dimensions);
24  static Result<TTF_Font*> getFont(crstring fontPath, int fontSize);
25  static void destroy();
26  };
27 }
28 
29 #endif // NTA_RESOURCEMANAGER_H_INCLUDED
nta::ResourceManager::m_textureMap
static std::map< std::string, RawTexture > m_textureMap
a map for associating a texture with the name of its file
Definition: ResourceManager.h:19
nta::ResourceManager::getTexture
static Result< RawTexture > getTexture(crstring imagePath, crvec2 dimensions)
returns the resource with the given path, loading it if need be
Definition: ResourceManager.cpp:7
nta::Result
Definition: Errors.h:74
nta
Definition: Animation2D.h:6
nta::ResourceManager
Definition: ResourceManager.h:16