GLTextureHandle manages RAII ownership for GL texture object.
More...
#include <kanzi/core.ui/platform/graphics_backend/gl/gl_texture_handle.hpp>
GLTextureHandle manages RAII ownership for GL texture object.
◆ GLTextureHandle() [1/4]
kanzi::GLTextureHandle::GLTextureHandle |
( |
| ) |
|
|
explicit |
Constructs an empty GLTextureHandle which does not own any GL texture object.
◆ GLTextureHandle() [2/4]
kanzi::GLTextureHandle::GLTextureHandle |
( |
Renderer * |
renderer | ) |
|
|
explicit |
Creates a new GL texture object with renderer and constructs a GLTextureHandle which owns it.
- Parameters
-
◆ ~GLTextureHandle()
kanzi::GLTextureHandle::~GLTextureHandle |
( |
| ) |
|
◆ GLTextureHandle() [3/4]
kanzi::GLTextureHandle::GLTextureHandle |
( |
Renderer * |
renderer, |
|
|
unsigned int |
handle, |
|
|
bool |
takeOwnership |
|
) |
| |
|
explicit |
Creates a wrapper for pre-existing GL texture object.
If takeOwnership is true, the GL texture object is externally managed, and it will not be deleted when the handle is destroyed.
- Parameters
-
renderer | Renderer |
handle | Pre-existing GL texture object name |
takeOwnership | Should newgly created GLTextureHandle take ownership of the GL texture object |
◆ GLTextureHandle() [4/4]
◆ release()
unsigned int kanzi::GLTextureHandle::release |
( |
| ) |
|
Releases the ownership of the GL texture if any.
get() returns 0 after the call.
- Returns
- Handle to the GL texture object
◆ operator=()
◆ get()
unsigned int kanzi::GLTextureHandle::get |
( |
| ) |
const |
|
inline |
Returns GL handle to the texture object, or 0 if no GL texture is owned.
◆ reset()
void kanzi::GLTextureHandle::reset |
( |
| ) |
|
Destroys the GL texture object currently managed by the GLTextureHandle (if any)
◆ operator bool_type()
kanzi::GLTextureHandle::operator bool_type |
( |
| ) |
const |
|
inline |
◆ swap
The documentation for this class was generated from the following file: