fwgl-0.1.0.2: FRP 2D/3D game engine

Safe HaskellNone
LanguageHaskell2010

FWGL.Shader

Synopsis

Documentation

type Shader g i o a = PartialShader g i o a

type VertexShader g i o = Shader g i (VertexShaderOutput : o) ()

type FragmentShader g i = Shader g i (FragmentShaderOutput : []) ()

class Typeable a

The class Typeable allows a concrete representation of a type to be calculated.

Minimal complete definition

typeRep#

Instances

Typeable * Bool 
Typeable * Char 
Typeable * Double 
Typeable * Float 
Typeable * Int 
Typeable * Int8 
Typeable * Int16 
Typeable * Int32 
Typeable * Int64 
Typeable * Integer 
Typeable * Ordering 
Typeable * RealWorld 
Typeable * Word 
Typeable * Word8 
Typeable * Word16 
Typeable * Word32 
Typeable * Word64 
Typeable * () 
Typeable * SpecConstrAnnotation 
Typeable * ThreadId 
Typeable * WordPtr 
Typeable * IntPtr 
Typeable * TypeRep 
Typeable * TyCon 
Typeable * Text 
Typeable * Text 
Typeable * LocalTime 
Typeable * ZonedTime 
Typeable * TimeOfDay 
Typeable * TimeZone 
Typeable * UTCTime 
Typeable * NominalDiffTime 
Typeable * Day 
Typeable * M4 
Typeable * M3 
Typeable * M2 
Typeable * V4 
Typeable * V3 
Typeable * V2 
Typeable * Sampler2D 
Typeable * Float 
Typeable * UV 
Typeable * Position2 
Typeable * View2 
Typeable * Transform2 
Typeable * Depth 
Typeable * Image 
Typeable * UV 
Typeable * Normal3 
Typeable * Position3 
Typeable * View3 
Typeable * Transform3 
Typeable * Texture2 
(Typeable (k1 -> k) s, Typeable k1 a) => Typeable k (s a)

Kind-polymorphic Typeable instance for type application

Typeable ((* -> *) -> Constraint) Alternative 
Typeable ((* -> *) -> Constraint) Applicative 
Typeable (* -> * -> * -> * -> * -> * -> * -> *) (,,,,,,) 
Typeable (* -> * -> * -> * -> * -> * -> *) (,,,,,) 
Typeable (* -> * -> * -> * -> * -> *) (,,,,) 
Typeable (* -> * -> * -> * -> *) (,,,) 
Typeable (* -> * -> * -> *) (,,) 
Typeable (* -> * -> * -> *) STArray 
Typeable (* -> * -> *) (->) 
Typeable (* -> * -> *) Either 
Typeable (* -> * -> *) (,) 
Typeable (* -> * -> *) ST 
Typeable (* -> * -> *) Array 
Typeable (* -> * -> *) STRef 
Typeable (* -> * -> *) HashMap 
Typeable (* -> * -> *) MVector 
Typeable (* -> *) [] 
Typeable (* -> *) Ratio 
Typeable (* -> *) StablePtr 
Typeable (* -> *) IO 
Typeable (* -> *) Ptr 
Typeable (* -> *) FunPtr 
Typeable (* -> *) Maybe 
Typeable (* -> *) STM 
Typeable (* -> *) TVar 
Typeable (* -> *) IORef 
Typeable (* -> *) Vector 
Typeable (* -> Constraint) Monoid 
Typeable (k -> *) (Proxy k) 
Typeable (k -> k -> *) (Coercion k) 
Typeable (k -> k -> *) ((:~:) k) 

class AllTypeable xs

Instances

AllTypeable ([] *) 
(Typeable * x, AllTypeable xs) => AllTypeable ((:) * x xs) 

data V2

NB: These are different types from V2, V3, etc.

Constructors

V2 Float Float 

data V3

Constructors

V3 Float Float Float 

data V4

Constructors

V4 Float Float Float Float 

data M2

Constructors

M2 V2 V2 

data M3

Constructors

M3 V3 V3 V3 

data M4

Constructors

M4 V4 V4 V4 V4 

type CFloat = Float

type CV2 = V2

type CV3 = V3

type CV4 = V4

type CM2 = M2

type CM3 = M3

type CM4 = M4

(*) :: (Mul a b c, ShaderType a, ShaderType b, ShaderType c) => a -> b -> c infixl 7

(/) :: (Mul a b c, ShaderType a, ShaderType b, ShaderType c) => a -> b -> c infixl 7

(+) :: (Sum a, ShaderType a) => a -> a -> a infixl 6

(-) :: (Sum a, ShaderType a) => a -> a -> a infixl 6

(^) :: (ShaderType a, ShaderType b) => a -> b -> a infixr 8

(&&) :: Bool -> Bool -> Bool infixr 3

(||) :: Bool -> Bool -> Bool infixr 2

(==) :: ShaderType a => a -> a -> Bool infix 4

(>=) :: ShaderType a => a -> a -> Bool infix 4

(<=) :: ShaderType a => a -> a -> Bool infix 4

(<) :: ShaderType a => a -> a -> Bool infix 4

(>) :: ShaderType a => a -> a -> Bool infix 4

(>>=) :: Shader g i o a -> (a -> Shader g i o b) -> Shader g i o b

(>>) :: Shader g i o a -> Shader g i o b -> Shader g i o b

fail :: String -> Shader g i o a

return :: a -> Shader g i o a

get :: (Member a i, Typeable a, ShaderType a) => Shader g i o a

global :: (Member a g, Typeable a, ShaderType a) => Shader g i o a

put :: (Member a o, Typeable a, ShaderType a) => a -> Shader g i o ()

putVertex :: Member VertexShaderOutput o => V4 -> Shader g i o ()

putFragment :: Member FragmentShaderOutput o => V4 -> Shader g i o ()

(.) :: (b -> c) -> (a -> b) -> a -> c infixr 9

Function composition.

id :: a -> a

Identity function.

const :: a -> b -> a

Constant function.

flip :: (a -> b -> c) -> b -> a -> c

flip f takes its (first) two arguments in the reverse order of f.

($) :: (a -> b) -> a -> b infixr 0

Application operator. This operator is redundant, since ordinary application (f x) means the same as (f $ x). However, $ has low, right-associative binding precedence, so it sometimes allows parentheses to be omitted; for example:

    f $ g $ h x  =  f (g (h x))

It is also useful in higher-order situations, such as map ($ 0) xs, or zipWith ($) fs xs.