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

DestroyLoadParametersFn destroyLoadParameters

HashLoadParametersFn hashLoadParameters

LoadParametersEqualsFn loadParametersEquals

HashAssetFn hashAsset

See also

HashAssetFn

CreateContextFn createContext

See also

CreateContextFn

DestroyContextFn destroyContext

See also

DestroyContextFn

CreateDependenciesFn createDependencies

DestroyDependenciesFn destroyDependencies

OnDependencyChangedFn onDependencyChanged