HIRO_DRAW
Computer Graphics Structures library
hiro::draw::PrimitiveDatabase Class Reference

Database of common mesh primitives. Automatically manages OpenGL resources. More...

Public Member Functions

 PrimitiveDatabase (const hiro::draw::PrimitiveDatabase &)=delete
 
void Draw (const hiro::draw::PrimitiveName primitive) const
 Request single draw call of a specified primitive.
 
void Draw (const hiro::draw::GeometryName geom) const
 Request single draw call of a specified geometry.
 
void DrawInstanced (uint32_t count, const hiro::draw::PrimitiveName primitive) const
 Request instanced draw call of a specified primitive.
 
void DrawInstanced (uint32_t count, const hiro::draw::GeometryName geom) const
 Request instanced draw call of a specified geometry.
 
const glw::PArrayObject & Get (const hiro::draw::PrimitiveName primitive) const
 Request pointer to buffer object of primitive with specified name.
 
const hiro::draw::Geometry & GetGeometry (const hiro::draw::GeometryName geom) const
 Request pointer to geometry object with specified name.
 
void Free ()
 Releases all allocated resources from video memory.
 

Static Public Member Functions

static hiro::draw::PrimitiveDatabase & GetSingleton ()
 
static glw::PArrayObject GenerateUvSphere (float radius, uint32_t smoothness=8)
 Generates sphere with defined radius. Smoothness parameter influences number of sphere segments.
 
static glw::PArrayObject GeneratePlane (const glm::vec3 &position, float sizing, geom::Axis perpandicular_to)
 Generates plane at position, with specified size, perpendicular to specified axis.
 

Detailed Description

Database of common mesh primitives. Automatically manages OpenGL resources.