Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GskShaderArgsBuilder

[12:7] extends: object

Builds the uniforms data for a GskGLShader.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GskShaderArgsBuilder (shader = null, initial_values = null)

    Allocates a builder that can be used to construct a new uniform data chunk.

    • @p shader is a GskGLShader.
    • @p initial_values is optional GBytes with initial values.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • free_to_args ()

    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.

    • @r the newly allocated buffer with all the args added to @builder.
  • ref ()

    Increases the reference count of a GskShaderArgsBuilder by one.

    • @r the passed in GskShaderArgsBuilder.
  • set_bool (int idx, bool value)

    Sets the value of the uniform @idx. The uniform must be of bool type.

    • @p idx is index of the uniform.
    • @p value is value to set the uniform to.
    • @r None.
  • set_float (int idx, double value)

    Sets the value of the uniform @idx. The uniform must be of float type.

    • @p idx is index of the uniform.
    • @p value is value to set the uniform to.
    • @r None.
  • set_int (int idx, int value)

    Sets the value of the uniform @idx. The uniform must be of int type.

    • @p idx is index of the uniform.
    • @p value is value to set the uniform to.
    • @r None.
  • set_uint (int idx, int value)

    Sets the value of the uniform @idx. The uniform must be of uint type.

    • @p idx is index of the uniform.
    • @p value is value to set the uniform to.
    • @r None.
  • set_vec2 (int idx, object value)

    Sets the value of the uniform @idx. The uniform must be of vec2 type.

    • @p idx is index of the uniform.
    • @p value is value to set the uniform too.
    • @r None.
  • set_vec3 (int idx, object value)

    Sets the value of the uniform @idx. The uniform must be of vec3 type.

    • @p idx is index of the uniform.
    • @p value is value to set the uniform too.
    • @r None.
  • set_vec4 (int idx, object value)

    Sets the value of the uniform @idx. The uniform must be of vec4 type.

    • @p idx is index of the uniform.
    • @p value is value to set the uniform too.
    • @r None.
  • to_args ()

    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].
    • @r 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.

    • @r None.