Gsk.ShaderArgsBuilder¶
Fields¶
None
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Gsk.ShaderArgsBuilder¶
An object to build the uniforms data for a
GskGLShader
.- classmethod new(shader, initial_values)¶
- Parameters:
shader (
Gsk.GLShader
) – aGskGLShader
initial_values (
GLib.Bytes
orNone
) – optionalGBytes
with initial values
- Returns:
The newly allocated builder, free with [method`Gsk`.ShaderArgsBuilder.unref]
- Return type:
Allocates a builder that can be used to construct a new uniform data chunk.
- ref()¶
- Returns:
the passed in
GskShaderArgsBuilder
- Return type:
Increases the reference count of a
GskShaderArgsBuilder
by one.
- set_bool(idx, value)¶
-
Sets the value of the uniform idx.
The uniform must be of bool type.
- set_float(idx, value)¶
-
Sets the value of the uniform idx.
The uniform must be of float type.
- set_int(idx, value)¶
-
Sets the value of the uniform idx.
The uniform must be of int type.
- set_uint(idx, value)¶
-
Sets the value of the uniform idx.
The uniform must be of uint type.
- set_vec2(idx, value)¶
- Parameters:
idx (
int
) – index of the uniformvalue (
Graphene.Vec2
) – value to set the uniform too
Sets the value of the uniform idx.
The uniform must be of vec2 type.
- set_vec3(idx, value)¶
- Parameters:
idx (
int
) – index of the uniformvalue (
Graphene.Vec3
) – value to set the uniform too
Sets the value of the uniform idx.
The uniform must be of vec3 type.
- set_vec4(idx, value)¶
- Parameters:
idx (
int
) – index of the uniformvalue (
Graphene.Vec4
) – value to set the uniform too
Sets the value of the uniform idx.
The uniform must be of vec4 type.
- to_args()¶
- Returns:
the newly allocated buffer with all the args added to self
- Return type:
Creates a new
GBytes
args from the current state of the given self.Any uniforms of the shader that have not been explicitly set on the self are zero-initialized.
The given
GskShaderArgsBuilder
is reset once this function returns; you cannot call this function multiple times on the same self instance.This function is intended primarily for bindings. C code should use [method`Gsk`.ShaderArgsBuilder.free_to_args].
- unref()¶
Decreases the reference count of a
GskShaderArgBuilder
by one.If the resulting reference count is zero, frees the builder.