guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
guillaume::MeshRenderable Class Reference

What a render system hands to the engine to draw geometry: a list of meshes and the name of the material to draw them with. More...

#include <headers/guillaume/mesh_renderable.hpp>

Inheritance diagram for guillaume::MeshRenderable:
Collaboration diagram for guillaume::MeshRenderable:

Public Member Functions

 MeshRenderable (std::vector< utility::graphic::Mesh > meshes, std::string materialName)
 Create a renderable from meshes and a material name.
 ~MeshRenderable (void) override=default
 Default destructor.
utility::graphic::Renderable::RenderableType getRenderableType (void) const override
 Tell the engine which kind of renderable this is.
std::string getMaterialName (void) const override
 Get the name of the material the engine draws the meshes with.

Detailed Description

What a render system hands to the engine to draw geometry: a list of meshes and the name of the material to draw them with.

The render systems (systems::RectangleRender, systems::ImageRender, systems::MeshRender, ...) build the meshes of an entity on the CPU with the vertices already in world coordinates, wrap them in a MeshRenderable, and pass it to utility::Engine::createObject or updateObject. The material name tells the engine how to shade them: "mesh_material" for flat colored shapes, "image_<path>" for a textured one.

The renderable types of the utility library each have a fixed material name; this class exists to choose it per object.

Note
Because the vertices are in world coordinates, the pose of the renderable is the identity. Its color is left default-constructed.
See also
TextRenderable

Definition at line 52 of file mesh_renderable.hpp.

Constructor & Destructor Documentation

◆ MeshRenderable()

guillaume::MeshRenderable::MeshRenderable ( std::vector< utility::graphic::Mesh > meshes,
std::string materialName )

Create a renderable from meshes and a material name.

Parameters
meshesThe meshes to draw, with vertices in world coordinates. Each one is copied into the renderable.
materialNameThe name of the material the engine should use, for instance "mesh_material".

Member Function Documentation

◆ getMaterialName()

std::string guillaume::MeshRenderable::getMaterialName ( void ) const
override

Get the name of the material the engine draws the meshes with.

Returns
The name given to the constructor.

◆ getRenderableType()

utility::graphic::Renderable::RenderableType guillaume::MeshRenderable::getRenderableType ( void ) const
override

Tell the engine which kind of renderable this is.

Returns
Always RenderableType::Mesh.

The documentation for this class was generated from the following file: