luminance-0.6.0.5: Type-safe, type-level and stateless graphics framework

Copyright(C) 2015 Dimitri Sabadie
LicenseBSD3
MaintainerDimitri Sabadie <dimitri.sabadie@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Graphics.Luminance.Shader.Uniform

Contents

Description

 

Synopsis

Uniform

class Uniform a Source

Class of types that can be sent down to shaders. That class is closed because shaders cannot handle a lot of uniform types. However, you should have a look at the U documentation for further information about how to augment the scope of the types you can send down to shaders.

Minimal complete definition

toU

Instances

Uniform Float Source 
Uniform Int32 Source 
Uniform Word32 Source 
Uniform () Source 
Uniform [Float] Source 
Uniform [Int32] Source 
Uniform [Word32] Source 
Uniform [(Float, Float)] Source 
Uniform [(Int32, Int32)] Source 
Uniform [(Word32, Word32)] Source 
Uniform [(Float, Float, Float)] Source 
Uniform [(Int32, Int32, Int32)] Source 
Uniform [(Word32, Word32, Word32)] Source 
Uniform [(Float, Float, Float, Float)] Source 
Uniform [(Int32, Int32, Int32, Int32)] Source 
Uniform [(Word32, Word32, Word32, Word32)] Source 
Uniform [M44 Float] Source 
Uniform [V Nat 2 Float] Source 
Uniform [V Nat 2 Int32] Source 
Uniform [V Nat 2 Word32] Source 
Uniform [V Nat 3 Float] Source 
Uniform [V Nat 3 Int32] Source 
Uniform [V Nat 3 Word32] Source 
Uniform [V Nat 4 Float] Source 
Uniform [V Nat 4 Int32] Source 
Uniform [V Nat 4 Word32] Source 
Uniform [V4 Float] Source 
Uniform [V4 Int32] Source 
Uniform [V4 Word32] Source 
Uniform [V3 Float] Source 
Uniform [V3 Int32] Source 
Uniform [V3 Word32] Source 
Uniform [V2 Float] Source 
Uniform [V2 Int32] Source 
Uniform [V2 Word32] Source 
Uniform (M44 Float) Source 
Uniform (V4 Float) Source 
Uniform (V4 Int32) Source 
Uniform (V4 Word32) Source 
Uniform (V3 Float) Source 
Uniform (V3 Int32) Source 
Uniform (V3 Word32) Source 
Uniform (V2 Float) Source 
Uniform (V2 Int32) Source 
Uniform (V2 Word32) Source 
Uniform (Cubemap f) Source 
Uniform (Texture1D f) Source 
Uniform (Texture2D f) Source 
Uniform (Texture3D f) Source 
Uniform (Float, Float) Source 
Uniform (Int32, Int32) Source 
Uniform (Word32, Word32) Source 
Uniform (Float, Float, Float) Source 
Uniform (Int32, Int32, Int32) Source 
Uniform (Word32, Word32, Word32) Source 
Uniform (V Nat 2 Float) Source 
Uniform (V Nat 2 Int32) Source 
Uniform (V Nat 2 Word32) Source 
Uniform (V Nat 3 Float) Source 
Uniform (V Nat 3 Int32) Source 
Uniform (V Nat 3 Word32) Source 
Uniform (V Nat 4 Float) Source 
Uniform (V Nat 4 Int32) Source 
Uniform (V Nat 4 Word32) Source 
Uniform (Float, Float, Float, Float) Source 
Uniform (Int32, Int32, Int32, Int32) Source 
Uniform (Word32, Word32, Word32, Word32) Source 

data U a Source

A shader uniform. U a doesn’t hold any value. It’s more like a mapping between the host code and the shader the uniform was retrieved from.

U is contravariant in its argument. That means that you can use contramap to build more interesting uniform types. It’s also a divisible contravariant functor, then you can divide structures to take advantage of divisible contravariant properties and then glue several U with different types. That can be useful to build a uniform type by gluing its fields.

Another interesting part is the fact that U is also monoidal. You can accumulate several of them with '(<>)' if they have the same type. That means that you can join them so that when you pass an actual value, it gets shared inside the resulting value.

The '()' instance doesn’t do anything and doesn’t even use its argument ('()').

Uniform block

newtype UB a Source

Constructors

UB 

Fields

unUB :: a