on edd4fbb help sign in
37 lines 949 B history raw
1module Graphics.WebGL (link, mapTriangle, zipTriangle, bind, encapsulate, webgl) where
3{-| WebGL -}
5import Graphics.Element (Element)
6import Native.Graphics.WebGL
7import Signal (Signal)
9data Shader a u v = Dummy_Shader
10data Program a u = Dummy_Program
12link : Shader a u v -> Shader {} {} v -> Program a u
13link = Native.Graphics.WebGL.link
15type Triangle a = (a,a,a)
17triangle : a -> a -> a -> Triangle a
18triangle = (,,)
20mapTriangle : (a -> b) -> Triangle a -> Triangle b
21mapTriangle f (x,y,z) = (f x, f y, f z)
23zipTriangle : (a -> b -> c) -> Triangle a -> Triangle b -> Triangle c
24zipTriangle f (x,y,z) (x',y',z') = (f x x', f y y', f z z')
26data Buffer a = Dummy_Buffer
28bind : [Triangle a] -> Buffer a
29bind = Native.Graphics.WebGL.bind
31data Model = Dummy_Model
33encapsulate : Program a u -> Buffer a -> u -> Model
34encapsulate = Native.Graphics.WebGL.encapsulate
36webgl : (Int,Int) -> [Model] -> Element
37webgl = Native.Graphics.WebGL.webgl