1 #ifndef ResourceManager_h
2 #define ResourceManager_h
4 #include <unordered_map>
6 #include <SDL2_ttf/SDL_ttf.h>
7 #include <SDL2/SDL_mixer.h>
17 std::map<const char*, SDL_Surface*> map;
22 std::map<const char*, TTF_Font*> fontMap;
27 std::map<const char*, Mix_Music*> soundMap;
32 std::map<const char*, Mix_Chunk*> soundEffectMap;
37 std::map<std::string, std::string> languageMap;
66 TTF_Font*
loadFont(
const char* filePath);
73 Mix_Music*
loadMusic(
const char* filePath);
79 Mix_Chunk*
loadWAV(
const char* filePath);
93 const char*
getWords(
const char* phrase);
The resource manager is responsible for handling and managing resources regarding the game.
Definition: ResourceManager.h:12
Mix_Music * loadMusic(const char *filePath)
Method used to load Mix_Music object of respective music from its path.
Definition: ResourceManager.cpp:52
static ResourceManager & getInstance()
Method used to get instance of ResourceManager class.
Definition: ResourceManager.cpp:10
void loadWords()
Method to load the words from multiple scripts in the script folder.
Definition: ResourceManager.cpp:101
void setWords(std::string english, std::string french)
Metohd used to set translation words in LanguageMap.
Definition: ResourceManager.cpp:78
TTF_Font * loadFont(const char *filePath)
Method used to load TTF_Font object of respective font from its path.
Definition: ResourceManager.cpp:31
const char * getWords(const char *phrase)
Method used to get words based on the language, i.e English or French.
Definition: ResourceManager.cpp:84
Mix_Chunk * loadWAV(const char *filePath)
Method used to load Mix_Chunk object of respective music from its path.
Definition: ResourceManager.cpp:65
SDL_Surface * loadTexture(const char *filePath)
Method used to load Spritesheet of Images from their path.
Definition: ResourceManager.cpp:15
void setLanguage(int languageCode)
Method to set language so other methods can know which language phrase to return.
Definition: ResourceManager.cpp:97
GLsizei const GLchar *const * string
Definition: glad.h:2926