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

 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 ()
 
 GLTextureHandle (Renderer *renderer, unsigned int handle, bool takeOwnership)
 Creates a wrapper for pre-existing GL texture object. More...
 
unsigned int release ()
 Releases the ownership of the GL texture if any. More...
 
 GLTextureHandle (KZ_RV_REF(GLTextureHandle) other)
 
GLTextureHandleoperator= (KZ_RV_REF(GLTextureHandle) other)
 
unsigned int get () const
 Returns GL handle to the texture object, or 0 if no GL texture is owned. More...
 
void reset ()
 Destroys the GL texture object currently managed by the GLTextureHandle (if any) More...
 
 operator bool_type () const
 

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 ( KZ_RV_REF(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= ( KZ_RV_REF(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: