Class Asset

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class Asset : public Cacao::Resource

Base class for asset types.

Subclassed by Cacao::Cubemap, Cacao::Mesh, Cacao::Sound, Cacao::Tex2D

Public Functions

virtual void Realize() = 0

Synchronously convert the loaded data into a form suitable for use.

Throws:

BadRealizeStateException – If the asset is already realized

virtual std::shared_future<void> RealizeAsync() = 0

Asynchronously convert the loaded data into a form suitable for use.

Throws:

BadRealizeStateException – If the asset is already realized

Returns:

A future that will resolve when realization is complete or fails

virtual void DropRealized() = 0

Destroy the realized representation of the asset.

Throws:

BadRealizeStateException – If the asset is not realized

inline virtual bool IsRealized() const

Check if the asset is realized.

Returns:

Whether the asset is realized

inline virtual ~Asset()

Protected Functions

inline Asset(const std::string &addr)

Protected Attributes

bool realized