kanzi::GlRenderState Class Reference

OpenGL render state. More...

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

Public Types

typedef int HandleType
 Type for handle identifiers into values in the render state. More...
 

Public Member Functions

 GlRenderState ()
 Empty constructor. More...
 
int acquireUniformLocation (string_view name) const
 Acquire uniform location based on data in this container. More...
 
int acquireUniformLocation (AbstractPropertyType propertyType) const
 Acquire uniform location wrapper. More...
 
void bind (Renderer3D &renderer)
 Apply the render state and be ready for rendering. More...
 
void attach (MaterialSharedPtr material)
 Attach to a certain material/node combination. More...
 
void applyTextureProperty (Renderer *renderer, Texture *texture, int textureUniformLocation)
 Apply a texture property. More...
 
void reattach ()
 Reattach already-attached material. More...
 
MaterialSharedPtr getMaterial () const
 Access material. More...
 
template<typename T >
void setValue (int handle, T value)
 Set a render value identified by handle. More...
 
optional< GraphicsBlendModegetBlendModeValue () const
 Get blend mode value. More...
 
void setValue (GraphicsBlendMode value)
 Set blend mode value. More...
 
template<typename T >
HandleType getHandle (string_view name)
 Access handle by type. More...
 
template<typename T >
getValue (HandleType handle) const
 Access value by handle. More...
 
template<>
KANZI_API int getHandle (string_view name)
 GlRenderState::getHandle() specialization. More...
 
template<>
KANZI_API TextureSharedPtr getValue (int handle) const
 GlRenderState::getValue() specialization. More...
 

Detailed Description

OpenGL render state.

Member Typedef Documentation

Type for handle identifiers into values in the render state.

Constructor & Destructor Documentation

kanzi::GlRenderState::GlRenderState ( )
inlineexplicit

Empty constructor.

Member Function Documentation

int kanzi::GlRenderState::acquireUniformLocation ( string_view  name) const

Acquire uniform location based on data in this container.

Parameters
nameName to query.
Returns
Uniform location integer.
int kanzi::GlRenderState::acquireUniformLocation ( AbstractPropertyType  propertyType) const
inline

Acquire uniform location wrapper.

Parameters
propertyTypeProperty type to query.
Returns
Uniform location integer.
void kanzi::GlRenderState::bind ( Renderer3D renderer)

Apply the render state and be ready for rendering.

Parameters
rendererRenderer to use.
void kanzi::GlRenderState::attach ( MaterialSharedPtr  material)

Attach to a certain material/node combination.

Parameters
materialMaterial to attach to.
void kanzi::GlRenderState::applyTextureProperty ( Renderer renderer,
Texture texture,
int  textureUniformLocation 
)

Apply a texture property.

Will use render state internal state information.

Parameters
rendererRenderer to use.
textureTexture to apply.
textureUniformLocationLocation of texture uniform.
void kanzi::GlRenderState::reattach ( )

Reattach already-attached material.

Does nothing if no material attached.

MaterialSharedPtr kanzi::GlRenderState::getMaterial ( ) const
inline

Access material.

Returns
Pointer to material.
template<typename T >
void kanzi::GlRenderState::setValue ( int  handle,
value 
)
inline

Set a render value identified by handle.

The handle may be invalid (negative), in which case this function does nothing.

Parameters
handleIdentifying handle.
valueValue to set.
optional<GraphicsBlendMode> kanzi::GlRenderState::getBlendModeValue ( ) const
inline

Get blend mode value.

Returns
Optional blend mode value.
void kanzi::GlRenderState::setValue ( GraphicsBlendMode  value)
inline

Set blend mode value.

Parameters
valueValue.
template<typename T >
HandleType kanzi::GlRenderState::getHandle ( string_view  name)
inline

Access handle by type.

Parameters
nameValue name.
Returns
Handle (index) to info array.
template<typename T >
T kanzi::GlRenderState::getValue ( HandleType  handle) const
inline

Access value by handle.

Handle must be valid, access with invalid handle is undefined behavior.

Parameters
handleHandle to value.
Returns
Value previously stored with the handle.
template<>
KANZI_API int kanzi::GlRenderState::getHandle ( string_view  name)

GlRenderState::getHandle() specialization.

template<>
KANZI_API TextureSharedPtr kanzi::GlRenderState::getValue ( int  handle) const

GlRenderState::getValue() specialization.


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