Constructor

GskGLShaderNodenew

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

 The data is owned by the caller of the function.
bounds graphene_rect_t
 

The rectangle to render the shader into.

 The data is owned by the caller of the function.
args GBytes
 

Arguments for the uniforms.

 The data is owned by the caller of the function.
children An array of GskRenderNode*
 

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

 The argument can be NULL.
 The length of the array is specified in the n_children argument.
 The data is owned by the caller of the function.
n_children guint
 

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

Return value

Returns: GskGLShaderNode
 

A new GskRenderNode

 The caller of the function takes ownership of the data, and is responsible for freeing it.