1.19 <GskGLShaderNode>

Class: <GskGLShaderNode>

It derives from <GskRenderNode>.

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

Procedures

Method: glshader-node:get-args self ⇒ %return
Method: get-args self ⇒ %return

Gets args for the node.

self

Passed: a <GskGLShaderNode>.

a <GskRenderNode> for a gl shader

%return

Returned: a <GBytes>.

A <GBytes> with the uniform arguments

Method: glshader-node:get-child self idx ⇒ %return
Method: get-child self idx ⇒ %return

Gets one of the children.

self

Passed: a <GskGLShaderNode>.

a <GskRenderNode> for a gl shader

idx

Passed: an unsigned 32-bit integer.

the position of the child to get

%return

Returned: a <GskRenderNode>.

the idx’th child of self

Method: glshader-node:get-n-children self ⇒ %return
Method: get-n-children self ⇒ %return

Returns the number of children

self

Passed: a <GskGLShaderNode>.

a <GskRenderNode> for a gl shader

%return

Returned: an unsigned 32-bit integer.

The number of children

Method: glshader-node:get-shader self ⇒ %return
Method: get-shader self ⇒ %return

Gets shader code for the node.

self

Passed: a <GskGLShaderNode>.

a <GskRenderNode> for a gl shader

%return

Returned: a <GskGLShader>.

the GskGLShader shader

Procedure: glshader-node:new shader bounds args children ⇒ %return

Creates a <GskRenderNode> 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 Gsk.GLShader.format_args or <GskShaderArgsBuilder>.

See <GskGLShader> 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 Gsk.GLShader.compile to ensure the shader will work for the renderer before using it.

shader

Passed: a <GskGLShader>.

the GskGLShader

bounds

Passed: a <GrapheneRect>.

the rectangle to render the shader into

args

Passed: a <GBytes>.

Arguments for the uniforms

children

Passed: a list or vector, each a <GskRenderNode>, or #f.

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

%return

Returned: a <GskGLShaderNode>.

A new <GskRenderNode>

n-children

Not passed: guile-gi gives the length of children.

Length of children (currently the GL backend supports up to 4 children)