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.
◆ GLBufferHandle() [1/4]
kanzi::GLBufferHandle::GLBufferHandle |
( |
| ) |
|
|
explicit |
Constructs an empty GLBufferHandle which does not own any GL buffer object.
◆ GLBufferHandle() [2/4]
kanzi::GLBufferHandle::GLBufferHandle |
( |
Renderer * |
renderer | ) |
|
|
explicit |
Creates a new GL buffer object with renderer and constructs a GLBufferHandle which owns it.
- Parameters
-
◆ ~GLBufferHandle()
kanzi::GLBufferHandle::~GLBufferHandle |
( |
| ) |
|
◆ GLBufferHandle() [3/4]
kanzi::GLBufferHandle::GLBufferHandle |
( |
Renderer * |
renderer, |
|
|
unsigned int |
handle, |
|
|
bool |
takeOwnership |
|
) |
| |
|
explicit |
Creates a wrapper for pre-existing GL buffer object.
If takeOwnership is true, the GL buffer object is externally managed, and it will not be deleted when the handle is destroyed.
- Parameters
-
renderer | Renderer |
handle | Pre-existing GL buffer object name |
takeOwnership | Should newly created GLBufferHandle take ownership of the GL buffer object |
◆ GLBufferHandle() [4/4]
◆ release()
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
◆ operator=()
◆ get()
unsigned int kanzi::GLBufferHandle::get |
( |
| ) |
const |
|
inline |
Returns GL handle to the buffer object, or 0 if no GL buffer is owned.
◆ reset()
void kanzi::GLBufferHandle::reset |
( |
| ) |
|
Destroys the GL buffer object currently managed by the GLBufferHandle (if any)
◆ operator bool_type()
kanzi::GLBufferHandle::operator bool_type |
( |
| ) |
const |
|
inline |
◆ swap
The documentation for this class was generated from the following file: