Manages loading and access to game resources.
More...
#include <main/ResourceManager.hpp>
|
| const Resource & | GetFile (unsigned short id) const |
| | Get resource by ID.
|
| |
| const Resource & | GetFile (std::string path) const |
| | Get resource by path.
|
| |
| void | AddFile (std::string path, const char *data, const int size) |
| | Add resource from raw data.
|
| |
| template<int hexSize = 2> |
| void | AddFileFromHex (std::string path, const char *hex, const int size) |
| | Add resource from hex string data.
|
| |
Manages loading and access to game resources.
Handles loading and caching of resource files like textures, models, audio etc. Resources can be accessed by ID or path.
◆ AddFile()
| void StevEngine::Resources::ResourceManager::AddFile |
( |
std::string | path, |
|
|
const char * | data, |
|
|
const int | size ) |
Add resource from raw data.
- Parameters
-
| path | Virtual path for resource |
| data | Raw data bytes |
| size | Size of data in bytes |
◆ AddFileFromHex()
template<int hexSize>
| void StevEngine::Resources::ResourceManager::AddFileFromHex |
( |
std::string | path, |
|
|
const char * | hex, |
|
|
const int | size ) |
Add resource from hex string data.
- Template Parameters
-
| hexSize | Size of hex values (usually 2) |
- Parameters
-
| path | Virtual path for resource |
| hex | Hex string data |
| size | Size of final data in bytes |
◆ GetFile() [1/2]
| const Resource & StevEngine::Resources::ResourceManager::GetFile |
( |
std::string | path | ) |
const |
Get resource by path.
- Parameters
-
- Returns
- Reference to resource
- Exceptions
-
| Error | if resource not found |
◆ GetFile() [2/2]
| const Resource & StevEngine::Resources::ResourceManager::GetFile |
( |
unsigned short | id | ) |
const |
Get resource by ID.
- Parameters
-
- Returns
- Reference to resource
- Exceptions
-
| Error | if resource not found |
The documentation for this class was generated from the following files: