Package ch.bailu.gtk.gsk
Class ShaderArgsBuilder
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gsk.ShaderArgsBuilder
- All Implemented Interfaces:
PointerInterface
An object to build the uniforms data for a `GskGLShader`.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionShaderArgsBuilder
(GLShader shader, Bytes initial_values) Allocates a builder that can be used to construct a new uniform data
chunk.ShaderArgsBuilder
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionCreates a new `GBytes` args from the current state of the
given @builder, and frees the @builder instance.static ClassHandler
static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
ref()
Increases the reference count of a `GskShaderArgsBuilder` by one.void
setBool
(int idx, boolean value) Sets the value of the uniform @idx.void
setFloat
(int idx, float value) Sets the value of the uniform @idx.void
setInt
(int idx, int value) Sets the value of the uniform @idx.void
setUint
(int idx, int value) Sets the value of the uniform @idx.void
Sets the value of the uniform @idx.void
Sets the value of the uniform @idx.void
Sets the value of the uniform @idx.toArgs()
Creates a new `GBytes` args from the current state of the
given @builder.void
unref()
Decreases the reference count of a `GskShaderArgBuilder` by one.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
ShaderArgsBuilder
-
ShaderArgsBuilder
Allocates a builder that can be used to construct a new uniform data
chunk.- Parameters:
shader
- a `GskGLShader`initial_values
- optional `GBytes` with initial values
-
-
Method Details
-
getClassHandler
-
freeToArgs
Creates a new `GBytes` args from the current state of the
given @builder, and frees the @builder instance.
Any uniforms of the shader that have not been explicitly set
on the @builder are zero-initialized.- Returns:
- the newly allocated buffer with all the args added to @builder
-
ref
Increases the reference count of a `GskShaderArgsBuilder` by one.- Returns:
- the passed in `GskShaderArgsBuilder`
-
setBool
public void setBool(int idx, boolean value) Sets the value of the uniform @idx.
The uniform must be of bool type.- Parameters:
idx
- index of the uniformvalue
- value to set the uniform to
-
setFloat
public void setFloat(int idx, float value) Sets the value of the uniform @idx.
The uniform must be of float type.- Parameters:
idx
- index of the uniformvalue
- value to set the uniform to
-
setInt
public void setInt(int idx, int value) Sets the value of the uniform @idx.
The uniform must be of int type.- Parameters:
idx
- index of the uniformvalue
- value to set the uniform to
-
setUint
public void setUint(int idx, int value) Sets the value of the uniform @idx.
The uniform must be of uint type.- Parameters:
idx
- index of the uniformvalue
- value to set the uniform to
-
setVec2
Sets the value of the uniform @idx.
The uniform must be of vec2 type.- Parameters:
idx
- index of the uniformvalue
- value to set the uniform too
-
setVec3
Sets the value of the uniform @idx.
The uniform must be of vec3 type.- Parameters:
idx
- index of the uniformvalue
- value to set the uniform too
-
setVec4
Sets the value of the uniform @idx.
The uniform must be of vec4 type.- Parameters:
idx
- index of the uniformvalue
- value to set the uniform too
-
toArgs
Creates a new `GBytes` args from the current state of the
given @builder.
Any uniforms of the shader that have not been explicitly set on
the @builder are zero-initialized.
The given `GskShaderArgsBuilder` is reset once this function returns;
you cannot call this function multiple times on the same @builder instance.
This function is intended primarily for bindings. C code should use
[method@Gsk.ShaderArgsBuilder.free_to_args].- Returns:
- the newly allocated buffer with all the args added to @builder
-
unref
public void unref()Decreases the reference count of a `GskShaderArgBuilder` by one.
If the resulting reference count is zero, frees the builder. -
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-