Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::render::CommonMesh Class Reference
Inheritance diagram for oe::render::CommonMesh:
[legend]
Collaboration diagram for oe::render::CommonMesh:
[legend]

Public Member Functions

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 Member Functions

 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)
 

Protected Attributes

uint32_t _vao = 0
 
uint32_t _vbo = 0
 
MeshUsage _usage
 

Member Function Documentation

◆ bindVertexAttributes()

template<typename V >
void oe::render::CommonMesh::bindVertexAttributes ( )

Bind vertex attributes for the vertex type V

Parameters
id_vertex_bufferVertex buffer to update
Note
please specialize this function with your own vertex type if you add a new one

◆ bindVertexAttributeToPointer()

template<typename VertexType , typename T >
void oe::render::CommonMesh::bindVertexAttributeToPointer ( const uint32_t  index,
const size_t  offset 
)
inlinenoexcept

Enable and bind a vertex attribute of type T to the location, and fill value from offset in structure VertexType

Parameters
indexindex of the vertex attribute to be modified
offsetOffset to get the component

◆ renderArrays()

void oe::render::CommonMesh::renderArrays ( const uint32_t  count,
const uint32_t  offset = 0,
const uint32_t  mode = 0x0004 
)

Ask the GPU to render only the vertices

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

◆ setSubBufferData()

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

Partial update of buffer


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