Zinggi / elm-2d-game / Game.TwoD.Shapes

Shapes for WebGL rendering.

You don't need this module, unless you want to have a ready made square for a custom vertex shader.

Pretty much anything can be created using a single square. If you don't believe me, see here.

unitSquare : WebGL.Mesh Vertex

A square with corners (0, 0), (1, 1)

unitTriangle : WebGL.Mesh Vertex

A triangle with corners (0, 0), (0, 1), (1, 0)


type alias Vertex =
{ position : Math.Vector2.Vec2 }

Just an alias for a 2d vector. Needs to be in a record because it will be passed as an attribute to the vertex shader