Simple SFML resource manager.
More...
#include <ResourceManager.hpp>
|
| T & | get (std::string const &path) |
| | Gets a resource by its path in the file system. If the resource specified by path has not already been loaded: Loads the resource, puts the resource into the map (with path as the key), returns the loaded resource. If the key "path" exists in the map it means the resource has already been loaded, so just return the resource. More...
|
| |
|
template<> |
| thor::FrameAnimation & | get (std::string const &path) |
| |
|
|
static std::unique_ptr< ResourceManager< T > > const & | instance () |
| | Instanciates (or returns the instance of) the ResourceManager. Instanciates (or gets the existing instance of) the ResourceManager<T> where T = an SFML resource type. Each instance of ResourceManager manages a different type of resource (e.g. ResourceManager<Texture>, ResourceManager<Font>).
|
| |
|
| std::map< std::string, std::unique_ptr< T > > | mResources |
| |
|
std::mutex | mResourceMutex |
| |
template<typename T>
class ResourceManager< T >
Simple SFML resource manager.
Gets a resource by its path in the file system. If the resource specified by path has not already been loaded: Loads the resource, puts the resource into the map (with path as the key), returns the loaded resource. If the key "path" exists in the map it means the resource has already been loaded, so just return the resource.
- Parameters
-
| path | The location of the resource in the file system. |
- Returns
- A reference to the requested resource.
template<typename T >
| std::map< std::string, std::unique_ptr<T> > ResourceManager< T >::mResources |
|
private |
Map of strings to unique resource pointers.
The documentation for this class was generated from the following file: