ShaderArgsBuilder#
- class ShaderArgsBuilder(**kwargs)#
An object to build the uniforms data for a GskGLShader.
Constructors#
- class ShaderArgsBuilder
- classmethod new(shader: GLShader, initial_values: Bytes | None = None) ShaderArgsBuilder#
Allocates a builder that can be used to construct a new uniform data chunk.
Deprecated since version 4.16:
- GTK’s new Vulkan-focused rendering
does not support this feature. Use GtkGLArea for OpenGL rendering.
- Parameters:
shader – a
GskGLShaderinitial_values – optional
GByteswith initial values
Methods#
- class ShaderArgsBuilder
- set_bool(idx: int, value: bool) None#
Sets the value of the uniform
idx.The uniform must be of bool type.
Deprecated since version 4.16:
- GTK’s new Vulkan-focused rendering
does not support this feature. Use GtkGLArea for OpenGL rendering.
- Parameters:
idx – index of the uniform
value – value to set the uniform to
- set_float(idx: int, value: float) None#
Sets the value of the uniform
idx.The uniform must be of float type.
- Parameters:
idx – index of the uniform
value – value to set the uniform to
- set_int(idx: int, value: int) None#
Sets the value of the uniform
idx.The uniform must be of int type.
Deprecated since version 4.16:
- GTK’s new Vulkan-focused rendering
does not support this feature. Use GtkGLArea for OpenGL rendering.
- Parameters:
idx – index of the uniform
value – value to set the uniform to
- set_uint(idx: int, value: int) None#
Sets the value of the uniform
idx.The uniform must be of uint type.
Deprecated since version 4.16:
- GTK’s new Vulkan-focused rendering
does not support this feature. Use GtkGLArea for OpenGL rendering.
- Parameters:
idx – index of the uniform
value – value to set the uniform to
- set_vec2(idx: int, value: Vec2) None#
Sets the value of the uniform
idx.The uniform must be of vec2 type.
Deprecated since version 4.16:
- GTK’s new Vulkan-focused rendering
does not support this feature. Use GtkGLArea for OpenGL rendering.
- Parameters:
idx – index of the uniform
value – value to set the uniform too
- set_vec3(idx: int, value: Vec3) None#
Sets the value of the uniform
idx.The uniform must be of vec3 type.
Deprecated since version 4.16:
- GTK’s new Vulkan-focused rendering
does not support this feature. Use GtkGLArea for OpenGL rendering.
- Parameters:
idx – index of the uniform
value – value to set the uniform too
- set_vec4(idx: int, value: Vec4) None#
Sets the value of the uniform
idx.The uniform must be of vec4 type.
Deprecated since version 4.16:
- GTK’s new Vulkan-focused rendering
does not support this feature. Use GtkGLArea for OpenGL rendering.
- Parameters:
idx – index of the uniform
value – value to set the uniform too
- to_args() Bytes#
Creates a new
GBytesargs from the current state of the givenbuilder.Any uniforms of the shader that have not been explicitly set on the
builderare zero-initialized.The given
GskShaderArgsBuilderis reset once this function returns; you cannot call this function multiple times on the samebuilderinstance.This function is intended primarily for bindings. C code should use
free_to_args.Deprecated since version 4.16:
- GTK’s new Vulkan-focused rendering
does not support this feature. Use GtkGLArea for OpenGL rendering.