Class GLShaderNode
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gsk.RenderNode
org.gnome.gsk.GLShaderNode
- All Implemented Interfaces:
Proxy
A render node using a GL shader when drawing its children nodes.
-
Nested Class Summary
Nested classes/interfaces inherited from class RenderNode
RenderNode.RenderNode$Impl -
Constructor Summary
ConstructorsConstructorDescriptionGLShaderNode(MemorySegment address) Create a GLShaderNode instance for the provided memory address.GLShaderNode(GLShader shader, Rect bounds, byte[] args, @Nullable RenderNode @Nullable [] children) Deprecated.GTK's new Vulkan-focused rendering does not support this feature. -
Method Summary
Modifier and TypeMethodDescriptionprotected GLShaderNodeasParent()Return this instance as if it were its parent type.byte[]getArgs()Deprecated.GTK's new Vulkan-focused rendering does not support this feature.getChild(int idx) Deprecated.GTK's new Vulkan-focused rendering does not support this feature.static MemoryLayoutThe memory layout of the native struct.intDeprecated.GTK's new Vulkan-focused rendering does not support this feature.Gets shader code for the node.static @Nullable TypegetType()Get the GType of the GLShaderNode class.Methods inherited from class RenderNode
deserialize, draw, getBounds, getChildren, getNodeType, getOpaqueRect, ref, serialize, unref, writeToFileMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
GLShaderNode
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
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 byGLShader.formatArgs(Object...)orGsk.ShaderArgsBuilder.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
GLShader.compile(Renderer)to ensure theshaderwill work for the renderer before using it.- Parameters:
shader- theGskGLShaderbounds- the rectangle to render the shader intoargs- Arguments for the uniformschildren- array of child nodes, these will be rendered to textures and used as input.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code.- Overrides:
asParentin classRenderNode- Returns:
- the instance as if it were its parent type
-
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
GByteswith the uniform arguments
-
getChild
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'thchild of this GLShaderNode
-
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
-