carb::assets::CreateDependenciesFn

Defined in carb/assets/AssetsTypes.h

using carb::assets::CreateDependenciesFn = const char *(*)(carb::datasource::IDataSource *dataSource, carb::datasource::Connection *connection, const char *path, const uint8_t *data, size_t size, const LoadParameters *loadParameters, LoadContext *context)

Loader function (member of LoaderDesc) that returns a string of the asset dependencies, that is, other files to watch for changes.

This function is optional, if it isn’t provided, then only path (passed to IAssets::loadAsset()) will be monitored for changes.

Many asset types, such as shaders, include additional files to generate their content. In this case it isn’t just the original file changing that requires the asset to be reloaded, if any dependent file changes, then the asset has to be reloaded as well.

Multiple dependencies must separated by the | character.

Param dataSource

The datasource the asset is being loaded from.

Param connection

The connection the asset is being loaded from.

Param path

The path of the file that is being loaded.

Param data

The loaded data of the requested assets file.

Param size

The size of the requested asset file.

Param loadParameters

The load parameters provided to IAssets::loadAsset().

Param context

The context if any generated by CreateContextFn.

Return

A string containing dependencies to watch, delimited by |; nullptr may be returned to indicate no dependencies. The returned pointer will be passed to DestroyDependenciesFn to clean up the returned memory.