Functions for managing resource types.
| Namespace: | dmResource | 
| Include: | #include <dmsdk/resource/resource.hpp> | 
| TYPES | |
|---|---|
| FDecryptResource | Decrypts a file | 
dmResource::Result AddFile(dmResource::HFactory factory, const char* path, uint32_t size, const void* resource)
Adds a file to the resource system Any request for this path will go through any existing mounts first. If you wish to provide file overrides, please use the LiveUpdate feature for that. The file isn't persisted between sessions.
PARAMETERS
| dmResource::HFactory | factory | Factory handle | 
| const char* | path | The path of the resource | 
| uint32_t | size | The size of the resource (in bytes) | 
| const void* | resource | The resource payload | 
RETURNS
| dmResource::Result | on success. | 
dmResource::Result Get(dmResource::HFactory factory, const char* name, void** resource)
Get a resource from factory
PARAMETERS
| dmResource::HFactory | factory | Factory handle | 
| const char* | name | Resource name | 
| void** | resource | Created resource | 
RETURNS
| dmResource::Result | RESULT_OK on success | 
dmResource::Result Get(dmResource::HFactory factory, dmhash_t name, void** resource)
Get a resource from factory
PARAMETERS
| dmResource::HFactory | factory | Factory handle | 
| dmhash_t | name | Resource name | 
| void** | resource | Created resource | 
RETURNS
| dmResource::Result | RESULT_OK on success | 
 GetPath(dmResource::HFactory factory, const void* resource, uint64_t* hash)
Returns the canonical path hash of a resource
PARAMETERS
| dmResource::HFactory | factory | Factory handle | 
| const void* | resource | Resource | 
| uint64_t* | hash | Returned hash | 
RETURNS
|  | on success | 
bool PreloadHint(dmResource::HResourcePreloadHintInfo factory, const char* name)
Hint the preloader what to load before Create is called on the resource. The resources are not guaranteed to be loaded before Create is called. This function can be called from a worker thread.
PARAMETERS
| dmResource::HResourcePreloadHintInfo | factory | Preloader handle | 
| const char* | name | Resource name | 
RETURNS
| bool | if successfully invoking preloader. | 
void RegisterResourceDecryptionFunction(dmResource::FDecryptResource decrypt_resource)
Registers a custom resource decryption function
PARAMETERS
| dmResource::FDecryptResource | decrypt_resource | The decryption function | 
void RegisterResourceReloadedCallback(dmResource::HFactory factory, dmResource::FResourceReloadedCallback callback, void* user_data)
Function called when a resource has been reloaded.
PARAMETERS
| dmResource::HFactory | factory | Handle of the factory to which the callback will be registered | 
| dmResource::FResourceReloadedCallback | callback | Callback function to register | 
| void* | user_data | User data that to | 
void Release(dmResource::HFactory factory, void* resource)
Release resource
PARAMETERS
| dmResource::HFactory | factory | Factory handle | 
| void* | resource | Resource pointer | 
dmResource::Result RemoveFile(dmResource::HFactory factory, const char* path)
Removes a previously registered file from the resource system
PARAMETERS
| dmResource::HFactory | factory | Factory handle | 
| const char* | path | The path of the resource | 
RETURNS
| dmResource::Result | on success. | 
Decrypts a file