on 7ff90c8 help sign in
37 lines 781 B history raw
1module Graphics.WebGL (makeGL, Vertex, bufferMesh, transform, mesh, webgl) where
3{-| WebGL
5-}
7import Basics (Float)
8import Signal (Signal)
9import MJS (V3,M4x4)
10import Color (Color)
11import Graphics.Element (Element)
12import Native.Graphics.WebGL
14data GLContext = Fake_Context
16makeGL : Int -> Int -> Signal GLContext
17makeGL = Native.Graphics.WebGL.makeGL
19type Vertex = { pos: V3, color: Color }
20type Triangle = (Vertex,Vertex,Vertex)
22data Mesh = Fake_Mesh
24bufferMesh : [Triangle] -> GLContext -> Mesh
25bufferMesh = Native.Graphics.WebGL.bufferMesh
27data Scene = SceneNode M4x4 [Scene] | SceneLeaf Mesh
29transform : M4x4 -> [Scene] -> Scene
30transform = SceneNode
32mesh : Mesh -> Scene
33mesh = SceneLeaf
35webgl : GLContext -> Scene -> Element
36webgl = Native.Graphics.WebGL.webgl