on 22001fa help sign in
32 lines 825 B history raw
2module Graphics.WebGL (mapTriangle, zipTriangle, loadTex, model, webgl) where
4{-| WebGL -}
6import Graphics.Element (Element)
7import Http (Response)
8import Native.Graphics.WebGL
9import Signal (Signal)
11type Triangle a = (a,a,a)
13mapTriangle : (a -> b) -> Triangle a -> Triangle b
14mapTriangle f (x,y,z) = (f x, f y, f z)
16zipTriangle : (a -> b -> c) -> Triangle a -> Triangle b -> Triangle c
17zipTriangle f (x,y,z) (x',y',z') = (f x x', f y y', f z z')
19data Shader attr unif vary = Shader
21data Texture = Texture
23loadTex : String -> Signal (Response Texture)
24loadTex = Native.Graphics.WebGL.loadTex
26data Model = Model
28model : Shader attr unif vary -> Shader {} unif vary -> [Triangle attr] -> unif -> Model
29model = Native.Graphics.WebGL.model
31webgl : (Int,Int) -> [Model] -> Element
32webgl = Native.Graphics.WebGL.webgl