#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...
|
|
Backend specific handle type.
For OpenGL that is GLuint (unsigned int).
- Since
- Kanzi 3.9.6
Enumerator |
---|
BufferTypeVertex |
|
BufferTypeIndex |
|
BufferTypeInstance |
|
kanzi::GPUBuffer::GPUBuffer |
( |
| ) |
|
|
explicitdefault |
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. |
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. |
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
kanzi::GPUBuffer::GPUBuffer |
( |
GPUBuffer && |
other | ) |
|
|
inline |
Move constructor.
- Parameters
-
Gets the underlying native GL handle.
- Returns
- The native GL handle of the buffer.
size_t kanzi::GPUBuffer::getSize |
( |
| ) |
const |
|
inline |
Gets the size of the buffer.
- Returns
- Size of the buffer.
Type kanzi::GPUBuffer::getType |
( |
| ) |
const |
|
inline |
Gets the type of the buffer.
- Returns
- Type of the buffer.
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. |
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. |
Move operator.
- Parameters
-
- Returns
- This object.
Swaps buffer contents with each other.
- Parameters
-
lhs | Left-hand side operand. |
rhs | Right-hand side operand. |
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: