Kanzi  3.9.7
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

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