|
Oxygen Engine
Modern C++ 3D Engine using OpenGL
|
GPU mesh wrapper. More...
#include <OxygenEngine/render/mesh.h>
Inheritance diagram for oe::render::Mesh:
Collaboration diagram for oe::render::Mesh: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) |
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 | |
| std::vector< std::pair< uint32_t, uint32_t > > | _ebos |
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) |
Protected Member Functions inherited from oe::util::NonCopyable | |
| NonCopyable (NonCopyable &&)=default | |
| NonCopyable & | operator= (NonCopyable &&)=default |
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) |