Class GLShaderNode

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class GLShaderNode extends RenderNode
A render node using a GL shader when drawing its children nodes.
  • Constructor Details

    • GLShaderNode

      public GLShaderNode(MemorySegment address)
      Create a GLShaderNode instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • GLShaderNode

      @Deprecated public GLShaderNode(GLShader shader, Rect bounds, byte[] args, @Nullable RenderNode @Nullable [] children)
      Deprecated.
      GTK's new Vulkan-focused rendering does not support this feature. Use GtkGLArea for OpenGL rendering.

      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 GLShader.formatArgs(Object...) or Gsk.ShaderArgsBuilder.

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

      Parameters:
      shader - the GskGLShader
      bounds - 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.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the GLShaderNode class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected GLShaderNode asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class RenderNode
      Returns:
      the instance as if it were its parent type
    • getArgs

      @Deprecated public byte[] getArgs()
      Deprecated.
      GTK's new Vulkan-focused rendering does not support this feature. Use GtkGLArea for OpenGL rendering.
      Gets args for the node.
      Returns:
      A GBytes with the uniform arguments
    • getChild

      @Deprecated public RenderNode getChild(int idx)
      Deprecated.
      GTK's new Vulkan-focused rendering does not support this feature. Use GtkGLArea for OpenGL rendering.
      Gets one of the children.
      Parameters:
      idx - the position of the child to get
      Returns:
      the idx'th child of this GLShaderNode
    • getNChildren

      @Deprecated public int getNChildren()
      Deprecated.
      GTK's new Vulkan-focused rendering does not support this feature. Use GtkGLArea for OpenGL rendering.
      Returns the number of children
      Returns:
      The number of children
    • getShader

      public GLShader getShader()
      Gets shader code for the node.
      Returns:
      the GskGLShader shader