package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.gsk/Ocgtk_gsk/Gsk/Wrappers/Shader_args_builder/index.html

Module Wrappers.Shader_args_builder

type t = [ `shader_args_builder ] Gobject.obj

An object to build the uniforms data for a `GskGLShader`.

val new_ : [ `gl_shader | `object_ ] Gobject.obj -> Glib_bytes.t option -> t

Create a new ShaderArgsBuilder

val to_args : t -> Glib_bytes.t

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.

val set_vec4 : t -> int -> Ocgtk_graphene.Graphene.Wrappers.Vec4.t -> unit

Sets the value of the uniform @idx.

The uniform must be of vec4 type.

val set_vec3 : t -> int -> Ocgtk_graphene.Graphene.Wrappers.Vec3.t -> unit

Sets the value of the uniform @idx.

The uniform must be of vec3 type.

val set_vec2 : t -> int -> Ocgtk_graphene.Graphene.Wrappers.Vec2.t -> unit

Sets the value of the uniform @idx.

The uniform must be of vec2 type.

val set_uint : t -> int -> UInt32.t -> unit

Sets the value of the uniform @idx.

The uniform must be of uint type.

val set_int : t -> int -> Int32.t -> unit

Sets the value of the uniform @idx.

The uniform must be of int type.

val set_float : t -> int -> float -> unit

Sets the value of the uniform @idx.

The uniform must be of float type.

val set_bool : t -> int -> bool -> unit

Sets the value of the uniform @idx.

The uniform must be of bool type.

val ref : t -> t

Increases the reference count of a `GskShaderArgsBuilder` by one.

val get_type : unit -> Gobject.Type.t