Gnome::Gsk4::GLShaderNode

#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------

Description

A render node using a GL shader when drawing its children nodes.

#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------

Class initialization

new

:native-object

Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object() :$native-object! )

#-------------------------------------------------------------------------------

new-glshadernode

Creates a Gnome::Gsk4::RenderNode that will render the given $shader into the area given by $bounds.

The $args is a block of data to use for uniform input, as per types and offsets defined by the $shader. Normally this is generated by .format-args() in class Gnome::Gsk4::GLShader or Gnome::Gsk4::N-ShaderArgsBuilder .

See Gnome::Gsk4::GLShader for details about how the shader should be written.

All the children will be rendered into textures (if they aren't already GskTextureNodes, which will be used directly). These textures will be sent as input to the shader.

If the renderer doesn't support GL shaders, or if there is any problem when compiling the shader, then the node will draw pink. You should use .compile() in class Gnome::Gsk4::GLShader to ensure the $shader will work for the renderer before using it.

method new-glshadernode ( N-Object() $shader, N-Object $bounds, N-Object $args, N-Object() $children, UInt() $n-children --> Gnome::Gsk4::GLShaderNode \)
  • $shader; the Gnome::Gsk4::GLShader.

  • $bounds; the rectangle to render the shader into

  • $args; Arguments for the uniforms

  • $children; array of child nodes, these will be rendered to textures and used as input..

  • $n-children; Length of $children (currenly the GL backend supports up to 4 children).

#------------------------------------------------------------------------------- #--[Methods]-------------------------------------------------------------------- #-------------------------------------------------------------------------------

Methods

#-------------------------------------------------------------------------------

get-args

Gets args for the node.

method get-args (--> N-Object )

Return value; A Gnome::Glib::N-Bytes with the uniform arguments.

#-------------------------------------------------------------------------------

get-child

Gets one of the children.

method get-child ( UInt() $idx --> N-Object )
  • $idx; the position of the child to get.

Return value; the $idx'th child of $node.

#-------------------------------------------------------------------------------

get-n-children

Returns the number of children

method get-n-children (--> UInt )

Return value; The number of children.

#-------------------------------------------------------------------------------

get-shader

Gets shader code for the node.

method get-shader (--> N-Object )

Return value; the Gnome::Gsk4::GLShader shader.

Gnome::Gsk4 v0.2.0

GSK is the rendering and scene graph API

Authors

  • Marcel Timmerman

License

Artistic-2.0

Dependencies

Gnome::Gdk4:api<2>Gnome::Graphene:api<2>Gnome::GObject:api<2>Gnome::Glib:api<2>Gnome::N:api<2>

Test Dependencies

Provides

  • Gnome::Gsk4::BlendNode
  • Gnome::Gsk4::BlurNode
  • Gnome::Gsk4::BorderNode
  • Gnome::Gsk4::CairoNode
  • Gnome::Gsk4::CairoRenderer
  • Gnome::Gsk4::ClipNode
  • Gnome::Gsk4::ColorMatrixNode
  • Gnome::Gsk4::ColorNode
  • Gnome::Gsk4::ConicGradientNode
  • Gnome::Gsk4::ContainerNode
  • Gnome::Gsk4::CrossFadeNode
  • Gnome::Gsk4::DebugNode
  • Gnome::Gsk4::GLRenderer
  • Gnome::Gsk4::GLShader
  • Gnome::Gsk4::GLShaderNode
  • Gnome::Gsk4::InsetShadowNode
  • Gnome::Gsk4::LinearGradientNode
  • Gnome::Gsk4::MaskNode
  • Gnome::Gsk4::N-RoundedRect
  • Gnome::Gsk4::N-ShaderArgsBuilder
  • Gnome::Gsk4::N-Transform
  • Gnome::Gsk4::OpacityNode
  • Gnome::Gsk4::OutsetShadowNode
  • Gnome::Gsk4::RadialGradientNode
  • Gnome::Gsk4::RenderNode
  • Gnome::Gsk4::Renderer
  • Gnome::Gsk4::RepeatNode
  • Gnome::Gsk4::RepeatingLinearGradientNode
  • Gnome::Gsk4::RepeatingRadialGradientNode
  • Gnome::Gsk4::RoundedClipNode
  • Gnome::Gsk4::ShadowNode
  • Gnome::Gsk4::T-enums
  • Gnome::Gsk4::T-glshader
  • Gnome::Gsk4::T-path
  • Gnome::Gsk4::T-rendernode
  • Gnome::Gsk4::T-roundedrect
  • Gnome::Gsk4::T-stroke
  • Gnome::Gsk4::T-transform
  • Gnome::Gsk4::T-types
  • Gnome::Gsk4::TextNode
  • Gnome::Gsk4::TextureNode
  • Gnome::Gsk4::TextureScaleNode
  • Gnome::Gsk4::TransformNode

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.