Class Mesh

Inheritance Relationships

Base Type

Class Documentation

class Mesh : public Cacao::Asset

Asset type for 3D mesh data.

Public Functions

virtual void Realize()

Synchronously convert the mesh data into a form suitable for rendering.

Throws:
  • BadRealizeStateException – If the mesh is already realized

  • BadInitStateException – If the graphics backend is not initialized or connected

virtual std::shared_future<void> RealizeAsync()

Asynchronously convert the mesh data into a form suitable for rendering.

Throws:
  • BadRealizeStateException – If the mesh is already realized

  • BadInitStateException – If the graphics backend is not initialized or connected

Returns:

A future that will resolve when realization is complete or fails

virtual void DropRealized()

Destroy the realized representation of the asset.

Throws:
  • BadRealizeStateException – If the mesh is not realized

  • BadInitStateException – If the graphics backend is not initialized or connected

~Mesh()

Public Static Functions

static inline std::shared_ptr<Mesh> Create(std::vector<Vertex> &&vtx, std::vector<glm::uvec3> &&idx, const std::string &addr)

Create a new mesh from vertex and index data.

Parameters:
  • vtx – The vertices of the mesh

  • idx – The indices of the mesh, grouped in sets of triangles, corresponding to the vertex index in vtx

  • addr – The resource address identifier to associate with the mesh