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.Objects.GLShaderNode

Contents

- Exported types
- Methods
  - getArgs
  - getChild
  - getNChildren
  - getShader
  - new

Description

A render node using a GL shader when drawing its children nodes.

Synopsis

- newtype GLShaderNode = GLShaderNode (ManagedPtr GLShaderNode)
- class (BoxedPtr o, TypedObject o, IsDescendantOf GLShaderNode o) => IsGLShaderNode o
- toGLShaderNode :: (MonadIO m, IsGLShaderNode o) => o -> m GLShaderNode
- gLShaderNodeGetArgs :: (HasCallStack, MonadIO m, IsGLShaderNode a) => a -> m Bytes
- gLShaderNodeGetChild :: (HasCallStack, MonadIO m, IsGLShaderNode a) => a -> Word32 -> m RenderNode
- gLShaderNodeGetNChildren :: (HasCallStack, MonadIO m, IsGLShaderNode a) => a -> m Word32
- gLShaderNodeGetShader :: (HasCallStack, MonadIO m, IsGLShaderNode a) => a -> m GLShader
- gLShaderNodeNew :: (HasCallStack, MonadIO m, IsGLShader a) => a -> Rect -> Bytes -> Maybe [RenderNode] -> m GLShaderNode

# Exported types

newtype GLShaderNode Source #

Memory-managed wrapper type.

Constructors

GLShaderNode (ManagedPtr GLShaderNode) |

#### Instances

Instances details

Eq GLShaderNode Source # |
Instance details Defined in GI.Gsk.Objects.GLShaderNode Methods (==) :: GLShaderNode -> GLShaderNode -> Bool Source # (/=) :: GLShaderNode -> GLShaderNode -> Bool Source #
BoxedPtr GLShaderNode Source # |
Instance details Defined in GI.Gsk.Objects.GLShaderNode Methods boxedPtrCopy :: GLShaderNode -> IO GLShaderNode Source # boxedPtrFree :: GLShaderNode -> IO () Source #
ManagedPtrNewtype GLShaderNode Source # |
Instance details Defined in GI.Gsk.Objects.GLShaderNode Methods toManagedPtr :: GLShaderNode -> ManagedPtr GLShaderNode Source #
TypedObject GLShaderNode Source # |
Instance details Defined in GI.Gsk.Objects.GLShaderNode Methods glibType :: IO GType Source #
HasParentTypes GLShaderNode Source # |
Instance details Defined in GI.Gsk.Objects.GLShaderNode
type ParentTypes GLShaderNode Source # |
Instance details Defined in GI.Gsk.Objects.GLShaderNode type ParentTypes GLShaderNode = '[RenderNode]

class (BoxedPtr o, TypedObject o, IsDescendantOf GLShaderNode o) => IsGLShaderNode o Source #

Type class for types which can be safely cast to `GLShaderNode`, for instance with `toGLShaderNode`.

#### Instances

Instances details

(BoxedPtr o, TypedObject o, IsDescendantOf GLShaderNode o) => IsGLShaderNode o Source # |
Instance details Defined in GI.Gsk.Objects.GLShaderNode

toGLShaderNode :: (MonadIO m, IsGLShaderNode o) => o -> m GLShaderNode Source #

Cast to `GLShaderNode`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

draw, ref, serialize, unref, writeToFile.

#### Getters

getArgs, getBounds, getChild, getChildren, getNChildren, getNodeType, getOpaqueRect, getShader.

#### Setters

None.

## getArgs

gLShaderNodeGetArgs Source #

Arguments

:: (HasCallStack, MonadIO m, IsGLShaderNode a) |
=> a | `node`: a `GskRenderNode` for a gl shader
-> m Bytes | Returns: A `GBytes` with the uniform arguments

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

Gets args for the node.

## getChild

gLShaderNodeGetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsGLShaderNode a) |
=> a | `node`: a `GskRenderNode` for a gl shader
-> Word32 | `idx`: the position of the child to get
-> m RenderNode | Returns: the `idx`'th child of `node`

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

Gets one of the children.

## getNChildren

gLShaderNodeGetNChildren Source #

Arguments

:: (HasCallStack, MonadIO m, IsGLShaderNode a) |
=> a | `node`: a `GskRenderNode` for a gl shader
-> m Word32 | Returns: The number of children

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

Returns the number of children

## getShader

gLShaderNodeGetShader Source #

Arguments

:: (HasCallStack, MonadIO m, IsGLShaderNode a) |
=> a | `node`: a `GskRenderNode` for a gl shader
-> m GLShader | Returns: the `GskGLShader` shader

Gets shader code for the node.

## new

gLShaderNodeNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsGLShader a) |
=> a | `shader`: the `GskGLShader`
-> Rect | `bounds`: the rectangle to render the shader into
-> Bytes | `args`: Arguments for the uniforms
-> Maybe [RenderNode] | `children`: array of child nodes, these will be rendered to textures and used as input.
-> m GLShaderNode | Returns: A new `GskRenderNode`

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

Creates a `GskRenderNode` that will render the given `shader` into the area given by `bounds`.

The `args` is a block of data to use for uniform input, as per types and offsets defined by the `shader`. Normally this is generated by `GLShader`.`format_args`() or `ShaderArgsBuilder`.

See `GLShader` for details about how the shader should be written.

All the children will be rendered into textures (if they aren't already `GskTextureNodes`, which will be used directly). These textures will be sent as input to the shader.

If the renderer doesn't support GL shaders, or if there is any problem when compiling the shader, then the node will draw pink. You should use `gLShaderCompile` to ensure the `shader` will work for the renderer before using it.