Luna::Asset::load_asset

RV load_asset(asset_t asset, bool force_reload=false)

Creates one asset data object for the asset by loading data from asset file.

This function loads the asset data synchronously. To load asset data asynchronously, call this function in the thread you want to use for asset loading, like a background thread or a worker thread in job system.

Parameters

  • in asset

    The asset handle of the asset to operate.

  • in force_reload

    If this is true, this function always loads the asset data from file even if the asset is in loaded state, and the existing asset data object will be replaced with new asset data object. If this is false, this function returns directly if the asset is already in loaded state, and the existing asset data object will not be changed.