lux: brilliant interactive programs

The lux module provides an efficient way to build
interactive programs that consist of plain mathematical functions. It
is comparable to 2htdp/universe, although designed to
allow more parameterization of how the program interacts.

Returns a chaos that opens a GUI frame with a canvas to draw on.
The frame is placed at position x,y on monitor monitor;
if monitor is #f, the monitor containing the mouse pointer is used.
The default size of the frame is
widthxheight. The icon for the application is set to
icon. If start-fullscreen? is true, then the frame
is initially fullscreen. The frame’s style is set to
frame-style.

The canvas is set up for drawing based on mode. If
mode is 'draw, then the canvas assumes that
racket/draw is used. If other values are used, then
the canvas is drawn with OpenGL. If mode is
'gl-compat, then a compatibility OpenGL profile is used. If
mode is 'gl-core, then a core OpenGL profile is
used. If mode is a gl-config% object, then it is
used to initialize the canvas. If opengl-hires? is
#t, then the resulting gl-config% object will have
high resolution mode set.

The values that word-event is called with are either
'close (for when the window’s close button is pressed), a
key-event% object for when keys are pressed, or a
mouse-event% object for when the mouse is used.

The values that word-output should return are functions that
satisfy the contract (->real?real?(is-a?/cdc<%>)any)
where the first argument is the width of the canvas, the second is the
height, and the third is the canvas’s drawing context.

Produces a function that draws pict-convertible? values on to
lux/chaos/gui’s drawing context. If scale? is
true, then the value will be scaled to file the drawing context (while
preserving aspect ratio), otherwise the value will be drawn in the
center as-is.

3.1.2Tracking Keyboard State

This module provides a set of functions for tracking keyboard state
for use inside of word-tick, rather than updating word state
with each event as in word-event. Such as system may be
appropriate for interactive programs where input is only has an impact
at a consistent tick rate.

3.1.3Tracking Mouse State

This module provides a set of functions for tracking mouse state
for use inside of word-tick, rather than updating word state
with each event as in word-event. Such as system may be
appropriate for interactive programs where input is only has an impact
at a consistent tick rate.