Package org.gnome.gsk
Class GLShaderNode
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gsk.RenderNode
org.gnome.gsk.GLShaderNode
-
Nested Class Summary
Nested classes/interfaces inherited from class org.gnome.gsk.RenderNode
RenderNode.RenderNodeImpl
-
Constructor Summary
ConstructorDescriptionGLShaderNode
(MemorySegment address) Create a GLShaderNode proxy instance for the provided memory address.GLShaderNode
(GLShader shader, Rect bounds, Bytes args, @Nullable RenderNode[] children) Deprecated.GTK's new Vulkan-focused rendering does not support this feature. -
Method Summary
Modifier and TypeMethodDescriptionprotected GLShaderNode
asParent()
Returns this instance as if it were its parent type.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.int
Deprecated.GTK's new Vulkan-focused rendering does not support this feature.Gets shader code for the node.static Type
getType()
Get the GType of the GLShaderNode classMethods inherited from class org.gnome.gsk.RenderNode
deserialize, draw, getBounds, getNodeType, getOpaqueRect, ref, serialize, unref, writeToFile
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getMemoryLayout, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
GLShaderNode
Create a GLShaderNode proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
GLShaderNode
@Deprecated public GLShaderNode(GLShader shader, Rect bounds, Bytes args, @Nullable @Nullable RenderNode[] children) Deprecated.GTK's new Vulkan-focused rendering does not support this feature. Use GtkGLArea for OpenGL rendering.Creates aGskRenderNode
that will render the givenshader
into the area given bybounds
.The
args
is a block of data to use for uniform input, as per types and offsets defined by theshader
. Normally this is generated byGLShader.formatArgs(java.lang.Object...)
orGsk.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(org.gnome.gsk.Renderer)
to ensure theshader
will work for the renderer before using it.- Parameters:
shader
- theGskGLShader
bounds
- 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
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type.- Overrides:
asParent
in classRenderNode
-
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.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.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
-