Kanzi 3.9.10
kanzi::GlRenderValueBinding Struct Reference

GlRenderValueBinding is a binding from shaders/materials into values in GlRenderState. More...

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

Public Member Functions

void addPropertyListener (Node *node, GlRenderState &renderState, PropertyDataType dataType, AbstractPropertyType propertyType, ShaderProgram::UniformTransformation transformation)
 Add a listener for given property.
 
void applyBlendMode (GlRenderState &renderState, PropertyObject *object, Material &material)
 Applies the blend mode.
 
void attach (Material &material, Node *node, bool readBlendModeFromNode, GlRenderState &renderState)
 Attaches to a material and a node.
 
void attach (Material &material, Node *node, GlRenderState &renderState)
 Attaches to a material and a node.
 
optional< intgetBlendModeOverride () const
 Gets the blend mode override.
 
optional< intgetBlendModeValue (PropertyObject *object, Material &material) const
 Gets the blend mode value to apply.
 
bool getOpaquenessHint () const
 Gets the opaqueness hint.
 
bool getTranslucencyHint () const
 Gets the translucency hint.
 
void invalidate ()
 Invalidates the state of the notification handler.
 
void setAllPropertiesDirty ()
 Flag all properties as being dirty and needing an update.
 
void setBlendModeOverride (optional< int > blendMode)
 Sets the blend mode override.
 
void setOpaquenessHint (bool value)
 Sets the opaqueness hint.
 
void setTranslucencyHint (bool value)
 Sets the translucency hint.
 
void update (GlRenderState &renderState, PropertyObject *object, Material &material)
 Apply changes into render state.
 

Detailed Description

GlRenderValueBinding is a binding from shaders/materials into values in GlRenderState.

Since
Kanzi 3.9.7 removed applyBlendMode(). Use getBlendModeValue() instead.
Kanzi 3.9.9 removed setBlendModeFallback().

Member Function Documentation

◆ addPropertyListener()

void kanzi::GlRenderValueBinding::addPropertyListener ( Node * node,
GlRenderState & renderState,
PropertyDataType dataType,
AbstractPropertyType propertyType,
ShaderProgram::UniformTransformation transformation )

Add a listener for given property.

Parameters
nodeNode on which to listen for property changes.
renderStateRender state to update when the property changes.
dataTypeData type of the render value.
propertyTypeProperty type to listen.
transformationShader transformation for uniform values.
Since
Kanzi 3.9.7 added dataType.

◆ attach() [1/2]

void kanzi::GlRenderValueBinding::attach ( Material & material,
Node * node,
bool readBlendModeFromNode,
GlRenderState & renderState )

Attaches to a material and a node.

When used with 2D nodes, the blend mode control is not necessarily attached to the node. This is the case when the blend mode is determined manually.

Parameters
materialMaterial to use.
nodeNode to listen property changes on or nullptr.
readBlendModeFromNodeIf you want to read the blend mode from the node, set to true.
renderStateThe render state to update on changes.
Since
Kanzi 3.9.1

◆ attach() [2/2]

void kanzi::GlRenderValueBinding::attach ( Material & material,
Node * node,
GlRenderState & renderState )
inline

Attaches to a material and a node.

Reading the blend mode from the node is enabled.

Parameters
materialMaterial to use.
nodeNode to listen property changes on or nullptr.
renderStateThe render state to update on changes.

◆ update()

void kanzi::GlRenderValueBinding::update ( GlRenderState & renderState,
PropertyObject * object,
Material & material )

Apply changes into render state.

Parameters
renderStateRender state to write changes to.
objectFallback property object for property value.
materialFallback material for property value.
Since
Kanzi 3.9.1 data type of object parameter changed from Object* to PropertyObject*.

◆ invalidate()

void kanzi::GlRenderValueBinding::invalidate ( )

Invalidates the state of the notification handler.

Use this function to invalidate a node that you destroyed before destroying the GlRenderValueBinding.

◆ setAllPropertiesDirty()

void kanzi::GlRenderValueBinding::setAllPropertiesDirty ( )

Flag all properties as being dirty and needing an update.

◆ getBlendModeValue()

optional< int > kanzi::GlRenderValueBinding::getBlendModeValue ( PropertyObject * object,
Material & material ) const

Gets the blend mode value to apply.

Kanzi uses this function internally by calling it in applyBlendMode(). You can use this function in tests.

Parameters
objectObject to use for acquiring the property.
materialCurrent material.
Since
Kanzi 3.9.7
Kanzi 3.9.9 made the function const.

◆ applyBlendMode()

void kanzi::GlRenderValueBinding::applyBlendMode ( GlRenderState & renderState,
PropertyObject * object,
Material & material )

Applies the blend mode.

Parameters
renderStateThe render state to which to write.
objectObject to use for acquiring the property.
materialCurrent material.
Since
Kanzi 3.9.1

◆ setBlendModeOverride()

void kanzi::GlRenderValueBinding::setBlendModeOverride ( optional< int > blendMode)
inline

Sets the blend mode override.

This should be the blend mode as determined by the layout system, originally coming from node.

Parameters
blendModeBlend mode override or nullopt to disable.
Since
Kanzi 3.9.1

◆ getBlendModeOverride()

optional< int > kanzi::GlRenderValueBinding::getBlendModeOverride ( ) const
inline

Gets the blend mode override.

This function is intended for tests.

Returns
Blend mode override.
Since
Kanzi 3.9.9

◆ setTranslucencyHint()

void kanzi::GlRenderValueBinding::setTranslucencyHint ( bool value)
inline

Sets the translucency hint.

Translucency hint should be set by the brush depending on the content requirements.

Parameters
valueTranslucency hint value.
Since
Kanzi 3.9.9

◆ getTranslucencyHint()

bool kanzi::GlRenderValueBinding::getTranslucencyHint ( ) const
inline

Gets the translucency hint.

This function is intended for tests.

Returns
Translucency hint value.
Since
Kanzi 3.9.9

◆ setOpaquenessHint()

void kanzi::GlRenderValueBinding::setOpaquenessHint ( bool value)
inline

Sets the opaqueness hint.

Should be set if external factors allow for opaque rendering.

Parameters
valueOpaqueness hint value.
Since
Kanzi 3.9.9

◆ getOpaquenessHint()

bool kanzi::GlRenderValueBinding::getOpaquenessHint ( ) const
inline

Gets the opaqueness hint.

This function is intended for tests.

Returns
Opaqueness hint value.
Since
Kanzi 3.9.9

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