kanzi::GLShaderHandle Class Reference

GLShaderHandle manages RAII ownership for GL shader object. More...

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

Public Member Functions

 GLShaderHandle ()
 Constructs an empty GLShaderHandle which does not own any GL shader object. More...
 
 GLShaderHandle (kanzi::Renderer *renderer, ShaderType type)
 Creates a new GL shader object with renderer and constructs a GLShaderHandle which owns it. More...
 
 ~GLShaderHandle ()
 
unsigned int release ()
 Releases the ownership of the GL shader if any. More...
 
 GLShaderHandle (KZ_RV_REF(GLShaderHandle) other)
 
GLShaderHandleoperator= (KZ_RV_REF(GLShaderHandle) other)
 
unsigned int get () const
 Returns GL handle to the shader object or 0 if no GL shader is owned. More...
 
ShaderType getType () const
 
void reset ()
 Destroys the GL shader object currently managed by the GLShaderHandle (if any) More...
 
 operator bool_type () const
 

Friends

void swap (GLShaderHandle &left, GLShaderHandle &right)
 

Detailed Description

GLShaderHandle manages RAII ownership for GL shader object.

Constructor & Destructor Documentation

kanzi::GLShaderHandle::GLShaderHandle ( )
explicit

Constructs an empty GLShaderHandle which does not own any GL shader object.

kanzi::GLShaderHandle::GLShaderHandle ( kanzi::Renderer renderer,
ShaderType  type 
)
explicit

Creates a new GL shader object with renderer and constructs a GLShaderHandle which owns it.

Parameters
rendererRenderer
typeType of GL shader to create
kanzi::GLShaderHandle::~GLShaderHandle ( )
kanzi::GLShaderHandle::GLShaderHandle ( KZ_RV_REF(GLShaderHandle other)
inline

Member Function Documentation

unsigned int kanzi::GLShaderHandle::release ( )

Releases the ownership of the GL shader if any.

get() returns 0 after the call.

Returns
Handle to the GL shader object
GLShaderHandle& kanzi::GLShaderHandle::operator= ( KZ_RV_REF(GLShaderHandle other)
inline
unsigned int kanzi::GLShaderHandle::get ( ) const
inline

Returns GL handle to the shader object or 0 if no GL shader is owned.

ShaderType kanzi::GLShaderHandle::getType ( ) const
inline
void kanzi::GLShaderHandle::reset ( )

Destroys the GL shader object currently managed by the GLShaderHandle (if any)

kanzi::GLShaderHandle::operator bool_type ( ) const
inline

Friends And Related Function Documentation

void swap ( GLShaderHandle left,
GLShaderHandle right 
)
friend

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