The resource manager handles loading of files off disk.
More...
#include <ResourceManager.h>
Inherits Fling::Singleton< ResourceManager >.
|
template<class T , class ... ARGS> |
std::shared_ptr< T > | LoadResourceImpl (Guid t_ID, ARGS &&... args) |
|
|
| Singleton ()=default |
| Every singleton must have a default constructor so that explicit creation and destruction of them is maintained. More...
|
|
The resource manager handles loading of files off disk.
Every Resource type has a Guid. This Guid functions as both the file path (relative to the ASSETS directory) as well as a hashed string for easy passing around of information. Each resource is only ever loaded into memory ONCE.
- See also
- Fling::Guid
-
Fling::Guid_Handle
-
Fling::Resource
◆ ResourceMapConstIt
◆ ResourceMapIt
◆ GetResource()
Get the already loaded resouce with this Guid.
Returns nullptr if not loaded yet.
- Parameters
-
t_ID | Guid of the resource (a hashed string handle) |
- Returns
- std::shared_ptr<Resource> Pointer to the resource
◆ GetResourceOfType()
template<class T >
std::shared_ptr< T > Fling::ResourceManager::GetResourceOfType |
( |
Guid_Handle |
t_ID | ) |
const |
|
inline |
◆ Init()
void Fling::ResourceManager::Init |
( |
| ) |
|
|
overridevirtual |
◆ IsLoaded()
bool Fling::ResourceManager::IsLoaded |
( |
Guid_Handle |
t_ID | ) |
const |
Check if there is a resource with this ID loaded or not.
- Returns
- If the resource ID is loaded or not
◆ LoadResource()
template<class T , class ... ARGS>
static std::shared_ptr<T> Fling::ResourceManager::LoadResource |
( |
Guid |
t_ID, |
|
|
ARGS &&... |
args |
|
) |
| |
|
inlinestatic |
◆ LoadResourceImpl()
template<class T , class ... ARGS>
std::shared_ptr< T > Fling::ResourceManager::LoadResourceImpl |
( |
Guid |
t_ID, |
|
|
ARGS &&... |
args |
|
) |
| |
|
inlineprivate |
◆ Shutdown()
void Fling::ResourceManager::Shutdown |
( |
| ) |
|
|
overridevirtual |
◆ m_ResourceMap
Map of currently loaded resources.
The documentation for this class was generated from the following files: