GLBufferHandle manages RAII ownership for GL buffer object.
More...
#include <kanzi/core.ui/platform/graphics_backend/gl/gl_buffer_handle.hpp>
GLBufferHandle manages RAII ownership for GL buffer object.
kanzi::GLBufferHandle::GLBufferHandle |
( |
| ) |
|
|
explicit |
Constructs an empty GLBufferHandle which does not own any GL buffer object.
kanzi::GLBufferHandle::GLBufferHandle |
( |
Renderer * |
renderer | ) |
|
|
explicit |
Creates a GL buffer object with renderer and constructs a GLBufferHandle that owns the GL buffer object.
- Parameters
-
kanzi::GLBufferHandle::~GLBufferHandle |
( |
| ) |
|
kanzi::GLBufferHandle::GLBufferHandle |
( |
Renderer * |
renderer, |
|
|
unsigned int |
handle, |
|
|
bool |
takeOwnership |
|
) |
| |
|
explicit |
Creates a wrapper for an existing GL buffer object.
- Parameters
-
renderer | The renderer. |
handle | The name of an existing GL buffer object. |
takeOwnership | Whether the created GLBufferHandle takes ownership of the GL buffer object. When set to false, Kanzi does not delete the GL buffer object when destroying the GLBufferHandle. |
unsigned int kanzi::GLBufferHandle::release |
( |
| ) |
|
Releases the ownership of the GL buffer if any.
get() returns 0 after the call.
- Returns
- Handle to the GL buffer object
unsigned int kanzi::GLBufferHandle::get |
( |
| ) |
const |
|
inline |
Returns GL handle to the buffer object, or 0 if no GL buffer is owned.
void kanzi::GLBufferHandle::reset |
( |
| ) |
|
Destroys the GL buffer object currently managed by the GLBufferHandle (if any)
kanzi::GLBufferHandle::operator bool_type |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: