|
SleakEngine 1.0.0
C++23 multi-backend game engine
|
OpenGL VBO/EBO/UBO wrapper; target is derived from BufferType at construction. More...
#include <OpenGLBuffer.hpp>
Public Member Functions | |
| OpenGLBuffer (uint32_t size, BufferType type) | |
| ~OpenGLBuffer () override | |
| void | Cleanup () override |
| void * | GetData () override |
| GLuint | GetGLBuffer () const |
| GLenum | GetTarget () const |
| bool | Initialize (void *data) override |
| Creates the GL buffer object and uploads the initial payload, if any. | |
| bool | Map () override |
| Maps the buffer for direct CPU writes via glMapBuffer. | |
| void | Unmap () override |
| void | Update () override |
| Re-uploads the last-mapped/updated data via glBufferSubData. | |
| void | Update (void *data, size_t size) override |
| Uploads new data, resizing the backing store if it grew. | |
| Public Member Functions inherited from Sleak::RenderEngine::BufferBase | |
| const void * | GetCPUShadowCopy () const |
| size_t | GetCPUShadowCopySize () const |
| size_t | GetSize () |
| int | GetSlot () const |
| BufferType | GetType () |
| uint32_t | GetVertexFormat () const |
| Registered custom vertex layout of this buffer; 0 means the engine default Vertex. | |
| void | SetSlot (int slot) |
| void | SetVertexFormat (uint32_t handle) |
| Tags the buffer with a VertexFormatRegistry handle so backends pick the matching pipeline. | |
| void | StoreCPUShadowCopy (const void *data, size_t size) |
| Copies up to 128 bytes into the inline shadow-copy storage, clamping oversized input. | |
| Public Member Functions inherited from Sleak::ResourceBase | |
| virtual | ~ResourceBase ()=default |
Additional Inherited Members | |
| Protected Attributes inherited from Sleak::RenderEngine::BufferBase | |
| bool | bIsMapped = false |
| void * | Data = nullptr |
| const void * | m_cpuShadowCopy = nullptr |
| size_t | m_cpuShadowCopySize = 0 |
| char | m_cpuShadowStorage [128] = {} |
| uint32_t | m_vertexFormat = 0 |
| size_t | Size = 0 |
| int | Slot = 0 |
| BufferType | Type |
| Protected Attributes inherited from Sleak::ResourceBase | |
| bool | bIsInitialized |
| std::string | Name |
OpenGL VBO/EBO/UBO wrapper; target is derived from BufferType at construction.
Definition at line 11 of file OpenGLBuffer.hpp.
| Sleak::RenderEngine::OpenGLBuffer::OpenGLBuffer | ( | uint32_t | size, |
| BufferType | type ) |
Definition at line 8 of file OpenGLBuffer.cpp.
|
override |
Definition at line 28 of file OpenGLBuffer.cpp.
|
overridevirtual |
Implements Sleak::ResourceBase.
Definition at line 67 of file OpenGLBuffer.cpp.
|
overridevirtual |
Implements Sleak::RenderEngine::BufferBase.
Definition at line 98 of file OpenGLBuffer.cpp.
|
inline |
Definition at line 30 of file OpenGLBuffer.hpp.
|
inline |
Definition at line 31 of file OpenGLBuffer.hpp.
|
overridevirtual |
Creates the GL buffer object and uploads the initial payload, if any.
Implements Sleak::ResourceBase.
Definition at line 32 of file OpenGLBuffer.cpp.
|
overridevirtual |
Maps the buffer for direct CPU writes via glMapBuffer.
Implements Sleak::RenderEngine::BufferBase.
Definition at line 75 of file OpenGLBuffer.cpp.
|
overridevirtual |
Implements Sleak::RenderEngine::BufferBase.
Definition at line 88 of file OpenGLBuffer.cpp.
|
overridevirtual |
Re-uploads the last-mapped/updated data via glBufferSubData.
Implements Sleak::RenderEngine::BufferBase.
Definition at line 47 of file OpenGLBuffer.cpp.
|
overridevirtual |
Uploads new data, resizing the backing store if it grew.
Implements Sleak::RenderEngine::BufferBase.
Definition at line 54 of file OpenGLBuffer.cpp.