|
Jagguar Game Engine
|
#include <ResourceManager.hpp>
Public Member Functions | |
| SDL_Surface * | LoadResource (std::string image_filename) |
| SDL_Surface * | GetResource (std::string key) |
| int | StartUp () |
| int | ShutDown () |
Static Public Member Functions | |
| static ResourceManager & | GetInstance () |
Private Member Functions | |
| ResourceManager () | |
| ResourceManager (ResourceManager const &) | |
| void | operator= (ResourceManager const &) |
Private Attributes | |
| std::unordered_map< std::string, SDL_Surface * > | surfaces |
A Singleton class to hold all loaded files in the game. The purpose of the ResourceManager is to avoid wasting memory on duplicate textures, audio files, and any other things that need to be loaded.
|
private |
Construct a new Resource Manager object. Not used, according to the Singleton Pattern.

|
static |
Get the Singleton instance of the ResourceManager.


| SDL_Surface * ResourceManager::GetResource | ( | std::string | key | ) |
Get a resource from the ResourceManager. If the resource is not already loaded, calls LoadResource()
| key | the filename to be loaded |

| SDL_Surface * ResourceManager::LoadResource | ( | std::string | image_filename | ) |
Load a file into memory.
| image_filename | the name of the file to be loaded |


| int ResourceManager::ShutDown | ( | ) |
Destroy the Singleton
| int ResourceManager::StartUp | ( | ) |
Initialize the Singleton.