LoaderDesc#

Fully qualified name: carb::assets::LoaderDesc

Defined in carb/assets/AssetsTypes.h

struct LoaderDesc#

Defines the loader functions for an asset type.

The following is the basic call order for loader functions (for clarity, parameters have been simplified).

When an asset is being loaded for the first time, or reloaded:

context = createContext ? createContext() : nullptr;

dependencies = createDependencies ? createDependencies() : nullptr;
if (dependencies)
{
    // dependencies are processed
    destroyDependencies(dependencies);
}

hash = hashAsset();
// If the hash is already loaded then return that already loaded asset, otherwise:

asset = loadAsset();
if (context)
    destroyContext(context);

When the asset is destroyed:

unloadAsset(asset)

Public Members

LoadAssetFn loadAsset#

See also

LoadAssetFn

UnloadAssetFn unloadAsset#

See also

UnloadAssetFn

CreateLoadParametersFn createLoadParameters = nullptr#

DestroyLoadParametersFn destroyLoadParameters = nullptr#

HashLoadParametersFn hashLoadParameters = nullptr#

LoadParametersEqualsFn loadParametersEquals = nullptr#

HashAssetFn hashAsset = nullptr#

See also

HashAssetFn

CreateContextFn createContext = nullptr#

See also

CreateContextFn

DestroyContextFn destroyContext = nullptr#

See also

DestroyContextFn

CreateDependenciesFn createDependencies = nullptr#

DestroyDependenciesFn destroyDependencies = nullptr#

OnDependencyChangedFn onDependencyChanged = nullptr#