Asset library. More...

#include <assets.h>

Inheritance diagram for Assets:
Component SIMDAlignedType

Public Member Functions

 LM_INTERFACE_CLASS (Assets, Component, 3)
 LM_INTERFACE_F (0, Initialize, bool(const PropertyNode *prop))
 Initialize the asset library. More...
 LM_INTERFACE_F (1, AssetByIDAndType, Asset *(const std::string &id, const std::string &type, const Primitive *primitive))
 Get and/or load an asset by name. More...
 LM_INTERFACE_F (2, PostLoad, bool(const Scene *scene))
 Dispatches post loading functions of the loaded assets. More...
- Public Member Functions inherited from SIMDAlignedType
void * operator new (std::size_t size) throw (std::bad_alloc)
void operator delete (void *p)

Detailed Description

Asset library.

An interface for the asset management. All instances of the loaded assets are managed by this interface.

Member Function Documentation

Assets::LM_INTERFACE_F ( ,
Initialize  ,
bool(const PropertyNode *prop)   

Initialize the asset library.

Initializes the asset management. Note that this function does not load any assets. The asset loading is delayed until they are actually referenced.

prop The propery node pointing to assets node.

Return values
trueSucceeded to initialize.
falseFailed to initialize.
Assets::LM_INTERFACE_F ( ,
AssetByIDAndType  ,
Asset const std::string &id, const std::string &type, const Primitive *primitive 

Get and/or load an asset by name.

The function tries to get the asset specified by id. If the asset is not found, the asset is loaded from the property node specified by the Initialize function.

This function returns nullptr if no asset is found, or failed to load the asset.

nameName of the asset.
Asset instance.
Assets::LM_INTERFACE_F ( ,
PostLoad  ,
bool(const Scene *scene)   

Dispatches post loading functions of the loaded assets.

Return values
trueSucceeded to load.
falseFailed to load.