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

GI.Gsk.Objects.GLShader

Description

An object representing a GL shader program.

Synopsis

Exported types

newtype GLShader Source #

Memory-managed wrapper type.

Constructors

GLShader (ManagedPtr GLShader) 

Instances

Instances details
Eq GLShader Source # 
Instance details

Defined in GI.Gsk.Objects.GLShader

GObject GLShader Source # 
Instance details

Defined in GI.Gsk.Objects.GLShader

ManagedPtrNewtype GLShader Source # 
Instance details

Defined in GI.Gsk.Objects.GLShader

Methods

toManagedPtr :: GLShader -> ManagedPtr GLShader

TypedObject GLShader Source # 
Instance details

Defined in GI.Gsk.Objects.GLShader

Methods

glibType :: IO GType

HasParentTypes GLShader Source # 
Instance details

Defined in GI.Gsk.Objects.GLShader

IsGValue (Maybe GLShader) Source #

Convert GLShader to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gsk.Objects.GLShader

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe GLShader -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe GLShader)

type ParentTypes GLShader Source # 
Instance details

Defined in GI.Gsk.Objects.GLShader

type ParentTypes GLShader = '[Object]

class (GObject o, IsDescendantOf GLShader o) => IsGLShader o Source #

Type class for types which can be safely cast to GLShader, for instance with toGLShader.

Instances

Instances details
(GObject o, IsDescendantOf GLShader o) => IsGLShader o Source # 
Instance details

Defined in GI.Gsk.Objects.GLShader

toGLShader :: (MonadIO m, IsGLShader o) => o -> m GLShader Source #

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

Methods

compile

gLShaderCompile Source #

Arguments

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

shader: a GLShader

-> b

renderer: a Renderer

-> m ()

(Can throw GError)

Tries to compile the shader for the given renderer, and reports False with an error if there is a problem. You should use this function before relying on the shader for rendering and use a fallback with a simpler shader or without shaders if it fails.

Note that this will modify the rendering state (for example change the current GL context) and requires the renderer to be set up. This means that the widget has to be realized. Commonly you want to call this from the realize signal of a widget, or during widget snapshot.

findUniformByName

gLShaderFindUniformByName Source #

Arguments

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

shader: a GLShader

-> Text

name: uniform name

-> m Int32

Returns: The index of the uniform, or -1

Looks for a uniform by the name name, and returns the index of the uniform, or -1 if it was not found.

getArgBool

gLShaderGetArgBool Source #

Arguments

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

shader: a GLShader

-> Bytes

args: uniform arguments

-> Int32

idx: index of the uniform

-> m Bool

Returns: The value

Gets the value of the uniform idx in the args block. The uniform must be of bool type.

getArgFloat

gLShaderGetArgFloat Source #

Arguments

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

shader: a GLShader

-> Bytes

args: uniform arguments

-> Int32

idx: index of the uniform

-> m Float

Returns: The value

Gets the value of the uniform idx in the args block. The uniform must be of float type.

getArgInt

gLShaderGetArgInt Source #

Arguments

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

shader: a GLShader

-> Bytes

args: uniform arguments

-> Int32

idx: index of the uniform

-> m Int32

Returns: The value

Gets the value of the uniform idx in the args block. The uniform must be of int type.

getArgUint

gLShaderGetArgUint Source #

Arguments

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

shader: a GLShader

-> Bytes

args: uniform arguments

-> Int32

idx: index of the uniform

-> m Word32

Returns: The value

Gets the value of the uniform idx in the args block. The uniform must be of uint type.

getArgVec2

gLShaderGetArgVec2 Source #

Arguments

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

shader: a GLShader

-> Bytes

args: uniform arguments

-> Int32

idx: index of the uniform

-> Vec2

outValue: location to store the uniform value in

-> m () 

Gets the value of the uniform idx in the args block. The uniform must be of vec2 type.

getArgVec3

gLShaderGetArgVec3 Source #

Arguments

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

shader: a GLShader

-> Bytes

args: uniform arguments

-> Int32

idx: index of the uniform

-> Vec3

outValue: location to store the uniform value in

-> m () 

Gets the value of the uniform idx in the args block. The uniform must be of vec3 type.

getArgVec4

gLShaderGetArgVec4 Source #

Arguments

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

shader: a GLShader

-> Bytes

args: uniform arguments

-> Int32

idx: index of the uniform

-> Vec4

outValue: location to store set the uniform value in

-> m () 

Gets the value of the uniform idx in the args block. The uniform must be of vec4 type.

getArgsSize

gLShaderGetArgsSize Source #

Arguments

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

shader: a GLShader

-> m Word64

Returns: The size of the data block

Get the size of the data block used to specify arguments for this shader.

getNTextures

gLShaderGetNTextures Source #

Arguments

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

shader: a GLShader

-> m Int32

Returns: The number of texture inputs required by shader

Returns the number of textures that the shader requires.

This can be used to check that the a passed shader works in your usecase. It is determined by looking at the highest u_textureN value that the shader defines.

getNUniforms

gLShaderGetNUniforms Source #

Arguments

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

shader: a GLShader

-> m Int32

Returns: The number of declared uniforms

Get the number of declared uniforms for this shader.

getResource

gLShaderGetResource Source #

Arguments

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

shader: a GLShader

-> m Text

Returns: The resource path for the shader, or Nothing if none.

Gets the resource path for the GLSL sourcecode being used to render this shader.

getSource

gLShaderGetSource Source #

Arguments

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

shader: a GLShader

-> m Bytes

Returns: The source code for the shader

Gets the GLSL sourcecode being used to render this shader.

getUniformName

gLShaderGetUniformName Source #

Arguments

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

shader: a GLShader

-> Int32

idx: index of the uniform

-> m Text

Returns: The name of the declared uniform

Get the name of the declared uniform for this shader at index idx.

getUniformOffset

gLShaderGetUniformOffset Source #

Arguments

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

shader: a GLShader

-> Int32

idx: index of the uniform

-> m Int32

Returns: The data offset

Get the offset into the data block where data for this uniforms is stored.

getUniformType

gLShaderGetUniformType Source #

Arguments

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

shader: a GLShader

-> Int32

idx: index of the uniform

-> m GLUniformType

Returns: The type of the declared uniform

Get the type of the declared uniform for this shader at index idx.

newFromBytes

gLShaderNewFromBytes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Bytes

sourcecode: GLSL sourcecode for the shader, as a Bytes

-> m GLShader

Returns: A new GLShader

Creates a GLShader that will render pixels using the specified code.

newFromResource

gLShaderNewFromResource Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

resourcePath: path to a resource that contains the GLSL sourcecode for the shader

-> m GLShader

Returns: A new GLShader

Creates a GLShader that will render pixels using the specified code.

Properties

resource

Resource containing the source code for the shader.

If the shader source is not coming from a resource, this will be Nothing.

constructGLShaderResource :: (IsGLShader o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “resource” property. This is rarely needed directly, but it is used by new.

getGLShaderResource :: (MonadIO m, IsGLShader o) => o -> m Text Source #

Get the value of the “resource” property. When overloading is enabled, this is equivalent to

get gLShader #resource

source

No description available in the introspection data.

constructGLShaderSource :: (IsGLShader o, MonadIO m) => Bytes -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “source” property. This is rarely needed directly, but it is used by new.

getGLShaderSource :: (MonadIO m, IsGLShader o) => o -> m Bytes Source #

Get the value of the “source” property. When overloading is enabled, this is equivalent to

get gLShader #source