Resource

Namespace: dmResource Language: C++ Type: Defold C++ File: resource.hpp Source: engine/resource/src/dmsdk/resource/resource.hpp Include: dmsdk/resource/resource.hpp

Functions for managing resource and resource types

API

AddFile

Type: FUNCTION 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

Returns

CreateResource

Type: FUNCTION Creates and inserts a resource into the factory

Notes

Parameters

Returns

FDecryptResource

Type: TYPEDEF Decrypts a file

Notes

Parameters

Returns

Get

Type: FUNCTION Get a resource from factory

Parameters

Returns

Get

Type: FUNCTION Get a loaded resource from factory

Parameters

Returns

GetCanonicalPath

Type: FUNCTION Gets the normalized resource path: “/my//icon.texturec” -> “/my/icon.texturec”. “my/icon.texturec” -> “/my/icon.texturec”.

Parameters

Returns

GetPath

Type: FUNCTION Returns the canonical path hash of a resource

Parameters

Returns

GetTypeFromExtension

Type: FUNCTION Get type from extension

Parameters

Returns

GetTypeFromExtensionHash

Type: FUNCTION Get type from extension hash

Parameters

Returns

GetWithExt

Type: FUNCTION Get (load) a resource from factory

Parameters

Returns

GetWithExt

Type: FUNCTION Get a loaded resource from factory

Parameters

Returns

PreloadHint

Type: FUNCTION 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

Returns

RegisterResourceDecryptionFunction

Type: FUNCTION Registers a custom resource decryption function

Parameters

RegisterResourceReloadedCallback

Type: FUNCTION Function called when a resource has been reloaded.

Parameters

RegisterType

Type: FUNCTION

Notes

Release

Type: FUNCTION Release resource

Parameters

RemoveFile

Type: FUNCTION Removes a previously registered file from the resource system

Parameters

Returns

SetupType

Type: FUNCTION Setup function pointers and context for a resource type

Notes