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< int > | getBlendModeOverride () const |
| Gets the blend mode override. | |
| optional< int > | getBlendModeValue (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. | |
GlRenderValueBinding is a binding from shaders/materials into values in GlRenderState.
| void kanzi::GlRenderValueBinding::addPropertyListener | ( | Node * | node, |
| GlRenderState & | renderState, | ||
| PropertyDataType | dataType, | ||
| AbstractPropertyType | propertyType, | ||
| ShaderProgram::UniformTransformation | transformation ) |
Add a listener for given property.
| node | Node on which to listen for property changes. |
| renderState | Render state to update when the property changes. |
| dataType | Data type of the render value. |
| propertyType | Property type to listen. |
| transformation | Shader transformation for uniform values. |
dataType. | 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.
| material | Material to use. |
| node | Node to listen property changes on or nullptr. |
| readBlendModeFromNode | If you want to read the blend mode from the node, set to true. |
| renderState | The render state to update on changes. |
|
inline |
| void kanzi::GlRenderValueBinding::update | ( | GlRenderState & | renderState, |
| PropertyObject * | object, | ||
| Material & | material ) |
Apply changes into render state.
| renderState | Render state to write changes to. |
| object | Fallback property object for property value. |
| material | Fallback material for property value. |
object parameter changed from Object* to PropertyObject*. | 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.
| void kanzi::GlRenderValueBinding::setAllPropertiesDirty | ( | ) |
Flag all properties as being dirty and needing an update.
| 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.
| object | Object to use for acquiring the property. |
| material | Current material. |
| void kanzi::GlRenderValueBinding::applyBlendMode | ( | GlRenderState & | renderState, |
| PropertyObject * | object, | ||
| Material & | material ) |
Applies the blend mode.
| renderState | The render state to which to write. |
| object | Object to use for acquiring the property. |
| material | Current material. |
Sets the blend mode override.
This should be the blend mode as determined by the layout system, originally coming from node.
| blendMode | Blend mode override or nullopt to disable. |
|
inline |
Gets the blend mode override.
This function is intended for tests.
Sets the translucency hint.
Translucency hint should be set by the brush depending on the content requirements.
| value | Translucency hint value. |
|
inline |
Gets the translucency hint.
This function is intended for tests.
Sets the opaqueness hint.
Should be set if external factors allow for opaque rendering.
| value | Opaqueness hint value. |
|
inline |
Gets the opaqueness hint.
This function is intended for tests.