linsyking/elm-regl/9.2.1

NOTE: the latest version is 10.0.0

Renamed to elm-messenger/elm-regl. That is where the repository lives now. It has not been published as a package under the new name.

Versions published as linsyking/elm-regl still install under that name. 5 versions of 15 come from the new location (see their notes).

REGL.Common

Common Type Definitions

= AtomicRenderable ProgramCall
| GroupRenderable (List Effect) (List Renderable)
| GroupRenderableWithCamera
Camera
(List Effect)
(List Renderable)

A renderable object that can be rendered by REGL.

type alias Effect =
ProgramCall

A post-processing effect.

type alias ProgramCall =
List ( String, Value )

A call to the real REGL program.

type alias Camera =
{ x : Float
, y : Float
, zoom : Float
, rotation : Float
}

Camera settings.

Common functions

genProg : ProgramCall -> Renderable

Generate a renderable object from settings. Users can use this function to create custom renderable generators.

group : List Effect -> List Renderable -> Renderable

Group a list of renderables into a single renderable with effects.

groupWithCamera : Camera -> List Effect -> List Renderable -> Renderable

Group a list of renderables into a single renderable with effects and camera.

The camera will override current camera if exists.

render : Renderable -> Value

Render a renderable object. Users need to use it to pass the render result to REGL in JS through a port.

Convenient helper functions

getField : String -> Renderable -> Maybe Value

A handy function to get a field of AtomicRenderable.

updateField : String -> Value -> Renderable -> Renderable

A handy function to update a field of AtomicRenderable.