on master help sign in
slight changes to markdown
b2e83ccJohn P Mayer Jr
libraries/Graphics/WebGL.elm+5−2
@@ -3,11 +3,12 @@ module Graphics.WebGL (mapTriangle, zipTriangle, loadTex, model, webgl) where
3{-| The WebGL API is for high performance drawing.
3{-| The WebGL API is for high performance drawing.
4
4
5# Triangle Convenience Functions
5# Triangle Convenience Functions
6−@docs mapTriangle, zipTriangle
6+@docs Triangle, mapTriangle, zipTriangle
7
7
8# Shaders
8# Shaders
9Shaders are created using glsl blocks.
9Shaders are created using glsl blocks.
10
10
11+```haskell
11vertex : Shader { a | pos : V3 } {} {}
12vertex : Shader { a | pos : V3 } {} {}
12vertex = [glsl|
13vertex = [glsl|
13
14
@@ -18,6 +19,7 @@ void main () {
18}
19}
19
20
20\]
21\]
22+```
21
23
22# WebGL Element
24# WebGL Element
23@docs loadTex, model, webgl
25@docs loadTex, model, webgl
@@ -32,7 +34,8 @@ import Signal (Signal)
32unsafeCoerceGLSL : String -> Shader attr unif vary
34unsafeCoerceGLSL : String -> Shader attr unif vary
33unsafeCoerceGLSL = Native.Graphics.WebGL.unsafeCoerceGLSL
35unsafeCoerceGLSL = Native.Graphics.WebGL.unsafeCoerceGLSL
34
36
35−{-| An alias for a 3-tuple -}
37+{-| Triangles are only homogenous 3-tuples. Each element describes something about each vertex, and must be a record to be used with GLSL shaders.
38+-}
36type Triangle a = (a,a,a)
39type Triangle a = (a,a,a)
37
40
38{-| Apply a function to each vertex -}
41{-| Apply a function to each vertex -}