| Extracted from Pike v7.8 release 866 at 2016-04-05.

[Top]
GLUE

# Method GLUE.init()

Method init

  `void init(void|mapping(string:mixed) options)`

Description

  Initializes GLUE and loads a driver from a list of drivers. If a driver fails to load or initialize, the next driver is tried.

Throws

  driver_names not listed in the result from get_drivers will cause an error to be thrown.

Parameter `options`

  `"driver_names" : string|array(string)` | The name of a driver or a list of drivers to try, in given order. If no driver name is given, the list given by get_drivers is used.
  `"event_callback" : function(.Events.Event:void)` | This callback is called with a Events.Event object whenever an event is trapped by the driver. If no event callback is given, a callback that calls `exit(0)` on Escape and Exit events is used.
  `"resize_callback" : function(float:void)` | This callback is called with the aspect whenever the drawing area is resized, either by an event or explicitly by the program.
  `"fullscreen" : int(0..1)` | Set fullscreen/window mode. 1 is fullscreen, 0 is window. Defaults to fullscreen.
  `"resolution" : array(int)` | Sets the resolution of the drawing area. Defaults to ({ 800, 600 }).
  `"aspect" : float` | Sets the aspect of the drawing area. Defaults to 1.333333 (4:3).
  `"depth" : int` | Sets the color depth of the drawing area. Defaults to 32.
  `"title" : string` | Sets the window title to this string.
  `"icon_title" : string` | Sets the icon title to this string.
  `"fast_mipmap" : int(0..1)` | Use GL_NEAREST_MIMAP_NEAREST instead of GL_LINEAR_MIPMAP_LINEAR, which also is the default.
  `"rotation" : float` | The rotation in z-axis of the drawing field.
  `"mirror" : string` | Mirroring in x and/or y axis.

See also

  get_drivers