Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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 -> [RenderNode] -> m GLShaderNode
Exported types
newtype GLShaderNode Source #
Memory-managed wrapper type.
Instances
Eq GLShaderNode Source # | |
Defined in GI.Gsk.Objects.GLShaderNode (==) :: GLShaderNode -> GLShaderNode -> Bool # (/=) :: GLShaderNode -> GLShaderNode -> Bool # | |
BoxedPtr GLShaderNode Source # | |
Defined in GI.Gsk.Objects.GLShaderNode boxedPtrCopy :: GLShaderNode -> IO GLShaderNode # boxedPtrFree :: GLShaderNode -> IO () # | |
ManagedPtrNewtype GLShaderNode Source # | |
Defined in GI.Gsk.Objects.GLShaderNode | |
TypedObject GLShaderNode Source # | |
Defined in GI.Gsk.Objects.GLShaderNode | |
HasParentTypes GLShaderNode Source # | |
Defined in GI.Gsk.Objects.GLShaderNode | |
type ParentTypes GLShaderNode Source # | |
Defined in GI.Gsk.Objects.GLShaderNode |
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
(BoxedPtr o, TypedObject o, IsDescendantOf GLShaderNode o) => IsGLShaderNode o Source # | |
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
Methods
draw, ref, serialize, unref, writeToFile.
Getters
getArgs, getBounds, getChild, getNChildren, getNodeType, getShader.
Setters
None.
getArgs
:: (HasCallStack, MonadIO m, IsGLShaderNode a) | |
=> a |
|
-> m Bytes | Returns: A |
Gets args for the node.
getChild
:: (HasCallStack, MonadIO m, IsGLShaderNode a) | |
=> a |
|
-> Word32 |
|
-> m RenderNode | Returns: the |
Gets one of the children.
getNChildren
gLShaderNodeGetNChildren Source #
:: (HasCallStack, MonadIO m, IsGLShaderNode a) | |
=> a |
|
-> m Word32 | Returns: The number of children |
Returns the number of children
getShader
gLShaderNodeGetShader Source #
:: (HasCallStack, MonadIO m, IsGLShaderNode a) | |
=> a |
|
-> m GLShader | Returns: the |
Gets shader code for the node.
new
:: (HasCallStack, MonadIO m, IsGLShader a) | |
=> a |
|
-> Rect |
|
-> Bytes |
|
-> [RenderNode] |
|
-> m GLShaderNode | Returns: A new |
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.