Skip to content

OpenGl Terminal Options

Aaron Santos edited this page Apr 28, 2016 · 8 revisions

create-terminal parameters

The terminal creation function create-terminal takes three parameters: group-map, opts, and f.

Layer Groups

Layer group are specified as a map. Each key is a group-id and each value is a map of options. Options must have these keys:

:layers: a sequence of layer identifiers. Keywords are encouraged, but not enforced. Example [:map :entities :ui].

:columns: the width of each layer.

:rows: the height of each layer.

:pos: the [x y] position of the layer in pixels. [0 0] is the default position.

:font: the layers of a group all use the same font.

Opts

Terminal options are specified as a map. Opts must have these keys:

screen-width: width of the screen in pixels. screen-height: height of the screen in pixels.

Opts may have these keys:

:title: the text to use in the windows title bar. Default "Zaffre".

:default-fg-color: an [r g b] sequence in the range of 0-255. Default [255 255 255].

:default-bg-color: an [r g b] sequence in the range of 0-255. Default [0 0 0].

:fullscreen: true or false. Default false.

:fx-shader: a map with these keys: :name - a path to the shader, :uniforms - a list of entries where each entry is a ["uniformName" value]. Default {:name "passthrough.fs" :uniforms []}.

A retro fx shader is included with Zaffre. See examples.shaderfx for its use or ideas on how to create your own.

Callback fn

The final parameter is a callback fn - f that takes a single parameter terminal. f is called in a separate thread.