Berserk
Public Member Functions | List of all members
ResourceManager Class Reference

Main engine resource management class. More...

#include <ResourceManager.hpp>

Public Member Functions

BRK_API ResourceManager ()
 
BRK_API ~ResourceManager ()=default
 
BRK_API Ref< ResourceImport (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...
 

Detailed Description

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:

Constructor & Destructor Documentation

◆ ResourceManager()

BRK_NS_BEGIN ResourceManager::ResourceManager ( )

◆ ~ResourceManager()

BRK_API ResourceManager::~ResourceManager ( )
default

Member Function Documentation

◆ CanImport()

bool ResourceManager::CanImport ( const String filepath) const

Check if can import resource.

Parameters
filepathRelative or absolute path to the resource
Returns
True if can import file with specified path

◆ Import()

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.

Parameters
filepathRelative or absolute path to the resource
optionsOptions to import this specific resource
uuidOptional id to assign to imported resource
Returns
Imported resource; may be null

◆ RegisterImporter()

void ResourceManager::RegisterImporter ( std::shared_ptr< ResourceImporter importer)

Register new resource importer.

Parameters
importerImporter to register

The documentation for this class was generated from the following files: