linsyking/elm-regl/2.0.0

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).

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/elm-messenger/elm-regl.

What we checked: The repo moved to github.com/elm-messenger/elm-regl. Rebuilt with git archive from commit f368f31c708a of https://github.com/elm-messenger/elm-regl (zip prefix linsyking-elm-regl-2991052/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 7d71f77a383df0f7387f9205e416f868fa90d6f0.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/linsyking/elm-regl/zipball/2.0.0/

REGL

REGL

This module exposes basic primitives for rendering with REGL.

Basics

type alias Renderable =
Renderable

A renderable object that can be rendered by REGL.

genProg : Value -> 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.

empty : Renderable

An empty renderable object.

render : Renderable -> Value

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

type alias Effect =
Effect

A post-processing effect.

User Configuration

type alias REGLConfig =
{ timeInterval : TimeInterval }

The user configuration for REGL. Differing from the starting options. Users could change this at runtime.

= AnimationFrame
| Millisecond Float

A time interval for the REGL configuration.

Use Millisecond for fixed time intervals, and AnimationFrame for rendering at the refresh rate of the display.

Millisecond should be considered as a debugging tool, and AnimationFrame should be used for production.

configREGL : REGLConfig -> ExecPort msg -> Cmd msg

Reconfigure REGL at runtime.

Direct REGL Commands

type alias REGLStartConfig =
{ virtWidth : Float
, virtHeight : Float
, fboNum : Int
, builtinPrograms : Maybe (List String)
}

The configuration for starting REGL.

virtWidth and virtHeight are the virtual width and height users defined.

fboNum is the number of framebuffers created.

builtinPrograms is a list of built-in programs that users want to enable.

= MagNearest
| MagLinear

The magnification option for textures.

Users should use MagLinear for most cases. However, if pixel art is used, MagNearest should be used.

= MinNearest
| MinLinear
| NearestMipmapNearest
| LinearMipmapNearest
| NearestMipmapLinear
| LinearMipmapLinear

The minification option for textures.

Similar to the magnification option, users should use MinLinear for most cases.

type alias TextureOptions =
{ mag : Maybe TextureMagOption
, min : Maybe TextureMinOption
}

The texture options.

batchExec : ExecPort msg -> List (ExecPort msg -> Cmd msg) -> List (Cmd msg)

Execute a batch of commands.

createREGLProgram : String -> REGLProgram -> ExecPort msg -> Cmd msg

Create a user-defined REGL program.

loadTexture : String -> String -> Maybe TextureOptions -> ExecPort msg -> Cmd msg

Load a texture with name, url and options.

startREGL : REGLStartConfig -> ExecPort msg -> Cmd msg

Execute the start command for REGL.

loadMSDFFont : String -> String -> String -> ExecPort msg -> Cmd msg

Load a MSDF font.

decodeRecvMsg : Value -> Maybe REGLRecvMsg

Decode a received message.

type alias Texture =
{ name : String
, width : Int
, height : Int
}

Texture Information

= REGLTextureLoaded Texture
| REGLFontLoaded String
| REGLProgramCreated String

Receive messages from REGL.

Miscellaneous

{ width : Int
, height : Int
}
-> List (Attribute msg)
-> Html msg

Create the canvas HTML element.