Oxygen Engine
Modern C++ 3D Engine using OpenGL
|
GPU mesh wrapper. More...
#include <OxygenEngine/render/mesh.h>
Public Member Functions | |
template<typename M > | |
Mesh (const M &mesh, const MeshUsage usage=MeshUsage::STATIC) | |
void | render (const uint32_t sub_mesh=0, const uint32_t mode=0x0004, const uint32_t offset=0) |
![]() | |
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 | |
std::vector< std::pair< uint32_t, uint32_t > > | _ebos |
![]() | |
uint32_t | _vao = 0 |
uint32_t | _vbo = 0 |
MeshUsage | _usage |
Additional Inherited Members | |
![]() | |
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) |
GPU mesh wrapper.
Represents the mesh that will be uploaded to the GPU
If you want to use your own vertex layout, you need to specialize bindVertexAttributes() with your vertex type
For example :
|
inline |
Prepare buffers for the mesh
void oe::render::Mesh::render | ( | const uint32_t | sub_mesh = 0 , |
const uint32_t | mode = 0x0004 , |
||
const uint32_t | offset = 0 |
||
) |
Ask the GPU to render the mesh
sub_mesh | Mesh part to render |
mode | MeshDrawMode to specify how to render the mesh (default are triangles) |