Kanzi  3.9.9
Kanzi Engine C++ API
kanzi::GLTextureHandle Class Reference

GLTextureHandle manages RAII ownership for GL texture object. More...

#include <kanzi/core.ui/platform/graphics_backend/gl/gl_texture_handle.hpp>

Public Member Functions

unsigned int get () const
 Returns GL handle to the texture object, or 0 if no GL texture is owned. More...
 
 GLTextureHandle ()
 Constructs an empty GLTextureHandle which does not own any GL texture object. More...
 
 GLTextureHandle (Renderer *renderer)
 Creates a new GL texture object with renderer and constructs a GLTextureHandle which owns it. More...
 
 GLTextureHandle (Renderer *renderer, unsigned int handle, bool takeOwnership)
 Creates a wrapper for pre-existing GL texture object. More...
 
 GLTextureHandle (GLTextureHandle &&other)
 
 operator bool_type () const
 
GLTextureHandleoperator= (GLTextureHandle &&other)
 
unsigned int release ()
 Releases the ownership of the GL texture if any. More...
 
void reset ()
 Destroys the GL texture object currently managed by the GLTextureHandle (if any) More...
 
 ~GLTextureHandle ()
 

Friends

void swap (GLTextureHandle &left, GLTextureHandle &right)
 

Detailed Description

GLTextureHandle manages RAII ownership for GL texture object.

Constructor & Destructor Documentation

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
rendererRenderer
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
rendererRenderer
handlePre-existing GL texture object name
takeOwnershipShould newgly created GLTextureHandle take ownership of the GL texture object
kanzi::GLTextureHandle::GLTextureHandle ( GLTextureHandle &&  other)
inline

Member Function Documentation

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
GLTextureHandle& kanzi::GLTextureHandle::operator= ( GLTextureHandle &&  other)
inline
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

Friends And Related Function Documentation

void swap ( GLTextureHandle left,
GLTextureHandle right 
)
friend

The documentation for this class was generated from the following file: