#include <kanzi/core.ui/platform/graphics_backend/gl/gpu_buffer.hpp>
|
NativeHandle | getNativeHandle () const |
| Gets the underlying native GL handle. More...
|
|
size_t | getSize () const |
| Gets the size of the buffer. More...
|
|
Type | getType () const |
| Gets the type of the buffer. More...
|
|
| GPUBuffer ()=default |
| Default constructor. More...
|
|
| GPUBuffer (Renderer &renderer, Type type, size_t size) |
| Constructor that initializes as empty and without uploading. More...
|
|
| GPUBuffer (Renderer &renderer, Type type, ConstByteSpan data) |
| Constructor that initializes with data and uploads immediately. More...
|
|
| GPUBuffer (Renderer &renderer, Type type, size_t size, NativeHandle nativeHandle, bool takeOwnership) |
| Constructor that initializes from existing GL handle. More...
|
|
| GPUBuffer (GPUBuffer &&other) |
| Move constructor. More...
|
|
GPUBuffer & | operator= (GPUBuffer &&other) |
| Move operator. More...
|
|
void | setData (Renderer &renderer, ConstByteSpan data, const bool shrinkToFit) |
| Updates all data in the buffer. More...
|
|
void | setSubData (Renderer &renderer, ConstByteSpan data, unsigned int offset) |
| Updates a subsection of data in the buffer. More...
|
|
◆ NativeHandle
Backend specific handle type.
For OpenGL that is GLuint (unsigned int).
- Since
- Kanzi 3.9.6
◆ Type
Enumerator |
---|
BufferTypeVertex | |
BufferTypeIndex | |
BufferTypeInstance | |
◆ GPUBuffer() [1/5]
kanzi::GPUBuffer::GPUBuffer |
( |
| ) |
|
|
explicitdefault |
◆ GPUBuffer() [2/5]
kanzi::GPUBuffer::GPUBuffer |
( |
Renderer & |
renderer, |
|
|
Type |
type, |
|
|
size_t |
size |
|
) |
| |
|
inlineexplicit |
Constructor that initializes as empty and without uploading.
- Parameters
-
renderer | The renderer to use. |
type | Type of buffer: VBO or IBO. |
size | Initial size in bytes. |
◆ GPUBuffer() [3/5]
Constructor that initializes with data and uploads immediately.
- Parameters
-
renderer | The renderer to use. |
type | Type of buffer: VBO or IBO. |
data | Initial data to upload. |
◆ GPUBuffer() [4/5]
kanzi::GPUBuffer::GPUBuffer |
( |
Renderer & |
renderer, |
|
|
Type |
type, |
|
|
size_t |
size, |
|
|
NativeHandle |
nativeHandle, |
|
|
bool |
takeOwnership |
|
) |
| |
|
inlineexplicit |
Constructor that initializes from existing GL handle.
- Parameters
-
renderer | The renderer to use. |
type | Type of buffer: VBO or IBO. |
size | Initial size in bytes. |
nativeHandle | Native handle. |
takeOwnership | Whether to destroy the native handle when GPUBuffer is destroyed. |
- Since
- Kanzi 3.9.6
◆ GPUBuffer() [5/5]
kanzi::GPUBuffer::GPUBuffer |
( |
GPUBuffer && |
other | ) |
|
|
inline |
Move constructor.
- Parameters
-
◆ getNativeHandle()
Gets the underlying native GL handle.
- Returns
- The native GL handle of the buffer.
◆ getSize()
size_t kanzi::GPUBuffer::getSize |
( |
| ) |
const |
|
inline |
Gets the size of the buffer.
- Returns
- Size of the buffer.
◆ getType()
Type kanzi::GPUBuffer::getType |
( |
| ) |
const |
|
inline |
Gets the type of the buffer.
- Returns
- Type of the buffer.
◆ setSubData()
Updates a subsection of data in the buffer.
Uploads changes immediately.
- Parameters
-
renderer | Pointer to the renderer being used. |
data | The new data. |
offset | Offset in the buffer into which to update the data. |
◆ setData()
Updates all data in the buffer.
Uploads changes immediately.
- Parameters
-
renderer | Pointer to the renderer being used. |
data | The new data. |
shrinkToFit | Whether to allow the buffer to shrink, if the data size is smaller than the buffer size. |
◆ operator=()
Move operator.
- Parameters
-
- Returns
- This object.
◆ swap
Swaps buffer contents with each other.
- Parameters
-
lhs | Left-hand side operand. |
rhs | Right-hand side operand. |
◆ NativeHandleInvalid
constexpr NativeHandle kanzi::GPUBuffer::NativeHandleInvalid |
|
static |
Invalid value to initialize native handles with.
- Since
- Kanzi 3.9.6
The documentation for this class was generated from the following file: