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

GI.Gsk.Objects.GLShaderNode

Description

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

Synopsis

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

BoxedPtr GLShaderNode Source # 
Instance details

Defined in GI.Gsk.Objects.GLShaderNode

ManagedPtrNewtype GLShaderNode Source # 
Instance details

Defined in GI.Gsk.Objects.GLShaderNode

Methods

toManagedPtr :: GLShaderNode -> ManagedPtr GLShaderNode

TypedObject GLShaderNode Source # 
Instance details

Defined in GI.Gsk.Objects.GLShaderNode

Methods

glibType :: IO GType

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, getNChildren, getNodeType, 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

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

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

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

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 [structgsk.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.