Gnome::Gsk4::N-ShaderArgsBuilder
Description
An object to build the uniforms data for a Gnome::Gsk4::GLShader.
Class initialization
new
:native-object
Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object :$native-object! )
new-shaderargsbuilder
Allocates a builder that can be used to construct a new uniform data chunk.
method new-shaderargsbuilder ( N-Object() $shader, N-Object $initial-values --> Gnome::Gsk4::ShaderArgsBuilder \)
$shader; a Gnome::Gsk4::GLShader.
$initial-values; optional Gnome::Glib::N-Bytes with initial values
Methods
free-to-args
Creates a new Gnome::Glib::N-Bytes 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.
method free-to-args (--> N-Object )
Return value; the newly allocated buffer with all the args added to $builder
.
ref
Increases the reference count of a Gnome::Gsk4::N-ShaderArgsBuilder by one.
method ref (--> N-Object )
Return value; the passed in Gnome::Gsk4::N-ShaderArgsBuilder.
set-bool
Sets the value of the uniform $idx
.
The uniform must be of bool type.
method set-bool ( Int() $idx, Bool() $value )
$idx; index of the uniform.
$value; value to set the uniform to.
set-float
Sets the value of the uniform $idx
.
The uniform must be of float type.
method set-float ( Int() $idx, Num() $value )
$idx; index of the uniform.
$value; value to set the uniform to.
set-int
Sets the value of the uniform $idx
.
The uniform must be of int type.
method set-int ( Int() $idx, Int() $value )
$idx; index of the uniform.
$value; value to set the uniform to.
set-uint
Sets the value of the uniform $idx
.
The uniform must be of uint type.
method set-uint ( Int() $idx, UInt() $value )
$idx; index of the uniform.
$value; value to set the uniform to.
set-vec2
Sets the value of the uniform $idx
.
The uniform must be of vec2 type.
method set-vec2 ( Int() $idx, N-Object $value )
$idx; index of the uniform.
$value; value to set the uniform too
set-vec3
Sets the value of the uniform $idx
.
The uniform must be of vec3 type.
method set-vec3 ( Int() $idx, N-Object $value )
$idx; index of the uniform.
$value; value to set the uniform too
set-vec4
Sets the value of the uniform $idx
.
The uniform must be of vec4 type.
method set-vec4 ( Int() $idx, N-Object $value )
$idx; index of the uniform.
$value; value to set the uniform too
to-args
Creates a new Gnome::Glib::N-Bytes 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 Gnome::Gsk4::N-ShaderArgsBuilder 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 .free-to-args()
.
method to-args (--> N-Object )
Return value; the newly allocated buffer with all the args added to $builder
.
unref
Decreases the reference count of a GskShaderArgBuilder by one.
If the resulting reference count is zero, frees the builder.
method unref ( )