GLShaderNode#
- class GLShaderNode(*args, **kwargs)#
Superclasses: RenderNode
A render node using a GL shader when drawing its children nodes.
Constructors#
- class GLShaderNode
- classmethod new(shader: GLShader, bounds: Rect, args: Bytes, children: list[RenderNode] | None = None) GLShaderNode#
Creates a
GskRenderNodethat will render the givenshaderinto the area given bybounds.The
argsis a block of data to use for uniform input, as per types and offsets defined by theshader. Normally this is generated byformat_argsorShaderArgsBuilder.See
GLShaderfor 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
compileto ensure theshaderwill work for the renderer before using it.Deprecated since version 4.16:
- GTK’s new Vulkan-focused rendering
does not support this feature. Use GtkGLArea for OpenGL rendering.
- Parameters:
shader – the
GskGLShaderbounds – 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.
Methods#
- class GLShaderNode
- get_args() Bytes#
Gets args for the node.
Deprecated since version 4.16:
- GTK’s new Vulkan-focused rendering
does not support this feature. Use GtkGLArea for OpenGL rendering.
- get_child(idx: int) RenderNode#
Gets one of the children.
Deprecated since version 4.16:
- GTK’s new Vulkan-focused rendering
does not support this feature. Use GtkGLArea for OpenGL rendering.
- Parameters:
idx – the position of the child to get