gi-gsk-4.0.9: Gsk bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gsk.Structs.ShaderArgsBuilder

Contents

- Exported types
- Methods
  - new
  - ref
  - setBool
  - setFloat
  - setInt
  - setUint
  - setVec2
  - setVec3
  - setVec4
  - toArgs
  - unref

Description

Builds the uniforms data for a `GskGLShader`.

Synopsis

- newtype ShaderArgsBuilder = ShaderArgsBuilder (ManagedPtr ShaderArgsBuilder)
- shaderArgsBuilderNew :: (HasCallStack, MonadIO m, IsGLShader a) => a -> Maybe Bytes -> m ShaderArgsBuilder
- shaderArgsBuilderRef :: (HasCallStack, MonadIO m) => ShaderArgsBuilder -> m ShaderArgsBuilder
- shaderArgsBuilderSetBool :: (HasCallStack, MonadIO m) => ShaderArgsBuilder -> Int32 -> Bool -> m ()
- shaderArgsBuilderSetFloat :: (HasCallStack, MonadIO m) => ShaderArgsBuilder -> Int32 -> Float -> m ()
- shaderArgsBuilderSetInt :: (HasCallStack, MonadIO m) => ShaderArgsBuilder -> Int32 -> Int32 -> m ()
- shaderArgsBuilderSetUint :: (HasCallStack, MonadIO m) => ShaderArgsBuilder -> Int32 -> Word32 -> m ()
- shaderArgsBuilderSetVec2 :: (HasCallStack, MonadIO m) => ShaderArgsBuilder -> Int32 -> Vec2 -> m ()
- shaderArgsBuilderSetVec3 :: (HasCallStack, MonadIO m) => ShaderArgsBuilder -> Int32 -> Vec3 -> m ()
- shaderArgsBuilderSetVec4 :: (HasCallStack, MonadIO m) => ShaderArgsBuilder -> Int32 -> Vec4 -> m ()
- shaderArgsBuilderToArgs :: (HasCallStack, MonadIO m) => ShaderArgsBuilder -> m Bytes
- shaderArgsBuilderUnref :: (HasCallStack, MonadIO m) => ShaderArgsBuilder -> m ()

# Exported types

newtype ShaderArgsBuilder Source #

Memory-managed wrapper type.

Constructors

ShaderArgsBuilder (ManagedPtr ShaderArgsBuilder) |

#### Instances

Instances details

Eq ShaderArgsBuilder Source # |
Instance details Defined in GI.Gsk.Structs.ShaderArgsBuilder Methods (==) :: ShaderArgsBuilder -> ShaderArgsBuilder -> Bool Source # (/=) :: ShaderArgsBuilder -> ShaderArgsBuilder -> Bool Source #
GBoxed ShaderArgsBuilder Source # |
Instance details Defined in GI.Gsk.Structs.ShaderArgsBuilder
ManagedPtrNewtype ShaderArgsBuilder Source # |
Instance details Defined in GI.Gsk.Structs.ShaderArgsBuilder Methods toManagedPtr :: ShaderArgsBuilder -> ManagedPtr ShaderArgsBuilder Source #
TypedObject ShaderArgsBuilder Source # |
Instance details Defined in GI.Gsk.Structs.ShaderArgsBuilder Methods glibType :: IO GType Source #
HasParentTypes ShaderArgsBuilder Source # |
Instance details Defined in GI.Gsk.Structs.ShaderArgsBuilder
IsGValue (Maybe ShaderArgsBuilder) Source # | Convert `ShaderArgsBuilder` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gsk.Structs.ShaderArgsBuilder Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe ShaderArgsBuilder -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe ShaderArgsBuilder) Source #
type ParentTypes ShaderArgsBuilder Source # |
Instance details Defined in GI.Gsk.Structs.ShaderArgsBuilder type ParentTypes ShaderArgsBuilder = '[] :: [Type]

# 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`

Deprecated: (Since version 4.16)GTK's new Vulkan-focused renderingdoes not support this feature. Use GtkGLAreafor OpenGL rendering.

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`

Deprecated: (Since version 4.16)GTK's new Vulkan-focused renderingdoes not support this feature. Use GtkGLAreafor OpenGL rendering.

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 () |

Deprecated: (Since version 4.16)GTK's new Vulkan-focused renderingdoes not support this feature. Use GtkGLAreafor OpenGL rendering.

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 () |

Deprecated: (Since version 4.16)GTK's new Vulkan-focused renderingdoes not support this feature. Use GtkGLAreafor OpenGL rendering.

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 () |

Deprecated: (Since version 4.16)GTK's new Vulkan-focused renderingdoes not support this feature. Use GtkGLAreafor OpenGL rendering.

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 () |

Deprecated: (Since version 4.16)GTK's new Vulkan-focused renderingdoes not support this feature. Use GtkGLAreafor OpenGL rendering.

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 () |

Deprecated: (Since version 4.16)GTK's new Vulkan-focused renderingdoes not support this feature. Use GtkGLAreafor OpenGL rendering.

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 () |

Deprecated: (Since version 4.16)GTK's new Vulkan-focused renderingdoes not support this feature. Use GtkGLAreafor OpenGL rendering.

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`

Deprecated: (Since version 4.16)GTK's new Vulkan-focused renderingdoes not support this feature. Use GtkGLAreafor OpenGL rendering.

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 () |

Deprecated: (Since version 4.16)GTK's new Vulkan-focused renderingdoes not support this feature. Use GtkGLAreafor OpenGL rendering.

Decreases the reference count of a `GskShaderArgBuilder` by one.

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