General resource management class.
More...
#include <ResourceManager.h>
General resource management class.
- Todo:
- Generalize the resource manager for audio, not just sprites.
| ResourceManager::ResourceManager |
( |
) | |
|
The constructor.
Initializes attributes.
| ResourceManager::~ResourceManager |
( |
) | |
|
The destructor.
- Note
- Warns about resources being deleted with references still pointing to them.
| Sprite * ResourceManager::get |
( |
const std::string & |
path_) | |
|
Retrieves the sprite from the resources.
- Returns
- The pointer to the wanted sprite. Creates it, if not already in resources.
- Parameters
-
| path_ | : Path to the desired sprite. |
Constructs the desired sprite.
- Parameters
-
| path_ | : Path to the desired sprite. |
| void ResourceManager::registerResource |
( |
const std::string & |
path_, |
|
|
Sprite::SpritePtr |
resource_ |
|
) |
| |
|
private |
Registers the resource on the resources map.
- Parameters
-
| path_ | : Path to the sprite. Will be the key value. |
| resource_ | : The shared pointer for the resource. |
| void ResourceManager::unregisterResource |
( |
const std::string & |
path_) | |
|
|
private |
Unregisters the resource on the resources map.
- Parameters
-
| path_ | : The key (path to sprite) on the map. |
The map that contains all the
Sprite resources.
The documentation for this class was generated from the following files:
- /home/caio/Git/Dauphine/include/ResourceManager.h
- /home/caio/Git/Dauphine/src/ResourceManager.cpp