Constructor

Gsk.GLShaderNode.new

Declaration [src]

GskRenderNode*
gsk_gl_shader_node_new (
  GskGLShader* shader,
  const graphene_rect_t* bounds,
  GBytes* args,
  GskRenderNode** children,
  guint n_children
)

Description [src]

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_gl_shader_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_gl_shader_compile() to ensure the shader will work for the renderer before using it.

Parameters

shader GskGLShader
 

the GskGLShader

 Ownership is not transferred to the callee
bounds const graphene_rect_t*
 

the rectangle to render the shader into

 Ownership is not transferred to the callee
args GBytes*
 

Arguments for the uniforms

 Ownership is not transferred to the callee
children An array of GskRenderNode
 

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

 The length of the array is in the n_children argument
 Ownership is not transferred to the callee
n_children guint
 

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

Return value

Returns: GskGLShaderNode

A new GskRenderNode

Ownership of the data is transferred to the caller