:right-sidebar: True GLShaderNode =================================================================== .. currentmodule:: gi.repository.Gsk .. class:: GLShaderNode(*args, **kwargs) :no-contents-entry: Superclasses: :class:`~gi.repository.Gsk.RenderNode` A render node using a GL shader when drawing its children nodes. Constructors ------------ .. rst-class:: interim-class .. class:: GLShaderNode :no-index: .. classmethod:: new(shader: ~gi.repository.Gsk.GLShader, bounds: ~gi.repository.Graphene.Rect, args: ~gi.repository.GLib.Bytes, children: list[~gi.repository.Gsk.RenderNode] | None = None) -> ~gi.repository.Gsk.GLShaderNode 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 :obj:`~gi.repository.Gsk.GLShader.format_args` or :obj:`~gi.repository.Gsk.ShaderArgsBuilder`\. See :obj:`~gi.repository.Gsk.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 :obj:`~gi.repository.Gsk.GLShader.compile` to ensure the ``shader`` will work for the renderer before using it. .. deprecated:: 4.16 GTK's new Vulkan-focused rendering does not support this feature. Use `GtkGLArea <../gtk4/class.GLArea.html>`__ for OpenGL rendering. :param shader: the ``GskGLShader`` :param bounds: the rectangle to render the shader into :param args: Arguments for the uniforms :param children: array of child nodes, these will be rendered to textures and used as input. Methods ------- .. rst-class:: interim-class .. class:: GLShaderNode :no-index: .. method:: get_args() -> ~gi.repository.GLib.Bytes Gets args for the node. .. deprecated:: 4.16 GTK's new Vulkan-focused rendering does not support this feature. Use `GtkGLArea <../gtk4/class.GLArea.html>`__ for OpenGL rendering. .. method:: get_child(idx: int) -> ~gi.repository.Gsk.RenderNode Gets one of the children. .. deprecated:: 4.16 GTK's new Vulkan-focused rendering does not support this feature. Use `GtkGLArea <../gtk4/class.GLArea.html>`__ for OpenGL rendering. :param idx: the position of the child to get .. method:: get_n_children() -> int Returns the number of children .. deprecated:: 4.16 GTK's new Vulkan-focused rendering does not support this feature. Use `GtkGLArea <../gtk4/class.GLArea.html>`__ for OpenGL rendering. .. method:: get_shader() -> ~gi.repository.Gsk.GLShader Gets shader code for the node.