on 8bfca73 help sign in
28 lines 827 B history raw
1module Graphics.WebGL (encapsulate, webgl) where
3{-| WebGL -}
5import Graphics.Element (Element)
6import Native.Graphics.WebGL
8data Shader a u v = Dummy_Shader
9data Program a u = Dummy_Program
10type Linker = Shader a u v -> Shader {} {} v -> Program a u
12-- Binder really should not need a program
13-- I need runtime type information from something though...
15data Buffer a = Dummy_Buffer
16type Binder = Program a u -> [a] -> Buffer a
18-- Now I cheat here because elm lacks existential types or rank-n
19-- I'm in essense doing the following
20-- data Model = forall a u. Model (Program a u) (Buffer a) u
22data Model = Dummy_Model
24encapsulate : Program a u -> Buffer a -> u -> Model
25encapsulate = Native.Graphics.WebGL.encapsulate
27webgl : Int -> Int -> (Linker -> Binder -> [Model]) -> Element
28webgl = Native.Graphics.WebGL.webgl