gi-gsk-4.0.4: Gsk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gsk.Structs.ShaderArgsBuilder

Description

An object to build the uniforms data for a GskGLShader.

Synopsis

Exported types

Methods

Click to display all available methods, including inherited ones

Expand

Methods

ref, toArgs, unref.

Getters

None.

Setters

setBool, setFloat, setInt, setUint, setVec2, setVec3, setVec4.

new

shaderArgsBuilderNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsGLShader a) 
=> a

shader: a GskGLShader

-> Maybe Bytes

initialValues: optional GBytes with initial values

-> m ShaderArgsBuilder

Returns: The newly allocated builder, free with shaderArgsBuilderUnref

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

ref

shaderArgsBuilderRef Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ShaderArgsBuilder

builder: a GskShaderArgsBuilder

-> m ShaderArgsBuilder

Returns: the passed in GskShaderArgsBuilder

Increases the reference count of a GskShaderArgsBuilder by one.

setBool

shaderArgsBuilderSetBool Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ShaderArgsBuilder

builder: a GskShaderArgsBuilder

-> Int32

idx: index of the uniform

-> Bool

value: value to set the uniform to

-> m () 

Sets the value of the uniform idx.

The uniform must be of bool type.

setFloat

shaderArgsBuilderSetFloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ShaderArgsBuilder

builder: a GskShaderArgsBuilder

-> Int32

idx: index of the uniform

-> Float

value: value to set the uniform to

-> m () 

Sets the value of the uniform idx.

The uniform must be of float type.

setInt

shaderArgsBuilderSetInt Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ShaderArgsBuilder

builder: a GskShaderArgsBuilder

-> Int32

idx: index of the uniform

-> Int32

value: value to set the uniform to

-> m () 

Sets the value of the uniform idx.

The uniform must be of int type.

setUint

shaderArgsBuilderSetUint Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ShaderArgsBuilder

builder: a GskShaderArgsBuilder

-> Int32

idx: index of the uniform

-> Word32

value: value to set the uniform to

-> m () 

Sets the value of the uniform idx.

The uniform must be of uint type.

setVec2

shaderArgsBuilderSetVec2 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ShaderArgsBuilder

builder: A GskShaderArgsBuilder

-> Int32

idx: index of the uniform

-> Vec2

value: value to set the uniform too

-> m () 

Sets the value of the uniform idx.

The uniform must be of vec2 type.

setVec3

shaderArgsBuilderSetVec3 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ShaderArgsBuilder

builder: a GskShaderArgsBuilder

-> Int32

idx: index of the uniform

-> Vec3

value: value to set the uniform too

-> m () 

Sets the value of the uniform idx.

The uniform must be of vec3 type.

setVec4

shaderArgsBuilderSetVec4 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ShaderArgsBuilder

builder: a GskShaderArgsBuilder

-> Int32

idx: index of the uniform

-> Vec4

value: value to set the uniform too

-> m () 

Sets the value of the uniform idx.

The uniform must be of vec4 type.

toArgs

shaderArgsBuilderToArgs Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ShaderArgsBuilder

builder: a GskShaderArgsBuilder

-> m Bytes

Returns: the newly allocated buffer with all the args added to builder

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 ShaderArgsBuilder.free_to_args().

unref

shaderArgsBuilderUnref Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ShaderArgsBuilder

builder: a GskShaderArgsBuilder

-> m () 

Decreases the reference count of a GskShaderArgBuilder by one.

If the resulting reference count is zero, frees the builder.