Berserk
|
Main engine resource management class. More...
#include <ResourceManager.hpp>
Public Member Functions | |
BRK_API | ResourceManager () |
BRK_API | ~ResourceManager ()=default |
BRK_API Ref< Resource > | Import (const String &filepath, const Ref< ResourceImportOptions > &options, const UUID &uuid=UUID::Empty()) |
Import resource at specified file location. More... | |
BRK_API void | RegisterImporter (std::shared_ptr< ResourceImporter > importer) |
Register new resource importer. More... | |
BRK_API bool | CanImport (const String &filepath) const |
Check if can import resource. More... | |
Main engine resource management class.
Resource manager is responsible for loading, importing and saving resources on the disc. Provides mechanism for async resources loading. Caches loaded resource for fast access.
Common use cases:
BRK_NS_BEGIN ResourceManager::ResourceManager | ( | ) |
|
default |
bool ResourceManager::CanImport | ( | const String & | filepath | ) | const |
Check if can import resource.
filepath | Relative or absolute path to the resource |
Ref< Resource > ResourceManager::Import | ( | const String & | filepath, |
const Ref< ResourceImportOptions > & | options, | ||
const UUID & | uuid = UUID::Empty() |
||
) |
Import resource at specified file location.
Import resource using provided path to the file. Will use engine file system and search paths setup to find real path of the file.
filepath | Relative or absolute path to the resource |
options | Options to import this specific resource |
uuid | Optional id to assign to imported resource |
void ResourceManager::RegisterImporter | ( | std::shared_ptr< ResourceImporter > | importer | ) |
Register new resource importer.
importer | Importer to register |