on master help sign in
docs that are compatible with elm-get
commit909c4266ed24ad1d481977a5ff2d3c7d83607cd0 authorJohn P Mayer Jr <john.p.mayer.jr@gmail.com> dateWed 2 Apr 2014, 01:38 (13 years ago) parent8c6e080
1 file changed+12−3
libraries/Graphics/WebGL.elm+12−3
libraries/Graphics/WebGL.elm+12−3
@@ -3,7 +3,7 @@ module Graphics.WebGL (mapTriangle, zipTriangle, loadTex, model, webgl) where
33{-| The WebGL API is for high performance drawing.
44
55# Triangle Convenience Functions
6−@docs Triangle, mapTriangle, zipTriangle
6+@docs mapTriangle, zipTriangle
77
88# Shaders
99Shaders are created using glsl blocks.
@@ -17,10 +17,10 @@ void main () {
1717 gl_Position = vec4(pos,1.0);
1818}
1919
20−|]
20+\]
2121
2222# WebGL Element
23−@docs webgl
23+@docs loadTex, model, webgl
2424
2525-}
2626
@@ -32,25 +32,34 @@ import Signal (Signal)
3232unsafeCoerceGLSL : String -> Shader attr unif vary
3333unsafeCoerceGLSL = Native.Graphics.WebGL.unsafeCoerceGLSL
3434
35+{-| An alias for a 3-tuple -}
3536type Triangle a = (a,a,a)
3637
38+{-| Apply a function to each vertex -}
3739mapTriangle : (a -> b) -> Triangle a -> Triangle b
3840mapTriangle f (x,y,z) = (f x, f y, f z)
3941
42+{-| Apply an arity-2 function element-wise on 2 triangles -}
4043zipTriangle : (a -> b -> c) -> Triangle a -> Triangle b -> Triangle c
4144zipTriangle f (x,y,z) (x',y',z') = (f x x', f y y', f z z')
4245
46+{-| Opaque Shader Type -}
4347data Shader attr unif vary = Shader
4448
49+{-| Opaque Texture Type -}
4550data Texture = Texture
4651
52+{-| Load an image url as a texture -}
4753loadTex : String -> Signal (Response Texture)
4854loadTex = Native.Graphics.WebGL.loadTex
4955
56+{-| Opaque Model Type -}
5057data Model = Model
5158
59+{-| A model is a collection of a fragment shader, a vertex shader, attribute data, and uniform data. -}
5260model : Shader attr unif vary -> Shader {} unif vary -> [Triangle attr] -> unif -> Model
5361model = Native.Graphics.WebGL.model
5462
63+{-| Render a WebGL scene with the given dimensions and models -}
5564webgl : (Int,Int) -> [Model] -> Element
5665webgl = Native.Graphics.WebGL.webgl