carb::assets::LoaderDesc

Defined in carb/assets/AssetsTypes.h

struct carb::assets::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)