Kanzi  3.9.4
Kanzi Engine API
kanzi::MaterialBrushRenderer Class Reference

Material brush renderer. More...

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

Inheritance diagram for kanzi::MaterialBrushRenderer:
[legend]

Public Member Functions

void bind (Renderer3D &renderer, Object *object)
 Bind material brush using a specific object as opposed to the brush. More...
 
GlRenderStategetRenderState ()
 Access render state. More...
 
void invalidateRenderValues ()
 Invalidate all render values. More...
 
- Public Member Functions inherited from kanzi::GlBrushRenderer
MaterialSharedPtr acquireErrorMaterial ()
 Acquire error material for rendering. More...
 
 GlBrushRenderer (Brush *brush, Node *node)
 Constructor. More...
 
 ~GlBrushRenderer () override
 Destructor. More...
 
- Public Member Functions inherited from kanzi::BrushRenderer
void bind (Renderer3D &renderer)
 Bind brush renderer for rendering. More...
 
void draw (Renderer &renderer, const Geometry &quad, const Matrix4x4 &transform)
 Draw a brush using given quad. More...
 
void draw (Renderer &renderer, const Geometry &quad, const Matrix3x3 &transform)
 Overload for draw a brush using given quad. More...
 
int getBlendModeValue ()
 Gets the last used blend mode value. More...
 
BrushgetBrush () const
 Access brush. More...
 
TextureSharedPtr getContentTexture () const
 Access content texture. More...
 
NodegetNode () const
 Gets the attached node. More...
 
unsigned int getPropertyChangeCounter () const
 Access property change counter. More...
 
RenderMode getRenderMode () const
 Get currently selected render mode. More...
 
float getRenderOpacity () const
 Access opacity. More...
 
bool hasRenderMode () const
 Indicates whether a valid render mode is selected. More...
 
void restoreResources ()
 Restore resources after sleep. More...
 
void setContentTexture (TextureSharedPtr texture)
 Set a content texture. More...
 
void setRenderOpacity (float opacity)
 Set opacity to use for next attach. More...
 
void updateRender (optional< int > blendMode, bool forceOpaque, bool translucencyHint)
 Called from Node2D::updateRender(). More...
 
virtual ~BrushRenderer ()=default
 Destructor. More...
 

Static Public Member Functions

static BrushRendererPtr create (Brush *brush, Node *node)
 Create a new shader brush renderer. More...
 

Protected Member Functions

void bindOverride (Renderer3D &renderer) override
 BrushRenderer::bindOverride() implementation. More...
 
void drawOverride (Renderer &renderer, const Geometry &quad, const Matrix4x4 &transform) override
 BrushRenderer::drawOverride() implementation. More...
 
int getBlendModeValueOverride () override
 BrushRenderer::getBlendModeValueOverride() implementation. More...
 
MaterialSharedPtr getMaterial () override
 Get currently set material for the renderer. More...
 
bool isChangeCounterSame (Material &material) const
 Check if property change counter matches that of the brush. More...
 
 MaterialBrushRenderer (Brush *brush, Node *node)
 Constructor. More...
 
void restoreResourcesOverride () override
 BrushRenderer::restoreResourcesOverride() implementation. More...
 
void updateChangeCounter (Material &material)
 Update property change counter to match brush. More...
 
void updateRenderOverride (optional< int > blendMode, bool forceOpaque, bool translucencyHint) override
 BrushRenderer::updateRenderOverride() implementation. More...
 
- Protected Member Functions inherited from kanzi::BrushRenderer
 BrushRenderer (Brush *brush, Node *node)
 Constructor. More...
 
bool isChangeCounterSame () const
 Checks whether the property change counter matches that of the brush. More...
 
void setRenderMode (RenderMode selection)
 Set render mode. More...
 
void updateChangeCounter ()
 Updates property change counter to match the counter value from brush. More...
 

Additional Inherited Members

- Public Types inherited from kanzi::BrushRenderer
enum  RenderMode { RenderModeNone, RenderModeContent, RenderModeNoContent }
 Enum signifying currently selected render mode. More...
 
- Protected Attributes inherited from kanzi::BrushRenderer
Brushm_brush
 Brush attached to. More...
 
unsigned int m_brushPropertyChangeCounter
 Property change counter to track brush. More...
 
TextureSharedPtr m_contentTexture
 Content texture provided to the brush renderer from outside, e.g. from Node2D. More...
 
Nodem_node
 Node attached to. More...
 
RenderMode m_renderMode
 Currently used render mode (or none if not selected). More...
 
float m_renderOpacity
 Opacity to issue on attach. More...
 

Detailed Description

Material brush renderer.

Since
Kanzi 3.9.1 changed to use KANZI_COREUI_API.

Constructor & Destructor Documentation

◆ MaterialBrushRenderer()

kanzi::MaterialBrushRenderer::MaterialBrushRenderer ( Brush brush,
Node node 
)
inlineexplicitprotected

Constructor.

Parameters
brushBrush to use.
nodeNode to attach to.

Member Function Documentation

◆ create()

static BrushRendererPtr kanzi::MaterialBrushRenderer::create ( Brush brush,
Node node 
)
static

Create a new shader brush renderer.

Parameters
brushBrush to use.
nodeNode to attach to.

◆ bind()

void kanzi::MaterialBrushRenderer::bind ( Renderer3D renderer,
Object object 
)

Bind material brush using a specific object as opposed to the brush.

◆ getRenderState()

GlRenderState& kanzi::MaterialBrushRenderer::getRenderState ( )
inline

Access render state.

Returns
Reference to containded render state.

◆ invalidateRenderValues()

void kanzi::MaterialBrushRenderer::invalidateRenderValues ( )
inline

Invalidate all render values.

◆ drawOverride()

void kanzi::MaterialBrushRenderer::drawOverride ( Renderer renderer,
const Geometry quad,
const Matrix4x4 transform 
)
overrideprotectedvirtual

◆ restoreResourcesOverride()

void kanzi::MaterialBrushRenderer::restoreResourcesOverride ( )
overrideprotectedvirtual

◆ updateRenderOverride()

void kanzi::MaterialBrushRenderer::updateRenderOverride ( optional< int >  blendMode,
bool  forceOpaque,
bool  translucencyHint 
)
overrideprotectedvirtual

◆ getBlendModeValueOverride()

int kanzi::MaterialBrushRenderer::getBlendModeValueOverride ( )
overrideprotectedvirtual

◆ bindOverride()

void kanzi::MaterialBrushRenderer::bindOverride ( Renderer3D renderer)
overrideprotectedvirtual

◆ isChangeCounterSame()

bool kanzi::MaterialBrushRenderer::isChangeCounterSame ( Material material) const
inlineprotected

Check if property change counter matches that of the brush.

Parameters
materialMaterial currently used.
Returns
True if matches and no update is necessary, false otherwise.

◆ updateChangeCounter()

void kanzi::MaterialBrushRenderer::updateChangeCounter ( Material material)
inlineprotected

Update property change counter to match brush.

Parameters
materialMaterial currently used.

◆ getMaterial()

MaterialSharedPtr kanzi::MaterialBrushRenderer::getMaterial ( )
inlineoverrideprotectedvirtual

Get currently set material for the renderer.

Reimplemented from kanzi::BrushRenderer.


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