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

A mesh where the vertices/indices are dynamic. More...

#include <OxygenEngine/render/mesh.h>

Inheritance diagram for oe::render::DynamicMesh:
[legend]
Collaboration diagram for oe::render::DynamicMesh:
[legend]

Public Member Functions

template<typename V >
 DynamicMesh (const V &, uint32_t max_count, const MeshUsage usage=MeshUsage::DYNAMIC)
 
template<typename V >
 DynamicMesh (const V &, uint32_t max_vertices_count, uint32_t max_indices_count, const MeshUsage usage=MeshUsage::DYNAMIC)
 
void render (const uint32_t offset=0, const uint32_t mode=0x0004)
 
void renderElements (const uint32_t count, const uint32_t offset=0, const uint32_t mode=0x0004)
 
void setIndicesData (const uint32_t size, const void *data, const uint32_t offset=0)
 
std::pair< void *, void * > getRawBuffers ()
 
void releaseRawBuffers ()
 
- Public Member Functions inherited from oe::render::CommonMesh
void renderArrays (const uint32_t count, const uint32_t offset=0, const uint32_t mode=0x0004)
 
void setSubBufferData (const uint32_t size, const void *data, const uint32_t offset=0)
 
template<typename V >
void bindVertexAttributes ()
 
void enableVertexAttribPointer (uint32_t index, size_t offset, size_t total, int32_t componentCount)
 
void enableVertexAttribIPointer (uint32_t index, size_t offset, size_t total, int32_t componentCount)
 
template<typename VertexType , typename T >
void bindVertexAttributeToPointer (const uint32_t index, const size_t offset) noexcept
 
template<typename ComponentType >
void bindVertexAttributeToPointer (uint32_t index, size_t offset, size_t total) noexcept
 

Protected Attributes

uint32_t _indices_size = 0
 
uint32_t _ebo = 0
 
- Protected Attributes inherited from oe::render::CommonMesh
uint32_t _vao = 0
 
uint32_t _vbo = 0
 
MeshUsage _usage
 

Additional Inherited Members

- Protected Member Functions inherited from oe::render::CommonMesh
 CommonMesh (MeshUsage usage)
 
void _prepare_mesh_vao (const size_t vertex_size, const size_t count, const void *data, const bool editable=false)
 
uint32_t _prepare_mesh_ebo (const size_t size, const void *data, const bool editable=false)
 

Detailed Description

A mesh where the vertices/indices are dynamic.

Note
You can start with a blank mesh: In this case, you should fill vertices/indices yourself with setSubBufferData()

Constructor & Destructor Documentation

◆ DynamicMesh() [1/2]

template<typename V >
oe::render::DynamicMesh::DynamicMesh ( const V &  ,
uint32_t  max_count,
const MeshUsage  usage = MeshUsage::DYNAMIC 
)
inline

Prepare buffers for a mesh without indices, in this case you should fill it yourself with setIndicesData()

◆ DynamicMesh() [2/2]

template<typename V >
oe::render::DynamicMesh::DynamicMesh ( const V &  ,
uint32_t  max_vertices_count,
uint32_t  max_indices_count,
const MeshUsage  usage = MeshUsage::DYNAMIC 
)
inline

Prepare buffers for a mesh with one set on indices

Member Function Documentation

◆ getRawBuffers()

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

Get raw buffer adresses

Returns
pair with vertex buffer and indices buffer adress
Note
Hardcore things. Use only if you know what you are doing

◆ render()

void oe::render::DynamicMesh::render ( const uint32_t  offset = 0,
const uint32_t  mode = 0x0004 
)

Ask the GPU to render the complete mesh

Parameters
offsetid of first index
modeMeshDrawMode to specify how to render the mesh (default are triangles)

◆ renderElements()

void oe::render::DynamicMesh::renderElements ( const uint32_t  count,
const uint32_t  offset = 0,
const uint32_t  mode = 0x0004 
)

Ask the GPU to render part of the mesh

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

◆ setIndicesData()

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

Partial update of indices buffer


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