Kanzi 3.9.10
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.
 
 GLTextureHandle ()
 Constructs an empty GLTextureHandle which does not own any GL texture object.
 
 GLTextureHandle (GLTextureHandle &&other)
 
 GLTextureHandle (Renderer *renderer)
 Creates a new GL texture object with renderer and constructs a GLTextureHandle which owns it.
 
 GLTextureHandle (Renderer *renderer, unsigned int handle, bool takeOwnership)
 Creates a wrapper for pre-existing GL texture object.
 
 operator bool_type () const
 
GLTextureHandleoperator= (GLTextureHandle &&other)
 
unsigned int release ()
 Releases the ownership of the GL texture if any.
 
void reset ()
 Destroys the GL texture object currently managed by the GLTextureHandle (if any)
 
 ~GLTextureHandle ()
 

Friends

void swap (GLTextureHandle &left, GLTextureHandle &right)
 

Detailed Description

GLTextureHandle manages RAII ownership for GL texture object.

Constructor & Destructor Documentation

◆ 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
rendererRenderer

◆ ~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
rendererRenderer
handlePre-existing GL texture object name
takeOwnershipShould newgly created GLTextureHandle take ownership of the GL texture object

◆ GLTextureHandle() [4/4]

kanzi::GLTextureHandle::GLTextureHandle ( GLTextureHandle && other)
inline

Member Function Documentation

◆ 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=()

GLTextureHandle & kanzi::GLTextureHandle::operator= ( GLTextureHandle && other)
inline

◆ 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

Friends And Related Symbol Documentation

◆ swap

void swap ( GLTextureHandle & left,
GLTextureHandle & right )
friend

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