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.
kanzi::GLTextureHandle::GLTextureHandle |
( |
| ) |
|
|
explicit |
Constructs an empty GLTextureHandle which does not own any GL texture object.
kanzi::GLTextureHandle::GLTextureHandle |
( |
Renderer * |
renderer | ) |
|
|
explicit |
Creates a new GL texture object with renderer and constructs a GLTextureHandle which owns it.
- Parameters
-
kanzi::GLTextureHandle::~GLTextureHandle |
( |
| ) |
|
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 |
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
unsigned int kanzi::GLTextureHandle::get |
( |
| ) |
const |
|
inline |
Returns GL handle to the texture object, or 0 if no GL texture is owned.
void kanzi::GLTextureHandle::reset |
( |
| ) |
|
Destroys the GL texture object currently managed by the GLTextureHandle (if any)
kanzi::GLTextureHandle::operator bool_type |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: