Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::render::Mesh Class Reference

Public Member Functions

template<typename SceneMeshType >
 Mesh (const SceneMeshType &scene_mesh, bool editable=false)
 Construct a mesh from an existing scene mesh.
 
template<typename SceneMeshType >
 Mesh (const SceneMeshType &, uint32_t max_vertices_count, uint32_t max_indices_count)
 Allocate a mesh to be dynamically filled.
 
void setSubBufferData (const uint32_t size, const void *data, const uint32_t offset=0)
 
void setIndicesData (const uint32_t size, const void *data, const uint32_t offset=0)
 
std::pair< void *, void * > getRawBuffers ()
 Get raw GPU buffers of the mesh (to write data)
 
void releaseRawBuffers ()
 Release raw buffers got by getRawBuffers.
 
void renderArrays (const uint32_t count, const uint32_t offset, uint32_t mode)
 
void renderElements (const uint32_t count, const uint32_t offset, const uint32_t mode)
 
void render (const std::vector< bool > &activeprimitives, uint32_t mode=default_mesh_rendering_mode)
 Ask the GPU to render specific primitives of the mesh.
 
void renderAll (uint32_t mode=default_mesh_rendering_mode)
 

Public Attributes

std::vector< oe::scene::Primitiveprimitives
 mesh parts
 

Constructor & Destructor Documentation

◆ Mesh() [1/2]

template<typename SceneMeshType >
oe::render::Mesh::Mesh ( const SceneMeshType &  scene_mesh,
bool  editable = false 
)
inline

Construct a mesh from an existing scene mesh.

Parameters
scene_mesh
editableSet to true to allow mesh buffer to be updated

◆ Mesh() [2/2]

template<typename SceneMeshType >
oe::render::Mesh::Mesh ( const SceneMeshType &  ,
uint32_t  max_vertices_count,
uint32_t  max_indices_count 
)
inline

Allocate a mesh to be dynamically filled.

Note
SceneMeshType data not used its only used as mecanism to fetch vertices and indices types (to bypass template constructor call not available in C++)

Member Function Documentation

◆ getRawBuffers()

std::pair< void *, void * > oe::render::Mesh::getRawBuffers ( )
inline

Get raw GPU buffers of the mesh (to write data)

Warning
Do not forget to release back the buffers by calling releaseRawBuffers after you write
Note
Advanced usage, not recommended to use

◆ releaseRawBuffers()

void oe::render::Mesh::releaseRawBuffers ( )
inline

Release raw buffers got by getRawBuffers.

Note
Advanced usage, not recommended to use

◆ render()

void oe::render::Mesh::render ( const std::vector< bool > &  activeprimitives,
uint32_t  mode = default_mesh_rendering_mode 
)
inline

Ask the GPU to render specific primitives of the mesh.

Parameters
activeprimitiveswhich primitives to render
modeMeshDrawMode to specify how to render the mesh (default are triangles)

◆ renderAll()

void oe::render::Mesh::renderAll ( uint32_t  mode = default_mesh_rendering_mode)
inline

Ask the GPU to render the complete mesh

Parameters
modeMeshDrawMode to specify how to render the mesh (default are triangles)

◆ renderArrays()

void oe::render::Mesh::renderArrays ( const uint32_t  count,
const uint32_t  offset,
uint32_t  mode 
)
inline

Ask the GPU to render only the vertices (ignore primitive contents)

Parameters
offsetid of first vertex to draw
counttotal vertices to draw
modeMeshDrawMode to specify how to render the mesh (default are triangles)

◆ renderElements()

void oe::render::Mesh::renderElements ( const uint32_t  count,
const uint32_t  offset,
const uint32_t  mode 
)
inline

Ask the GPU to render only some indices (ignoring primitive contents)

Parameters
offsetid of first vertex to draw
counttotal vertices to draw
modeMeshDrawMode to specify how to render the mesh (default are triangles)

◆ setIndicesData()

void oe::render::Mesh::setIndicesData ( const uint32_t  size,
const void *  data,
const uint32_t  offset = 0 
)
inline

Partial update of indices buffer

◆ setSubBufferData()

void oe::render::Mesh::setSubBufferData ( const uint32_t  size,
const void *  data,
const uint32_t  offset = 0 
)
inline

Partial update of vertices buffer


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