Kanzi  3.9.6
Kanzi Engine API
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

unsigned int get () const
 Returns GL handle to the shader object or 0 if no GL shader is owned. More...
 
ShaderType getType () const
 
 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 (GLShaderHandle &&other)
 
 operator bool_type () const
 
GLShaderHandleoperator= (GLShaderHandle &&other)
 
unsigned int release ()
 Releases the ownership of the GL shader if any. More...
 
void reset ()
 Destroys the GL shader object currently managed by the GLShaderHandle (if any) More...
 
 ~GLShaderHandle ()
 

Friends

void swap (GLShaderHandle &left, GLShaderHandle &right)
 

Detailed Description

GLShaderHandle manages RAII ownership for GL shader object.

Constructor & Destructor Documentation

◆ GLShaderHandle() [1/3]

kanzi::GLShaderHandle::GLShaderHandle ( )
explicit

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

◆ GLShaderHandle() [2/3]

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

◆ ~GLShaderHandle()

kanzi::GLShaderHandle::~GLShaderHandle ( )

◆ GLShaderHandle() [3/3]

kanzi::GLShaderHandle::GLShaderHandle ( GLShaderHandle &&  other)
inline

Member Function Documentation

◆ release()

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

◆ operator=()

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

◆ get()

unsigned int kanzi::GLShaderHandle::get ( ) const
inline

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

◆ getType()

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

◆ reset()

void kanzi::GLShaderHandle::reset ( )

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

◆ operator bool_type()

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

Friends And Related Function Documentation

◆ swap

void swap ( GLShaderHandle left,
GLShaderHandle right 
)
friend

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