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

Safe HaskellSafe-Inferred
LanguageHaskell2010

FWGL.Shader.Shader

Synopsis

Documentation

type Shader gs is os = STList gs -> STList is -> STList os

A function from a (heterogeneous) set of uniforms and a set of inputs (attributes or varyings) to a set of outputs (varyings).

type Valid gs is os = (StaticList gs, StaticList is, StaticList os, StaticSTList gs, StaticSTList is, StaticSTList os)

The condition for a valid Shader.

type Member x xs = IsMember x xs ~ True

class AllTypeable xs

Instances

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

class Subset xs ys

Instances

(~) Bool (IsSubset xs ys) True => Subset xs ys 

type Equal xs ys = And (IsSubset xs ys) (IsSubset ys xs) ~ True

type family Union xs ys

Equations

Union [] ys = ys 
Union (x : xs) ys = Union xs (Insert x ys) 

type family Insert y xs

Equations

Insert y [] = `[y]` 
Insert y (y : xs) = y : xs 
Insert y (x : xs) = x : Insert y xs 

data STList :: [*] -> * where

An heterogeneous set of ShaderTypes and Typeables.

Constructors

N :: STList [] 
(:-) :: (ShaderType a, Typeable a, IsMember a xs ~ False) => a -> STList xs -> STList (a : xs) infixr 4 

stFold :: (forall x. (Typeable x, ShaderType x) => acc -> x -> acc) -> acc -> STList xs -> acc

staticList :: StaticList xs => Proxy (xs :: [*]) -> (forall x. (Typeable x, ShaderType x) => x -> y) -> [y]

staticSTList :: StaticSTList xs => Proxy (xs :: [*]) -> (forall x. (Typeable x, ShaderType x) => x -> x) -> STList xs