on e2fc4da help sign in
35 lines 1.0 kB history raw
1module Graphics.WebGL (link, bind, encapsulate, webgl) where
3{-| WebGL -}
5import Graphics.Element (Element)
6import Native.Graphics.WebGL
7import Signal (Signal)
9data GL = Dummy_GL
11data Shader auv = Dummy_Shader
12data Program a u = Dummy_Program
14link : GL -> Shader { attribute : a, uniform : u, varying : v } -> Shader { attribute : {}, uniform : {}, varying : v } -> Program a u
15link = Native.Graphics.WebGL.link
17-- Binder really should not need a program
18-- I need runtime type information from something though...
20data Buffer a = Dummy_Buffer
22bind : GL -> Program a u -> [a] -> Buffer a
23bind = Native.Graphics.WebGL.bind
25-- Now I cheat here because elm lacks existential types or rank-n
26-- I'm in essense doing the following
27-- data Model = forall a u. Model (Program a u) (Buffer a) u
29data Model = Dummy_Model
31encapsulate : Program a u -> Buffer a -> u -> Model
32encapsulate = Native.Graphics.WebGL.encapsulate
34webgl : Signal (Int,Int) -> (Signal GL -> Signal [Model]) -> Signal Element
35webgl = Native.Graphics.WebGL.webgl