Common Lisp Package: LISPBUILDER-SDL

The main package of `lispbuilder-sdl'.

README:

FUNCTION

Public

A-MASK (&OPTIONAL (SURFACE *DEFAULT-SURFACE*))

Returns the alpha mask of `SURFAaCE`.

ANY-FORMAT-P

Returns `T` if any pixel format is allowed.

AUDIO-DRIVER-NAME

Returns the driver name of the initialised audio driver. The driver name is a `STRING` containing a one-word identifier like "x11" or "windib". Returns 'NIL' if the audio driver is not already initialised with [INIT-SDL](#init-sdl) or [WITH-INIT](#with-init). ##### Example (sdl:with-init () (sdl:audio-driver-name)) >> "windib"

AVERAGE-FPS (&OPTIONAL (FPSMANAGER *DEFAULT-FPSMANAGER*))

Returns the average frame rate of the event loop calculated over a sliding window of 'n' frames.

B-MASK (&OPTIONAL (SURFACE *DEFAULT-SURFACE*))

Returns the blue mask of `SURFACE`.

BIT-DEPTH (&OPTIONAL (SURFACE *DEFAULT-SURFACE*))

Returns the number of bytes per pixel, or bpp, of `SURFACE`.

BLIT-SURFACE (SOURCE &OPTIONAL (SURFACE *DEFAULT-SURFACE*) CELL)

Performs a fast blit of the `SOURCE` surface to the destination `SURFACE`. The area defined by the `SOURCE` cell is blitted to the area defined by the destination clipping rectangle. The blit function should not be called on a locked surface. The results of blitting operations vary greatly depending on whether a surface ALPHA channel is set on the source surface or not. The priorty of how color key and alpha attributes interact with surface blitting is as follows: * source surface with `ALPHA` + `PIXEL-ALPHA`: Blit using per-pixel alpha only * source surface with `ALPHA` + `COLOR-KEY`: Blit using the colour key AND the per-surface alpha value * source surface with `ALPHA`: Blit using the colour key AND the per-surface alpha value * source surface with `COLOR-KEY`: Blit using the colour key * source surface: Blit using opaque rectangular blit An ALPHA channel has the following effect on blitting operations: * _RGBA to RGB_ with [ALPHA-ENABLED-P](#alpha-enabled-p): The source is alpha-blended with the destination, using the alpha channel. [COLOR-KEY-ENABLED-P](#color-key-enabled-p) and the per-surface alpha are ignored. * _RGBA to RGB_ without [ALPHA-ENABLED-P](#alpha-enabled-p): The RGB data is copied from the source. The source alpha channel and the per-surface alpha value are ignored. If [COLOR-KEY-ENABLED-P](#color-key-enabled-p) is set, only the pixels not matching the colorkey value are copied. * _RGB to RGBA_ with [ALPHA-ENABLED-P](#alpha-enabled-p): The source is alpha-blended with the destination using the per-surface alpha value. If [COLOR-KEY-ENABLED-P](#color-key-enabled-p) is set, only the pixels not matching the colorkey value are copied. The alpha channel of the copied pixels is set to opaque. * _RGB to RGBA_ without [ALPHA-ENABLED-P](#alpha-enabled-p): The RGB data is copied from the source and the alpha value of the copied pixels is set to opaque. If [COLOR-KEY-ENABLED-P](#color-key-enabled-p) is set, only the pixels not matching the colorkey value are copied. * _RGBA to RGBA_ with [ALPHA-ENABLED-P](#alpha-enabled-p): The source is alpha-blended with the destination using the source alpha channel. The alpha channel in the destination surface is left untouched. [COLOR-KEY-ENABLED-P](#color-key-enabled-p) is ignored. * _RGBA to RGBA_ without [ALPHA-ENABLED-P](#alpha-enabled-p): The RGBA data is copied to the destination surface. If [COLOR-KEY-ENABLED-P](#color-key-enabled-p) is set, only the pixels not matching the colorkey value are copied. * _RGB to RGB_ with [ALPHA-ENABLED-P](#alpha-enabled-p): The source is alpha-blended with the destination using the per-surface alpha value. If [COLOR-KEY-ENABLED-P](#color-key-enabled-p) is set, only the pixels not matching the colorkey value are copied. * _RGB to RGB_ without [ALPHA-ENABLED-P](#alpha-enabled-p): The RGB data is copied from the source. If [COLOR-KEY-ENABLED-P](#color-key-enabled-p) is set, only the pixels not matching the colorkey value are copied. *Note*: _RGBA to RGBA_ blits (with [ALPHA-ENABLED-P](#alpha-enabled-p) set) keep the alpha of the destination surface. This means that you cannot compose two arbitrary _RGBA_ surfaces this way and get the result you would expect from "overlaying" them; the destination alpha will work as a mask.

BYTE-DEPTH (&OPTIONAL (SURFACE *DEFAULT-SURFACE*))

Returns the number of bytes per pixel, or bpp, of `SURFACE`.

CLEAR-CELL (&KEY (SURFACE *DEFAULT-SURFACE*) (INDEX NIL))

Sets the `CELL` at `INDEX` to the bounds of `SURFACE`.

CLEAR-CLIP-RECT (&OPTIONAL (SURFACE *DEFAULT-SURFACE*))

Removes the clipping [RECTANGLE](#rectangle).

CLEAR-COLOR-KEY (&KEY (SURFACE *DEFAULT-SURFACE*))

Disables the color key.

CLEAR-DISPLAY (COLOR &KEY (SURFACE *DEFAULT-DISPLAY*) UPDATE)

Fills the display `SURFACE` using color `COLOR`. `SURFACE` is bound to `*DEFAULT-DISPLAY*` if unspecified. The display is updated when `UPDATE` is `T`.

COLOR (&KEY (R 0) (G 0) (B 0) (A NIL))

Returns a new `RGB` [COLOR](#color) from the specified `R`ed, `G`reen, and `B`lue components. Returns a new `RGBA` [COLOR-A](#color-a) from the specified `R`ed, `G`reen, `B`lue, and `A`lpha components.

CONVERT-SURFACE (&KEY (SURFACE *DEFAULT-SURFACE*) (TO-SURFACE *DEFAULT-DISPLAY*) ENABLE-ALPHA ENABLE-COLOR-KEY (FREE NIL) (INHERIT T) (TYPE SW))

Converts `:SURFACE` and returns a new surface matching the pixel format and color of `:TO-SURFACE`. Calls [CONVERT-TO-DISPLAY-FORMAT](#convert-to-display-format) if converting to the display format. Use `:ENABLE-COLOR-KEY` or `:ENABLE-ALPHA` to take advantage of hardware colorkey or alpha blit acceleration. Enabling these flags once a surface is created will not necessarily utilize available hardware acceleration if the surface was not initally created in video memory. Will create the new surface in system memory when `TYPE` is `:SW`. Will attempt to create the new surface in video memory when `TYPE` is `:HW`, otherwise the surface is created in system memory if the combination of color key and alpha do not allow hardware acceleration. The new surface will inherit the pixel, alpha and color key components of the source, *unless* `:INHERIT` is `NIL`. Use `:FREE` to delete the source `SURFACE`.

CONVERT-TO-DISPLAY-FORMAT (&KEY (SURFACE *DEFAULT-SURFACE*) ENABLE-ALPHA ENABLE-COLOR-KEY PIXEL-ALPHA (FREE NIL) (INHERIT T))

Returns a new surface matching the pixel format and color of the video frame buffer (`*display surface*), that is suitable for fast blitting. The new surface will inherit the pixel, alpha and color key components of the source, *unless* `:INHERIT` is `NIL`. Use `:ENABLE-COLOR-KEY` or `:ENABLE-ALPHA` to take advantage of hardware colorkey or alpha blit acceleration. Enabling these flags once a surface is created will not necessarily utilize available hardware acceleration if the surface was not initally created in video memory. Use `:PIXEL-ALPHA` to enable the pixel alpha component (alpha mask of 0xFF) for the new surface. Use `:FREE` to delete the source `SURFACE`. Differences between [CONVERT-TO-DISPLAY-FORMAT](#convert-to-display-format), [CONVERT-SURFACE](#convert-surface), [COPY-SURFACE](#copy-surface), and [CREATE-SURFACE](#create-surface); * [CONVERT-TO-DISPLAY-FORMAT](#convert-to-display-format) ** will always attempt to create a surface in video memory using hardware acceleration if key color and surface alpha are supported. ** A pixel alpha component can be specified. ** New surface is filled with old surface. * [CONVERT-SURFACE](#convert-surface) ** calls [CONVERT-TO-DISPLAY-FORMAT](#convert-to-display-format) if converting a surface to the display format. ** paramatized option to create new surface in video or system memory. ** Pixel format and color match that of the source surface. ** New surface is filled with old surface. * [COPY-SURFACE](#copy-surface) ** paramatized option to create new surface in video or system memory. ** copies a portion or all of the source surface to a new destination surface ** A pixel alpha component can be specified. ** New surface can be filled with the old surface, or the color key or both.

COPY-POINT (POINT)

Returns a copy of the point `POINT`.

COPY-SURFACE (&KEY (SURFACE *DEFAULT-SURFACE*) COLOR-KEY ALPHA PIXEL-ALPHA RLE-ACCEL (TYPE SW) FREE (INHERIT T) (FILL T) (COLOR-KEY-FILL T) (PIXEL-FORMAT NIL) CELLS CELL-INDEX)

Returns a copy of `:SURFACE`. Use `:COLOR-KEY` or `:ALPHA` to set the key color and surface alpha transparency. Hardware colorkey and alpha blit acceleration will be used if supported. Will create the new surface in system memory when `TYPE` is `:SW`. Will attempt to create the new surface in video memory when `TYPE` is `:HW`, otherwise the surface is created in system memory if the combination of color key and alpha do not allow hardware acceleration. The new surface will be filled with the old surface unless `:FILL` is `NIL`. The new surface will be filled with the color key of the old surface (if available) unless `:COLOR-KEY-FILL` is `NIL`. The new surface will inherit the pixel, alpha and color key components of the source, *unless* `:INHERIT` is `NIL`. Use `:FREE` to delete the source `SURFACE`.

CREATE-LIST-IF-NOT (VAR)

If `VAR` is not already a list, then returns `(LIST VAR)`.

CREATE-PATH (FILENAME &OPTIONAL PATH)

Creates a new path from `FILENAME` and `PATH`.

CREATE-RWOPS-FROM-FILE (FILENAME)

Creates and returns a new `RWOPS` object from the file at location `FILENAME`.

CREATE-SURFACE (WIDTH HEIGHT &KEY (BPP 32) (TYPE SW) COLOR-KEY COLOR-KEY-AT PIXEL-ALPHA ALPHA (RLE-ACCEL T) (X 0) (Y 0) MASK)

Creates and returns a new `SURFACE` with the dimensions `WIDTH` and `HEIGHT`. `:COLOR-KEY` sets the color key of the surface and enables color-keying. `:ALPHA` sets the surface alpha transparency and enables alpha blending. This allows a pixel color of `RGB` with the surface `A`. `:PIXEL-ALPHA` enables a pixel alpha component (alpha mask of 0xFF) on the new surface. This allows a pixel color of `RGBA`. `:RLE-ACCEL` enables RLE blit acceleration. `:BPP` is the pixel depth of the surface, and my be 8, 16, 24 or 32. `:TYPE` attempts to create the `SURFACE` in video memory when `:HW`, and in system memory when `:SW` `:X` and `:Y` are the positions of the `SURFACE` in screen coordinates.

DISABLE-EVENT-FILTERS

Disables event filters.

DISABLE-KEY-REPEAT

Disables keyboard repeat.

DISABLE-UNICODE

Unicode translation is enabled with STATE is T, and disabled when STATE is NIL. To obtain the character codes corresponding to received keyboard events, Unicode translation must first be turned on using this function. The translation incurs a slight overhead for each keyboard event and is therefore disabled by default. For each subsequently received key down event, the unicode member of the SDL_keysym structure will then contain the corresponding character code, or zero for keysyms that do not correspond to any character code. Note that only key press events will be translated, not release events. Returns the previous unicode translation state.

DISTANCE (P1 P2)

Returns the distance between the `POINT`s `P1` and `P2`.

DISTANCE-* (X1 Y1 X2 Y2)

Returns the distance between the coordinates `X1`, `Y1` and `X2`, `Y2`.

DOUBLE-BUFFERED-P

Returns `T` if the video surface is double buffered, or returns `NIL` otherwise.

DRAW-BOX (RECT &KEY (CLIPPING NIL) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (STROKE-COLOR NIL) (ALPHA NIL))

See [DRAW-BOX-*](#draw-box-*). ##### Parameters * `RECT` is [RECTANGLE](#rectangle). ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

DRAW-BOX-* (X Y W H &KEY (CLIPPING NIL) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (STROKE-COLOR NIL) (ALPHA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

Draws a filled rectangle of [COLOR](#color) to [SURFACE](#surface). ##### Parameters * `X` and `Y` are the `INTEGER` coordinates of the top-left corner of the rectangle. * `W` and `H` are the width and height of the rectangle, of type `INTEGER`. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the line color, of [COLOR](#color) or [COLOR-A](#color-a). * `:STROKE-COLOR` when not `NIL` will draw a `1` pixel line of color `COLOR` around the perimiter of the box. * `:ALPHA` when between `0` and `255` is used as the alpha transparency value when blitting the rectangle onto `SURFACE`. *Note:* An intermediate surface is created, the rectangle is drawn onto this intermediate surface and then this surface is blitted to `SURFACE`. * `:CLIPPING` is `NIL` The default is `NIL` as the SDL library will perform the necessary clipping automatically. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

DRAW-CHARACTER-SHADED (C P1 FG-COLOR BG-COLOR &KEY (FONT *DEFAULT-FONT*) (SURFACE *DEFAULT-SURFACE*) (GFX-LOADED-P *GFX-LOADED-P*))

See [DRAW-CHARACTER-SHADED-*](#draw-character-shaded-*). ##### Parameters * `P1` is the x and y position to render the character, of type `SDL:POINT`.

DRAW-CHARACTER-SHADED-* (C X Y FG-COLOR BG-COLOR &KEY (FONT *DEFAULT-FONT*) (SURFACE *DEFAULT-SURFACE*) (GFX-LOADED-P *GFX-LOADED-P*))

See [DRAW-CHARACTER-SHADED-*](#draw-character-shaded-*). ##### Parameters * `P1` is the x and y position to render the character, of type `SDL:POINT`.

DRAW-CHARACTER-SOLID (C P1 &KEY (FONT *DEFAULT-FONT*) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

See [DRAW-CHARACTER-SOLID-*](#draw-character-solid-*). ##### Parameters * `P1` is the `X` and `Y` coordinates to render the character onto `SURFACE`, of type `SDL:POINT`.

DRAW-CIRCLE (P1 R &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (ALPHA NIL) (AA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

See [DRAW-CIRCLE-*](#draw-circle-*). ##### Parameters * `P1` is the [POINT](#point) coordinates at the center of the circle. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_ * `:AA` ignored in _LISPBUILDER-SDL_

DRAW-CURVE (VERTICES &KEY (CLIPPING T) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (SEGMENTS 20) (STYLE SOLID) (GFX-LOADED-P *GFX-LOADED-P*))

Draw a Cattmul-Rom spline of [COLOR](#color) to [SURFACE](#surface). The shape of the curve is defined by waypoints. A waypoint is a vertex containing an X and Y coordinate pair. ##### Parameters * `VERTICES` is a list of waypoints or vetices for the spline, of [POINT](#point) * `STYLE` describes the line style used to draw the curve and may be one of `:SOLID`, `:DASH`, or `:POINTS`. Use `:SOLID` to draw a single continuous line through the specified waypoints. Use `:DASH` to draw a line between alternate waypoint pairs. Use `:POINTS` to draw a single pixel at each waypoint. * `SEGMENTS` is the number of segments used to draw the Catmull-Rom spline. Default is 20 segments if unspecified. The greater the number of segments, the smoother the spline. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the line color, of [COLOR](#color) or [COLOR-A](#color-a). * `:CLIPPING` when left as the default value `T` will ensure that the shape is clipped to the dimensions of `SURFACE`. SDL will core dump if pixels are drawn outside a surface. It is slower, but safer to leave `CLIPPING` as `T`. ##### Example (DRAW-CURVE (LIST (SDL:POINT :X 60 :Y 40) (SDL:POINT :X 160 :Y 10) (SDL:POINT :X 170 :Y 150) (SDL:POINT :X 60 :Y 150))) ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

DRAW-ELLIPSE (P1 RX RY &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (AA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

See [DRAW-ELLIPSE-*](#draw-ellipse-*). ##### Parameters * `P1` is the [POINT](#point) coordinates at the center of the ellipse. ##### Packages * Supported in _LISPBUILDER-SDL-GFX_

DRAW-ELLIPSE-* (X Y RX RY &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (AA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

Draws an ellipse circumference of [COLOR](#color) to the [SURFACE](#surface). Use [DRAW-FILLED-ELLIPSE-*](#draw-filled-ellipse-*) to draw a filled ellipse. ##### Parameters * `X` and `Y` specify the center coordinate of the ellipse, of type `INTEGER`. * `RX` and `RY` specify the ellipse radius, of type `INTEGER`. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the pixel color, of [COLOR](#color) or [COLOR-A](#color-a). ##### Packages * Supported in _LISPBUILDER-SDL-GFX_

DRAW-FILLED-CIRCLE (P1 R &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (STROKE-COLOR NIL) (ALPHA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

See [DRAW-FILLED-CIRCLE-*](#draw-filled-circle-*). ##### Parameters * `P1` is the [POINT](#point) coordinates coordinate of the center of the filled circle. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

DRAW-FILLED-ELLIPSE (P1 RX RY &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

See [DRAW-FILLED-ELLIPSE-*](#draw-filled-ellipse-*). ##### Parameters * `P1` is the [POINT](#point) coordinates at the center of the filled ellipse. ##### Packages * Supported in _LISPBUILDER-SDL-GFX_

DRAW-FILLED-ELLIPSE-* (X Y RX RY &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

Draws a filled ellipse of [COLOR](#color) to the [SURFACE](#surface). ##### Parameters * `X` and `Y` specify the center coordinate of the ellipse, of type `INTEGER`. * `RX` and `RY` specify the ellipse radius, of type `INTEGER`. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the pixel color, of [COLOR](#color) or [COLOR-A](#color-a). ##### Packages * Supported in _LISPBUILDER-SDL-GFX_

DRAW-FILLED-PIE (P1 RAD START END &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

See [DRAW-FILLED-PIE-*](#draw-filled-pie-*). ##### Parameters * `P1` is the [POINT](#point) coordinates at the center of the filled pie. ##### Packages * Supported in _LISPBUILDER-SDL-GFX_

DRAW-FILLED-PIE-* (X Y RAD START END &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

Draws a filled pie of [COLOR](#color) to the [SURFACE](#surface) ##### Parameters * `X` and `Y` specify the center coordinate of the pie, of type `INTEGER`. * `RAD` is the pie radius, of type `INTEGER`. * `START` is the pie start, of type `INTEGER`. * `END` is the pie end, of type `INTEGER`. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the pixel color, of [COLOR](#color) or [COLOR-A](#color-a). ##### Packages * Supported in _LISPBUILDER-SDL-GFX_

DRAW-FILLED-POLYGON (VERTICES &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (CLIPPING T) (GFX-LOADED-P *GFX-LOADED-P*))

Draw a filled polygon of [COLOR](#color) to the [SURFACE](#surface) ##### Parameters * `VERTICES` is the list of vertices of type `SDL:POINT`. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the pixel color, of [COLOR](#color) or [COLOR-A](#color-a). ##### Packages * Supported in _LISPBUILDER-SDL-GFX_

DRAW-FILLED-TRIGON (P1 P2 P3 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (CLIPPING T) (GFX-LOADED-P *GFX-LOADED-P*))

Draw a filled trigon of [COLOR](#color) to the [SURFACE](#surface) ##### Parameters * `P1`, `P2` and `P3` specify the vertices of the trigon, of type `SDL:POINT`. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the pixel color, of [COLOR](#color) or [COLOR-A](#color-a). ##### Packages * Supported in _LISPBUILDER-SDL-GFX_

DRAW-LINE (P1 P2 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (CLIPPING T) (AA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

See [DRAW-LINE-*](#draw-line-*). ##### Parameters * `P1` and `P2` are the start and end x/y co-ordinates of the line, of `POINT`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

DRAW-LINE-* (X0 Y0 X1 Y1 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (CLIPPING T) (AA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

Draws a line of [COLOR](#color) to [SURFACE](#surface). ##### Parameters * `X0` `Y0` are the start X/Y coordinates of the line, of `INTEGER`. * `X1` `Y1` are the end X/Y coordinates of the line, of `INTEGER`. * `:AA` determines if the line is to be drawn using antialiasing. _NOTE_: Supported only in `LISPBUILDER-SDL-GFX`, otherwise ignored. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the line color, of [COLOR](#color) or [COLOR-A](#color-a). * `:CLIPPING` when left as the default value `T` will ensure that the shape is clipped to the dimensions of `SURFACE`. SDL will core dump if pixels are drawn outside a surface. It is slower, but safer to leave `CLIPPING` as `T`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_ * `:AA` ignored in _LISPBUILDER-SDL_

DRAW-PIE (P1 RAD START END &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

See [DRAW-PIE-*](#draw-pie-*). ##### Parameters * `P1` is the [POINT](#point) coordinates at the center of the pie. ##### Packages * Supported in _LISPBUILDER-SDL-GFX_

DRAW-PIE-* (X Y RAD START END &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

Draws a pie of [COLOR](#color) to the [SURFACE](#surface). Use [DRAW-FILLED-PIE-*](#draw-filled-pie-*) to draw a filled pie. ##### Parameters * `X` and `Y` specify the center coordinate of the pie, of type `INTEGER`. * `RAD` is the pie radius, of type `INTEGER`. * `START` is the pie start, of type `INTEGER`. * `END` is the pie end, of type `INTEGER`. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the pixel color, of [COLOR](#color) or [COLOR-A](#color-a). ##### Packages * Supported in _LISPBUILDER-SDL-GFX_

DRAW-PIXEL (POINT &KEY (CLIPPING T) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

See [DRAW-PIXEL-*](#draw-pixel-*). ##### Parameters * `POINT` is the [POINT](#point) coordinates of the pixel. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

DRAW-RECTANGLE (RECT &KEY (CLIPPING NIL) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (ALPHA NIL))

See [DRAW-RECTANGLE-*](#draw-rectangle-*). ##### Parameters * `RECT` is [RECTANGLE](#rectangle). ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

DRAW-RECTANGLE-* (X Y W H &KEY (CLIPPING NIL) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (ALPHA NIL))

Draw a rectangle outline of [COLOR](#color) to [SURFACE](#surface). ##### Parameters * `X` and `Y` are the `INTEGER` coordinates of the top-left corner of the rectangle. * `W` and `H` are the width and height of the rectangle, of type `INTEGER`. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the line color, of [COLOR](#color) or [COLOR-A](#color-a). * `:ALPHA` when between `0` and `255` is used as the alpha transparency value when blitting the rectangle onto `SURFACE`. *Note:* An intermediate surface is created, the rectangle is drawn onto this intermediate surface and then this surface is blitted to `SURFACE`. * `:CLIPPING` is `NIL` The default is `NIL` as the SDL library will perform the necessary clipping automatically. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

DRAW-SHAPE (VERTICES &KEY (CLIPPING T) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (STYLE SOLID) (GFX-LOADED-P *GFX-LOADED-P*))

Draw a polygon of [COLOR](#color) to [SURFACE](#surface) using `VERTICES`. ##### Parameters * `VERTICES` is a list of vertices, of `POINT` * `STYLE` describes the line style used to draw the polygon and may be one of `:SOLID`, `:DASH`, or `:POINTS`. Use `:SOLID` to draw a single continuous line through the specified waypoints. Use `:DASH` to draw a line between alternate waypoint pairs. Use `:POINTS` to draw a single pixel at each waypoint. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the line color, of [COLOR](#color) or [COLOR-A](#color-a). * `:CLIPPING` when left as the default value `T` will ensure that the shape is clipped to the dimensions of `SURFACE`. SDL will core dump if pixels are drawn outside a surface. It is slower, but safer to leave `CLIPPING` as `T`. ##### Example (DRAW-SHAPE (LIST (SDL:POINT :X 60 :Y 40) (SDL:POINT :X 160 :Y 10) (SDL:POINT :X 170 :Y 150) (SDL:POINT :X 60 :Y 150))) ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

DRAW-STRING-BLENDED (STRING P1 &KEY (JUSTIFY LEFT) (SURFACE *DEFAULT-SURFACE*) (FONT *DEFAULT-FONT*) (COLOR *DEFAULT-COLOR*))

See [DRAW-STRING-BLENDED-*](#draw-string-blended-*). ##### Parameters * `P1` is the `X` and `X` coordinates to render the text, of type `POINT`. ##### Packages * Supported in _LISPBUILDER-SDL-TTF_

DRAW-STRING-BLENDED-* (STRING X Y &KEY (JUSTIFY LEFT) (SURFACE *DEFAULT-SURFACE*) (FONT *DEFAULT-FONT*) (COLOR *DEFAULT-COLOR*))

Draw text `STRING` at location `X` `Y` using font `FONT` with color `COLOR` onto surface `SURFACE`. The text is keyed onto `SURFACE`. ##### Parameters * `STRING` is the text to render. * `X` and `Y` are the `X` and `Y` position coordinates, as `INTEGERS`. * `FONT` is the font face used to render the string. Of type `FONT`. Bound to `*DEFAULT-FONT*` if unspecified. * `SURFACE` is the target surface, of type `SDL-SURFACE`. Bound to `*DEFAULT-SURFACE*` if unspecified. * `COLOR` color is the text color, of type `COLOR`. ##### Returns * Returns the surface `SURFACE`. ##### Example (DRAW-STRING-SOLID-* "Hello World!" 0 0 :SURFACE A-SURFACE :COLOR A-COLOR) ##### Packages * Supported in _LISPBUILDER-SDL-TTF_

DRAW-STRING-SHADED (STRING P1 FG-COLOR BG-COLOR &KEY (JUSTIFY LEFT) (SURFACE *DEFAULT-SURFACE*) (FONT *DEFAULT-FONT*))

See [DRAW-STRING-SHADED-*](#draw-string-shaded-*). ##### Parameters * `P1` is the `X` and `Y` coordinates to render the text, of type `SDL:POINT`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

DRAW-STRING-SHADED-* (STRING X Y FG-COLOR BG-COLOR &KEY (JUSTIFY LEFT) (SURFACE *DEFAULT-SURFACE*) (FONT *DEFAULT-FONT*))

Draw text `STRING` at location `X` `Y` using font `FONT` with text color `FG-COLOR` and background color `BG-COLOR` onto surface `SURFACE`. The surface background is filled with `BG-COLOR` so the surface cannot be keyed over other surfaces. * `STRING` is the text to render. * `X` and `Y` are the `X` and `Y` coordinates, as `INTEGERS`. * `FG-COLOR` color is the text color, of type `COLOR` * `BG-COLOR` color is the background color used to fill the surface `SURFACE`, of type `COLOR` * `FONT` is the font face used to render the text. Of type `FONT`. Bound to `*DEFAULT-FONT*` if unspecified. * `SURFACE` is the target surface, of type `SDL-SURFACE`. Bound to `*DEFAULT-SURFACE*` if unspecified. ##### Returns * Returns the surface `SURFACE`. ##### Example (DRAW-STRING-SHADED-* "Hello World!" 0 0 F-COLOR B-COLOR :SURFACE A-SURFACE) ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

DRAW-STRING-SOLID (STRING P1 &KEY (JUSTIFY LEFT) (SURFACE *DEFAULT-SURFACE*) (FONT *DEFAULT-FONT*) (COLOR *DEFAULT-COLOR*))

See [DRAW-STRING-SOLID-*](#draw-string-solid-*). ##### Parameters * `P1` is the `X` and `X` coordinates to render the text, of type `POINT`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_, and _LISPBUILDER-SDL-TTF_

DRAW-STRING-SOLID-* (STRING X Y &KEY (JUSTIFY LEFT) (SURFACE *DEFAULT-SURFACE*) (FONT *DEFAULT-FONT*) (COLOR *DEFAULT-COLOR*))

Draw text `STRING` at location `X` `Y` using font `FONT` with color `COLOR` onto surface `SURFACE`. The text is keyed onto `SURFACE`. ##### Parameters * `STRING` is the text to render. * `X` and `Y` are the `X` and `Y` position coordinates, as `INTEGERS`. * `FONT` is the font face used to render the string. Of type `FONT`. Bound to `*DEFAULT-FONT*` if unspecified. * `SURFACE` is the target surface, of type `SDL-SURFACE`. Bound to `*DEFAULT-SURFACE*` if unspecified. * `COLOR` color is the text color, of type `COLOR`. ##### Returns * Returns the surface `SURFACE`. ##### Example (DRAW-STRING-SOLID-* "Hello World!" 0 0 :SURFACE A-SURFACE :COLOR A-COLOR) ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_, and _LISPBUILDER-SDL-TTF_

DRAW-SURFACE (SRC &KEY (SURFACE *DEFAULT-SURFACE*) CELL)

See [BLIT-SURFACE](#blit-surface)

DRAW-SURFACE-AT (SRC POINT &KEY (SURFACE *DEFAULT-SURFACE*) CELL)

Draws the source surface to the destination surface at position POINT. See [BLIT-SURFACE](#blit-surface). *Note*: Modifies the position of `SRC` as a side-effect.

DRAW-SURFACE-AT-* (SRC X Y &KEY (SURFACE *DEFAULT-SURFACE*) CELL)

Draws the source surface to the destination surface at position X and Y. See [BLIT-SURFACE](#blit-surface). *Note*: Modifies the position of `SRC` as a side-effect.

ENABLE-ALPHA (VALUE &KEY (SURFACE *DEFAULT-SURFACE*))

Enable surface alpha blending for when `T`. Disable surface alpha blending when `NIL`. A `SURFACE` need not have a pixel alpha component (RGBA) to use surface alpha blending.

ENABLE-COLOR-KEY (VALUE &KEY (SURFACE *DEFAULT-SURFACE*))

Enables color keying when `T`. Disable color keying when `NIL`

ENABLE-EVENT-FILTERS

Enables event filters.

ENABLE-KEY-REPEAT (DELAY INTERVAL)

Enables the keyboard repeat rate. DELAY specifies how long the key must be pressed before it begins repeating, it then repeats at the speed specified by INTERVAL. Both DELAY and INTERVAL are expressed in milliseconds. Setting DELAY or INTERVAL to NIL will set the default values of SDL-DEFAULT-REPEAT-DELAY and SDL-DEFAULT-REPEAT-INTERVAL respectively. _NOTE_: `ENABLE-KEY-REPEAT` must be called after the SDL library has been initialized to have an effect.

ENABLE-RLE-ACCEL (VALUE &KEY (SURFACE *DEFAULT-SURFACE*))

Enables RLE blit acceleration when `T`, disables RLE acceleration when `NIL`. RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i.e., pixels that match the key color).

ENABLE-UNICODE

Unicode translation is enabled with STATE is T, and disabled when STATE is NIL. To obtain the character codes corresponding to received keyboard events, Unicode translation must first be turned on using this function. The translation incurs a slight overhead for each keyboard event and is therefore disabled by default. For each subsequently received key down event, the unicode member of the SDL_keysym structure will then contain the corresponding character code, or zero for keysyms that do not correspond to any character code. Note that only key press events will be translated, not release events. Returns the previous unicode translation state.

EVENT= (SDL-EVENT EVENT-TYPE &OPTIONAL EVENT-TYPE-END)

Returns `T` if `SDL-EVENT` is of `EVENT-TYPE`. `EVENT-TYPE` must be one of :NO-EVENT, :ACTIVE-EVENT, :KEY-DOWN-EVENT, :KEY-UP-EVENT, :MOUSE-MOTION-EVENT, :MOUSE-BUTTON-DOWN-EVENT, :MOUSE-BUTTON-UP-EVENT, :JOY-AXIS-MOTION-EVENT, :JOY-BALL-MOTION-EVENT, :JOY-HAT-MOTION-EVENT, :JOY-BUTTON-DOWN-EVENT, :JOY-BUTTON-UP-EVENT, :QUIT-EVENT, :SYS-WM-EVENT, :VIDEO-RESIZE-EVENT, :VIDEO-EXPOSE-EVENT, :USER-EVENT.

FILL-SURFACE (COLOR &KEY (TEMPLATE NIL) (SURFACE *DEFAULT-SURFACE*) (UPDATE NIL) (CLIPPING NIL))

Fills surface with the specified `COLOR`. `:TEMPLATE` accepts a `RECTANGLE` defining the fill bounds. `The surface is updated when `:UPDATE`

FILL-SURFACE-* (R G B &KEY (A NIL) (TEMPLATE NIL) (SURFACE *DEFAULT-SURFACE*) (UPDATE NIL) (CLIPPING NIL))

Fill the surface with the specified color `R` `G` `B` `:A` `A`. See [FILL-SURFACE](#fill-surface).

FLOOD-FILL (POINT &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

See [FLOOD-FILL-*](#flood-fill-*). ##### Parameters * POINT is the position to state the fill, of type `POINT`.

FLOOD-FILL-* (X Y &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

Performs a flood fill of surface `SURFACE` with color `COLOR`. The fill starts at the position specified by the `X` and `Y` coordinates. Uses a stack based flood fill that does a lot of consing because it uses PUSH/POP as the stack. This function is fast. ##### Parameters * `X` and `Y` are `INTEGER` coordinates. * `SURFACE` is the target surface, of type `SDL:SDL-SURFACE`. Bound to `SDL:*DEFAULT-SURFACE*` if unspecified. * `COLOR` is the fill color, of type `SDL:COLOR` or `SDL:COLOR-A`. Bound to `SDL:*DEFAULT-COLOR*` if unspecified.

FLOOD-FILL-STACK (POINT &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

See [FLOOD-FILL-STACK-*](#flood-fill-stack-*). ##### Parameters * POINT is the position to state the fill, of type `POINT`.

FLOOD-FILL-STACK-* (X Y &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

See [FLOOD-FILL-*](#flood-fill-*). `FLOOD-FILL-STACK-*` is maintains an internal array-based stack. *Note*: More of an experiment to see if an array would be faster than a bunch of consing. The timing of both functions indicates they run at the same speed. With compiler declarations it may have better results. Another disadvantage to this is it preallocates the stack, chewing up quite a bit of ram.

FONT-FIXED-WIDTH-P (&KEY (FONT *DEFAULT-FONT*))

Returns `T` if the font face is of a fixed width, or `NIL` otherwise. Fixed width fonts are monospace, meaning every character that exists in the font is the same width. ##### Parameters * `FONT` is a `FONT` object. Binds to `*DEFAULT-FONT*` by default. ##### Returns * Retuns `T` if `FONT` is of fixed width, and `NIL` otherwise. ##### Packages * Supported in _LISPBUILDER-SDL-TTF_

FRAME-RATE (&OPTIONAL (FPSMANAGER *DEFAULT-FPSMANAGER*))

Manage the target frame rate for the game loop. `RATE` > `0` will lock the game loop to the specified frame rate, and calculate the average frame rate over a number of frames. `RATE` = `0` will unlock the frame rate, and calculate the average frame rate over a number of frames. `RATE` < `0` will unlock the frame rate. The average frane rate is not calculated. See [WITH-EVENTS](#with-events), and [AVERAGE-FPS](#average-fps).

FRAME-TIME (&OPTIONAL (FPSMANAGER *DEFAULT-FPSMANAGER*))

Returns how long current frame time is

FULLSCREEN-P

Returns `T` if the video surface is fullscreen. Returns `NIL` if the video surface is windowed.

G-MASK (&OPTIONAL (SURFACE *DEFAULT-SURFACE*))

Returns the green mask of `SURFACE`.

GET-CAPTION

Returns the caption and icon text for the display surface as a spread; (VALUES title-caption icon caption)

GET-CELL (&KEY (SURFACE *DEFAULT-SURFACE*) (INDEX 0))

Returns a [RECTANGLE](#rectangle) describing the bounds of `CELL` at the specified `INDEX`. *Note:* When `SURFACE` is the source of a blit, only the area within the cell rectangle is drawn.

GET-CLIP-RECT (&KEY (SURFACE *DEFAULT-SURFACE*) (RECTANGLE (RECTANGLE)))

Returns the clipping [RECTANGLE](#rectangle).

GET-FONT-ASCENT (&KEY (FONT *DEFAULT-FONT*))

Returns the maximum pixel ascent of all glyphs of font `FONT`. This can also be interpreted as the distance from the top of the font to the baseline. It could be used when drawing an individual glyph relative to a top point, by combining it with the glyph's maxy metric to resolve the top of the rectangle used when blitting the glyph on the screen. ##### Parameters * `FONT` is a `FONT` object. Binds to `*DEFAULT-FONT*` by default. ##### Returns * Returns the ascent of the `FONT` as an `INTEGER`. ##### Packages * Supported in _LISPBUILDER-SDL-TTF_

GET-FONT-DESCENT (&KEY (FONT *DEFAULT-FONT*))

Returns the maximum pixel descent of all glyphs of font `FONT`. This can also be interpreted as the distance from the baseline to the bottom of the font. It could be used when drawing an individual glyph relative to a bottom point, by combining it with the glyph's maxy metric to resolve the top of the rectangle used when blitting the glyph on the screen. ##### Parameters * `FONT` is a `FONT` object. Binds to `*DEFAULT-FONT*` by default. ##### Returns * Returns the descent of the `FONT` as an `INTEGER`. ##### Packages * Supported in _LISPBUILDER-SDL-TTF_

GET-FONT-FACE-FAMILY-NAME (&KEY (FONT *DEFAULT-FONT*))

Returns the current font face family name of font `FONT` or `NIL` if the information is unavailable. ##### Parameters * `FONT` is a `FONT` object. Binds to `*DEFAULT-FONT*` by default. ##### Returns * Returns the name of the `FONT` face family name as a `STRING`, or `NIL` if unavailable. ##### Packages * Supported in _LISPBUILDER-SDL-TTF_

GET-FONT-FACE-STYLE-NAME (&KEY (FONT *DEFAULT-FONT*))

Returns the current font face style name of font `FONT`, or `NIL` if the information is unavailable. ##### Parameters * `FONT` is a `FONT` object. Binds to `*DEFAULT-FONT*` by default. ##### Returns * Returns the name of the `FONT` face style as a `STRING`, or `NIL` if unavailable. ##### Packages * Supported in _LISPBUILDER-SDL-TTF_

GET-FONT-FACES (&KEY (FONT *DEFAULT-FONT*))

Returns the number of faces 'sub-fonts' available in the font `FONT`. This is a count of the number of specific fonts (based on size and style and other typographical features perhaps) contained in the font itself. It seems to be a useless fact to know, since it can't be applied in any other `SDL_TTF` functions. ##### Parameters * `FONT` is a `FONT` object. Binds to `*DEFAULT-FONT*` by default. ##### Returns * Returns the number of faces in the `FONT` as an `INTEGER`. ##### Packages * Supported in _LISPBUILDER-SDL-TTF_

GET-FONT-HEIGHT (&KEY (FONT *DEFAULT-FONT*))

Returns the maximum pixel height of all glyphs of font `FONT`. Use this height for rendering text as close together vertically as possible, though adding at least one pixel height to it will space it so they can't touch. Remember that `SDL_TTF` doesn't handle multiline printing so you are responsible for line spacing, see [GET-FONT-LINE-SKIP](#get-font-line-skip) as well. ##### Parameters * `FONT` is a `FONT` object. Binds to `*DEFAULT-FONT*` by default. ##### Returns * Retuns the height of the `FONT` as an `INTEGER`. ##### Packages * Supported in _LISPBUILDER-SDL_, _LISPBUILDER-SDL-GFX_ and _LISPBUILDER-SDL-TTF_

GET-FONT-LINE-SKIP (&KEY (FONT *DEFAULT-FONT*))

Returns the recommended pixel height of a rendered line of text of the font `FONT`. This is usually larger than the [GET-FONT-HEIGHT](#get-font-height) of the font. ##### Parameters * `FONT` is a `FONT` object. Binds to `*DEFAULT-FONT*` by default. ##### Returns * Returns the pixel height of the `FONT` as an `INTEGER`. ##### Packages * Supported in _LISPBUILDER-SDL-TTF_

GET-FONT-SIZE (TEXT &KEY SIZE (FONT *DEFAULT-FONT*))

Calculates and returns the resulting `SIZE` of the `SDL:SURFACE` that is required to render the text `TEXT`, or `NIL` on error. No actual rendering is performed, however correct kerning is calculated for the actual width. The height returned is the same as returned using [GET-FONT-HEIGHT](#get-font-height). ##### Parameters * `TEXT` is the string to size, of type `STRING`. * `SIZE` must be one of; `:W` for the text width or `:H` for the text height. * `FONT` is the font used to calculate the size of the `TEXT`. Binds to `*DEFAULT-FONT*` by default. ##### Returns * Returns the width or height of the specified `SDL:SURFACE`, or `NIL` upon error. ##### Packages * Supported in _LISPBUILDER-SDL_, _LISPBUILDER-SDL-GFX_ and _LISPBUILDER-SDL-TTF_

GET-FONT-STYLE (&KEY (FONT *DEFAULT-FONT*))

Returns the rendering style of the font `FONT`. If no style is set then `:STYLE-NORMAL` is returned, or `NIL` upon error. ##### Parameters * `FONT` is a `FONT` object. Binfs to `*DEFAULT-FONT*` by default. ##### Returns * Retuns the font style as one or more of: `:STYLE-NORMAL`, `:STYLE-BOLD`, `:STYLE-ITALIC`, `:STYLE-UNDERLINE` ##### Packages * Supported in _LISPBUILDER-SDL-TTF_

GET-GLYPH-METRIC (CH &KEY METRIC (FONT *DEFAULT-FONT*))

Returns the glyph metrics `METRIC` for the character `CH`, or `NIL` upon error. ##### Parameters * `CH` is a UNICODE chararacter specified as an `INTEGER`. * `FONT` is a `FONT` object from which to retrieve the glyph metrics of the character `CH`. Binds to `*DEFAULT-FONT*` by default. * `METRIC` is a `KEY`word argument and may be one of; `:MINX`, for the minimum `X` offset. `:MAXX`, for the maximum `X` offset. `:MINY`, for the minimum `Y` offset. `:MAXY`, for the maximum `Y` offset. `:ADVANCE`, for the advance offset. ##### Returns * Returns the glyph metric as an `INTEGER`. ##### Example (GET-GLYPH-METRIC UNICODE-CHAR :METRIC :MINX :FONT *DEFAULT-FONT*) ##### Packages * Supported in _LISPBUILDER-SDL-TTF_

GET-NATIVE-WINDOW

Returns a foreign pointer to the native SDL display window.

HANDLE-KEY-DOWN (KEY)

You must call this when a key up event occurs ##### Parameters * `KEY` is the SDL key definition for the key that is now down (for example :SDL-KEY-ESCAPE) ##### Returns

HANDLE-KEY-UP (KEY)

You must call this when a key up event occurs ##### Parameters * `KEY` is the SDL key definition for the key that is now up (for example :SDL-KEY-ESCAPE) ##### Returns

HANDLE-MOUSE-DOWN (BUTTON)

You must call this when a mouse button down event occurs ##### Parameters * `BUTTON` is the SDL mouse button definition for the button that is now down. This can be one of MOUSE-LEFT, MOUSE-MIDDLE, MOUSE-RIGHT, MOUSE-WHEEL-UP, MOUSE-WHEEL-DOWN, MOUSE-X1, or MOUSE-X2. ##### Returns

HANDLE-MOUSE-UP (BUTTON)

You must call this when a mouse button up event occurs ##### Parameters * `BUTTON` is the SDL mouse button definition for the button that is now up. This can be one of MOUSE-LEFT, MOUSE-MIDDLE, MOUSE-RIGHT, MOUSE-WHEEL-UP, MOUSE-WHEEL-DOWN, MOUSE-X1, or MOUSE-X2. ##### Returns

INIT-SDL (&KEY FLAGS FORCE VIDEO CDROM AUDIO JOYSTICK NO-PARACHUTE)

Initalizes the SDL library.

INIT-SUBSYSTEMS (SUBSYSTEMS &OPTIONAL FORCE)

Initializes only the SDL subsystems specified in `FLAGS` that are not already initialized. `subsystems` is a list containing the one or more of: `SDL-INIT-VIDEO`, `SDL-INIT-CDROM`, `SDL-INIT-AUDIO`, `SDL-INIT-JOYSTICK`, and `SDL-INIT-NOPARACHUTE`. `INIT-SUBSYSTEMS` can be called only after SDL is succesfully initialized by [INIT-SDL](#init-sdl).

INITIALISE-DEFAULT-FONT (&OPTIONAL (FONT-DEFINITION (IF *GFX-LOADED-P* *GFX-FONT-8X8* *FONT-8X8*)))

Returns a new [SDL-BITMAP-FONT](#sdl-bitmap-font) initialized from `FONT-DEFINITION` data, or `NIL` if the font cannot be created. `FONT-DEFINITION` is set to `*font-8x8*` if unspecified. Binds the symbol `*DEFAULT-FONT*` to the new font to be used as the default for subsequent font rendering or drawing operations. ##### Packages * Aslo supported in _LISPBUILDER-SDL-GFX_

INITIALISE-INPUT-UTIL

Initialises the input util system. This just creates the data structure that input status information is stored in, and maintains a global variable to track initialisation status. ##### Parameters ##### Returns

INITIALIZE-SUBSYSTEMS-ON-STARTUP (&REST FLAGS)

Sets the SDL subsystems that must be initialized in calls to [INIT-SUBSYSTEMS](#init-subsystems). ##### Parameters * `FLAGS` may be one or more of: `SDL-INIT-VIDEO`, `SDL-INIT-CDROM`, `SDL-INIT-AUDIO`, `SDL-INIT-JOYSTICK` and `SDL-INIT-NOPARACHUTE`, or `NIL` to not initialize any subsystems. ##### Returns * Returns an INTEGER bitmask of the SDL subsystems in `FLAGS`. ##### Example (INITIALIZE-SUBSYSTEMS-ON-STARTUP SDL:SDL-INIT-VIDEO SDL:SDL-INIT-CDROM)

INITIALIZED-SUBSYSTEMS-P (&OPTIONAL SUBSYSTEM)

Returns a list of the initialized SDL subsystems.

IS-VALID-PTR (POINTER)

Returns T if pointer is not NULL and is a valid CFFI pointer to a foreign object.

KEY-DOWN-P (KEY)

Returns `KEY` if currently depressed, returns NIL otherwise. Note: Use SDL_PumpEvents to update the state array. Note: This function returns the current state after all events have been processed, so if a key or button has been pressed and released before you process events, then the pressed state will never show up in the getstate calls. Note: This function doesn't take into account whether shift is currently depressed. For example: (KEY-DOWN-P :SDL-KEY-F1)

KEY-HELD-P (KEY)

Returns the time that the key has been held for, which means it has either just been pressed, or it has been pressed and held for a while. ##### Parameters * `KEY` is the SDL key definition (for example :SDL-KEY-ESCAPE) ##### Returns `T` if the key is held

KEY-PRESSED-P (KEY)

Returns `T` if a key has just been pressed ##### Parameters * `KEY` is the SDL key definition (for example :SDL-KEY-ESCAPE) ##### Returns `T` if the key was just pressed

KEY-RELEASED-P (KEY)

Returns `T` if a key has just been released ##### Parameters * `KEY` is the SDL key definition (for example :SDL-KEY-ESCAPE) ##### Returns `T` if the key was just pressed

KEY-REPEAT-DELAY

Returns the current key repeat delay, in milliseconds.

KEY-REPEAT-ENABLED-P

Returns the current keyboard DELAY and INTERVAL repeat rate in milliseconds as (VALUES DELAY INTERVAL).

KEY-REPEAT-INTERVAL

Returns the current key repeat interval, in milliseconds.

KEY-STATE-P (&OPTIONAL KEY)

Returns all keys that are currently depressed as a LIST. Returns KEY if KEY is currently depressed, returns NIL otherwise. Note: Use SDL_PumpEvents to update the state array. Note: This function gives you the current state after all events have been processed, so if a key or button has been pressed and released before you process events, then the pressed state will never show up in the getstate calls. Note: This function doesn't take into account whether shift is currently depressed. For example: (KEY-STATE-P :SDL-KEY-F1)

KEY-TIME-IN-CURRENT-STATE (KEY)

Returns time a key has been in current state ##### Parameters * `KEY` is the SDL key definition (for example :SDL-KEY-ESCAPE) ##### Returns Time key is in current state

KEY-TIME-IN-PREVIOUS-STATE (KEY)

Returns time key was in a previous state ##### Parameters * `KEY` is the SDL key definition (for example :SDL-KEY-ESCAPE) ##### Returns Time key was in previous state

KEYS-DOWN-P

Returns all keys that are currently depressed as a LIST. Note: Use SDL_PumpEvents to update the state array. Note: This function returns the current state after all events have been processed, so if a key or button has been pressed and released before you process events, then the pressed state will never show up in the getstate calls. Note: This function doesn't take into account whether shift is currently depressed. For example: (KEYS-DOWN-P)

LIST-MODES (&REST FLAGS)

Returns a LIST of vectors sorted largest to smallest containing window or screen dimensions that will support the specified video `FLAGS`. `LIST-MODES` must be called after SDL is initialised using [INIT-SDL](#init-sdl) or [WITH-INIT](#with-init). ##### Parameters * `FLAGS` is one or more of the following; [SDL-SW-SURFACE](#sdl-sw-surface), [SDL-HW-SURFACE](#sdl-hw-surface), [SDL-ASYNC-BLIT](#sdl-async-blit), [SDL-ANY-FORMAT](#sdl-any-format), [SDL-HW-PALETTE](#sdl-hw-palette), [SDL-DOUBLEBUF](#sdl-doublebuf), [SDL-FULLSCREEN](#sdl-fullscreen), [SDL-OPENGL](#sdl-opengl), [SDL-RESIZABLE](#sdl-resizable) and [SDL-NO-FRAME](#sdl-no-frame). * `SURFACE` A surface of type [SDL-SURFACE](#sdl-surface]), or `NIL`. WHEN `NIL`, the pixel format will be that returned by [SDL-GET-VIDEO-INFO](#sdl-get-video-info]). ##### Returns * Returns a list of `VECTOR`s of display dimensions, sorted largest to smallest, that will support the pixel format of surface `SURFACE`; for example `(#(1024 768) #(640 480) #(512 384) #(320 240))`. Returns `NIL` if there are no dimensions available for a particular pixel format. Returns `T` if any dimension will support the pixel format and video flags. ##### Example (LIST-MODES SDL-HW-SURFACE SDL-FULLSCREEN)

LIST-SUBSYSTEMS (FLAG)

Returns a list of SDL subsystems that are specified in `FLAGS`. `FLAGS` is an `INTEGER` bitmask containing the logior of zero or more of: `SDL-INIT-VIDEO`, `SDL-INIT-CDROM`, `SDL-INIT-AUDIO`, `SDL-INIT-JOYSTICK` and `SDL-INIT-NOPARACHUTE`.

MOD-DOWN-P (MOD)

Returns `MOD` if currently depressed, returns NIL otherwise. Note: Use SDL_PumpEvents to update the state array. Note: This function gives you the current state after all events have been processed, so if a key or button has been pressed and released before you process events, then the pressed state will never show up in the getstate calls. For example: (MOD-DOWN-P :SDL-KEY-MOD-LCTRL)

MOD-STATE-P (&OPTIONAL KEY)

Returns all modifier keys that are currently depressed as a LIST. Returns KEY if KEY is currently depressed, returns NIL otherwise. Note: Use SDL_PumpEvents to update the state array. Note: This function gives you the current state after all events have been processed, so if a key or button has been pressed and released before you process events, then the pressed state will never show up in the getstate calls. For example: (GET-MOD-STATE :SDL-KEY-MOD-LCTRL)

MODS-DOWN-P

Returns all modifier keys that are currently depressed as a LIST. Note: Use SDL_PumpEvents to update the state array. Note: This function gives you the current state after all events have been processed, so if a key or button has been pressed and released before you process events, then the pressed state will never show up in the getstate calls. For example: (MODS-DOWN-P)

MOUSE-BUTTONS (&OPTIONAL (BUTTON (GET-MOUSE-BUTTON)))

Returns a list of the currently depressed mouse buttons.

MOUSE-HELD-P (BUTTON)

Returns the time that the mouse `BUTTON` has been held, which means the mouse button has either just been pressed, or it has been pressed and held for a while. ##### Parameters * `BUTTON` can be one of MOUSE-LEFT, MOUSE-MIDDLE, MOUSE-RIGHT, MOUSE-WHEEL-UP, MOUSE-WHEEL-DOWN, MOUSE-X1, or MOUSE-X2. ##### Returns `T` if the mouse button is held

MOUSE-LEFT-P (&OPTIONAL (BUTTON (GET-MOUSE-BUTTON)))

Returns `T` when the left mouse button is depressed.

MOUSE-MIDDLE-P (&OPTIONAL (BUTTON (GET-MOUSE-BUTTON)))

Returns `T` when the middle mouse button is depressed.

MOUSE-POSITION

Returns the absolute mouse x and y curser position as a `VECTOR`.

MOUSE-PRESSED-P (BUTTON)

Returns `T` if the mouse `BUTTON` has just been pressed ##### Parameters * `BUTTON` can be one of MOUSE-LEFT, MOUSE-MIDDLE, MOUSE-RIGHT, MOUSE-WHEEL-UP, MOUSE-WHEEL-DOWN, MOUSE-X1, or MOUSE-X2. ##### Returns `T` if the mouse was just pressed

MOUSE-RELATIVE-POSITION

Returns the relative mouse x and y curser position since the last call to `MOUSE-RELATIVE-POSITION`.

MOUSE-RELEASED-P (BUTTON)

Returns `T` if the mouse `BUTTON` has just been released ##### Parameters * `BUTTON` can be one of MOUSE-LEFT, MOUSE-MIDDLE, MOUSE-RIGHT, MOUSE-WHEEL-UP, MOUSE-WHEEL-DOWN, MOUSE-X1, or MOUSE-X2. ##### Returns `T` if the mouse was just pressed

MOUSE-RIGHT-P (&OPTIONAL (BUTTON (GET-MOUSE-BUTTON)))

Returns `T` when the right mouse button is depressed.

MOUSE-TIME-IN-CURRENT-STATE (BUTTON)

Returns time a mouse `BUTTON` has been in current state ##### Parameters * `BUTTON` can be one of MOUSE-LEFT, MOUSE-MIDDLE, MOUSE-RIGHT, MOUSE-WHEEL-UP, MOUSE-WHEEL-DOWN, MOUSE-X1, or MOUSE-X2. ##### Returns Time mouse is in current state

MOUSE-TIME-IN-PREVIOUS-STATE (BUTTON)

Returns time mouse button was in a previous state ##### Parameters * `BUTTON` can be one of MOUSE-LEFT, MOUSE-MIDDLE, MOUSE-RIGHT, MOUSE-WHEEL-UP, MOUSE-WHEEL-DOWN, MOUSE-X1, or MOUSE-X2. ##### Returns Time mouse was in previous state

MOUSE-WHEEL-DOWN-P (&OPTIONAL (BUTTON (GET-MOUSE-BUTTON)))

Returns `T` when the mouse wheel has been moved down.

MOUSE-WHEEL-UP-P (&OPTIONAL (BUTTON (GET-MOUSE-BUTTON)))

Returns `T` when the mouse wheel has been moved up.

MOUSE-X

Returns the absolute mouse x curser position.

MOUSE-X1-P (&OPTIONAL (BUTTON (GET-MOUSE-BUTTON)))

Returns `T` when the X1 mouse button is depressed.

MOUSE-X2-P (&OPTIONAL (BUTTON (GET-MOUSE-BUTTON)))

Returns `T` when the X2 mouse button is depressed.

MOUSE-Y

Returns the absolute mouse y curser position.

NEW-EVENT (&OPTIONAL (EVENT-TYPE NO-EVENT))

Creates a new `SDL_Event` and of `EVENT-TYPE`. An event of type `:NO-EVENT` is created if the `OPTIONAL` event type `EVENT-TYPE` is unspecified. ##### Example (NEW-EVENT :QUIT-EVENT)

OPENGL-CONTEXT-P

Returns `T` if the video surface has an OpenGL context, or returns `NIL` otherwise.

POINT (&KEY (X 0) (Y 0))

Creates a new `POINT` set to the specified horizontal `X` and vertical `Y` coordinate.

PUMP-EVENTS

Pumps the event loop, gathering events from the input devices. `PUMP-EVENTS` gathers all the pending input information from devices and places it on the event queue. Without calls to SDL_PumpEvents no events would ever be placed on the queue. Often the need for calls to SDL_PumpEvents is hidden from the user since [SDL-POLL-EVENT](#sdl-poll-event) and [SDL-WAIT-EVENT](#sdl-wait-event) implicitly call `PUMP-EVENTS`. However, if you are not polling or waiting for events (e.g. you are filtering them), then you must call `PUMP-EVENTS` to force an event queue update. Note: Only call this function in the thread that set the video mode.

PUSH-QUIT-EVENT

Pushes a new `SDL_Event` of type `:QUIT-EVENT` onto the event queue.

PUSH-USER-EVENT (&KEY (CODE 0) (DATA1 NIL) (DATA2 NIL))

Pushes a new `SDL_Event` of type `:USER-EVENT` onto the event queue.

QUERY-CURSOR

Queries the current state of the cursor. Returns `T` if the cursor is enabled and shown on the display. Returns `NIL` if the cursor is disabled and hidden.

QUIT-INPUT-UTIL

This is called when you quit your app to free up input information data ##### Parameters ##### Returns

QUIT-ON-EXIT-P

Returns `T` if the SDL library will be uninitialised in a call to [QUIT-SDL](#quit-sdl), or [WITH-INIT](#with-init). Returns `NIL` otherwise.

QUIT-REQUESTED-P

Returns the number of quit-events on the queue or `NIL` otherwise.

QUIT-SUBSYSTEMS (SUBSYSTEMS &OPTIONAL FORCE)

Uninitializes only the SDL subsystems specified in the `FLAGS` that are already initialized. `subsystems` is a list containing the one or more of: `SDL-INIT-VIDEO`, `SDL-INIT-CDROM`, `SDL-INIT-AUDIO`, `SDL-INIT-JOYSTICK` and `SDL-INIT-NOPARACHUTE`. `QUIT-SUBSYSTEMS` can be called only after SDL is successfully intialized using [INIT-SDL](#init-sdl).

QUIT-SUBSYSTEMS-ON-EXIT (&REST FLAGS)

Sets one or more SDL subsystems that must *not* be uninitialized in calls to [QUIT-SUBSYSTEMS](#quit-subsystems). ##### Parameters * `FLAGS` may be one or more of: `SDL-INIT-VIDEO`, `SDL-INIT-CDROM`, `SDL-INIT-AUDIO`, `SDL-INIT-JOYSTICK` and `SDL-INIT-NOPARACHUTE` , or `NIL` to not uninitialize any subsystems. ##### Returns * Returns an INTEGER bitmask of the SDL subsystems in `FLAGS`. ##### Example (QUIT-SUBSYSTEMS-ON-EXIT SDL:SDL-INIT-VIDEO SDL:SDL-INIT-CDROM)

R-MASK (&OPTIONAL (SURFACE *DEFAULT-SURFACE*))

Returns the red mask of `SURFACE`.

RANDOM+1 (RND)

Returns a random number in the range 0 > num <= rnd.

RANDOM-RECTANGLE (BOUND-W BOUND-H &OPTIONAL (RECTANGLE (RECTANGLE)))

Creates and return s a new `RECTANGLE` of random x, y width and height within the specified bounds of width `BOUND-W` and height `BOUND-H`. `RECTANGLE` if unset will force the creation of a new `RECTANGLE` object. `RECTANGLE` if set will be modified with the coordinates.

READ-PIXEL (POINT &KEY (CLIPPING T) (SURFACE *DEFAULT-SURFACE*))

See [READ-PIXEL-*](#read-pixel-*). ##### Parameters * `POINT` is the [POINT](#point) coordinates of the pixel. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

READ-PIXEL-* (X Y &KEY (CLIPPING T) (SURFACE *DEFAULT-SURFACE*))

Read the [COLOR](#color) of the pixel at `X` and `Y` coordiates from [SURFACE](#surface). ##### Parameters * `X` and `Y` specify the coordinates of the pixel, and are of type `INTEGER`. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the pixel color, of [COLOR](#color) or [COLOR-A](#color-a). * `:CLIPPING` when left as the default value `T` will ensure that the pixel is clipped to the dimensions of `SURFACE`. SDL will core dump if pixels are drawn outside a surface. It is slower, but safer to leave `CLIPPING` as `T`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

RECTANGLE (&KEY (X 0) (Y 0) (W 0) (H 0) (FP NIL))

Creates a new `RECTANGLE` from the specified `X`, `Y`, width `W` and height `H`. If `FP' is `NIL` then a foreign SDL_Rect is created. If `FP` is a pointer to a foreign SDL_Rect object then `FP` is used.

RECTANGLE-FROM-EDGES (P1 P2 &OPTIONAL (RECTANGLE (RECTANGLE)))

See [RECTANGLE-FROM-EDGES-*](#rectangle-from-edges-*). * `P1` and `P2` are `POINTS` that specify the bounds of the `RECTANGLE`. `P1` specifies the top left coordinate. `P2` specifies the lower right coordinate.

RECTANGLE-FROM-EDGES-* (X1 Y1 X2 Y2 &OPTIONAL (RECTANGLE (RECTANGLE)))

Returns a new `RECTANGLE` using the bounds specified by the `INTEGERS` `X1`, `X2`, `Y1` and `Y2`. The coordinates of the rectangle are X = X1, Y = Y1, WIDTH = (- X2 X1), HEIGHT = (- Y2 Y1) ##### Parameters * `X1`, `Y1` specify the top left coordinate as `INTEGERS`. * `X2`, `Y2` specify the bottom right coordinate as `INTEGERS`. * `RECTANGLE` if unset will force the creation of a new `RECTANGLE` object. `RECTANGLE` if set will be modified with the coordinates.

RECTANGLE-FROM-MIDPOINT-* (X Y W H &OPTIONAL (RECTANGLE (RECTANGLE)))

Returns a `RECTANGLE` of width `W` and height `H` with the rectangle mid-point at coordinates `X` and `Y`. `RECTANGLE` if unset will force the creation of a new `RECTANGLE` object. `RECTANGLE` if set will be modified with the coordinates.

REMOVE-ALL-EVENT-FILTERS

Removes any existing event filters. that were set with `SET-EVENT-FILTERS`

REMOVE-EVENT-FILTER (SDL-EVENT)

Removes any existing event filters. that were set with `SET-EVENT-FILTERS`

RENDER-STRING-BLENDED (STRING &KEY (FONT *DEFAULT-FONT*) (COLOR *DEFAULT-COLOR*) (FREE NIL) (CACHE NIL))

Render the string `STRING` using font `FONT` with text color `COLOR` to a new `SURFACE`. The dimensions of the new surface are height == `FONT` height, and width == `FONT` width * `STRING` length. The surface background is transparent and therefore can be keyed over other surfaces. Use `:CACHE T` to cache the new surface in the `FONT` object. When `:FREE T` any exisiting cached surface in `FONT` is automatically freed. When `:FREE NIL` the caller is responsible for freeing any existing cached surface in `FONT`. ##### Parameters * `STRING` is the text to render. * `FONT` is the font face used to render the `STRING`. Of type `FONT`. Bound to `*DEFAULT-FONT*` if unspecified. * `COLOR` color is the text color, of type `COLOR`. * `FREE` when `T` will free any exisitng cached surface in `FONT`. * `CACHE` when `T` will cache the newly created SURFACE in `FONT`. Any cached surface can be accessed using [CACHED-SURFACE](#cached-surface) and can be blitted to a target surface using [DRAW-FONT](#draw-font). ##### Returns * Returns a new cached surface `SDL-SURFACE`. ##### Example (DRAW-STRING-SOLID "Hello World!" :COLOR A-COLOR) ##### Packages * Supported in _LISPBUILDER-SDL-TTF_

RENDER-STRING-SHADED (STRING FG-COLOR BG-COLOR &KEY (FONT *DEFAULT-FONT*) (FREE NIL) (CACHE NIL))

Render the string `STRING` using font `FONT` with text color `FG-COLOR` and background color `BG-COLOR` to a new `SURFACE`. The dimensions of the new surface are height == `FONT` height, and width == `FONT` width * `STRING` length. The surface background is filled with `BG-COLOR` so the surface cannot be keyed over other surfaces. Use `:CACHE T` to cache the new surface in the `FONT` object. When `:FREE T` any exisiting cached surface in `FONT` is automatically freed. When `:FREE NIL` the caller is responsible for freeing any existing cached surface in `FONT`. ##### Parameters * `STRING` is the text to render. * `FONT` is the font face used to render the `STRING`. Of type `FONT`. Bound to `*DEFAULT-FONT*` if unspecified. * `FG-COLOR` color is the text color, of type `COLOR` * `BG-COLOR` color is the background color used to fill the surface, of type `COLOR` * `FREE` when `T` will free any exisiting cached surface in `FONT`. * `CACHE` when `T` will cache the newly created SURFACE in `FONT`. Any cached surface can be accessed using [CACHED-SURFACE](#cached-surface) and can be blitted to a target surface using [DRAW-FONT](#draw-font). ##### Returns * Returns a new cached surface `SDL-SURFACE`. ##### Example (RENDER-STRING-SHADED "Hello World!" F-COLOR B-COLOR) ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

RENDER-STRING-SOLID (STRING &KEY (FONT *DEFAULT-FONT*) (COLOR *DEFAULT-COLOR*) (FREE NIL) (CACHE NIL))

Render the string `STRING` using font `FONT` with text color `COLOR` to a new `SURFACE`. The dimensions of the new surface are height == `FONT` height, and width == `FONT` width * `STRING` length. The surface background is transparent and therefore can be keyed over other surfaces. Use `:CACHE T` to cache the new surface in the `FONT` object. When `:FREE T` any exisiting cached surface in `FONT` is automatically freed. When `:FREE NIL` the caller is responsible for freeing any existing cached surface in `FONT`. ##### Parameters * `STRING` is the text to render. * `FONT` is the font face used to render the `STRING`. Of type `FONT`. Bound to `*DEFAULT-FONT*` if unspecified. * `COLOR` color is the text color, of type `COLOR`. * `FREE` when `T` will free any exisitng cached surface in `FONT`. * `CACHE` when `T` will cache the newly created SURFACE in `FONT`. Any cached surface can be accessed using [CACHED-SURFACE](#cached-surface) and can be blitted to a target surface using [DRAW-FONT](#draw-font). ##### Returns * Returns a new cached surface `SDL-SURFACE`. ##### Example (DRAW-STRING-SOLID "Hello World!" :COLOR A-COLOR) ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_, and _LISPBUILDER-SDL-TTF_

RESIZABLE-P

Returns `T` if the video surface is resizable, returns `NIL` otherwise.

RETURN-SUBSYSTEMS-OF-STATUS (FLAGS STATUS)

Returns the `STATUS` of the the specified SDL subsystems in `FLAGS`. ##### Parameters * `FLAGS` must contain one or more of: `SDL-INIT-VIDEO`, `SDL-INIT-CDROM`, `SDL-INIT-AUDIO`, `SDL-INIT-JOYSTICK`. * `STATUS` when `T` returns the specified initialized subsystems. `STATUS` when `NIL`, returns the specified uninitialised subsystems.

ROTATE-SURFACE-XY (DEGREES &KEY (SURFACE *DEFAULT-SURFACE*) (FREE NIL) (ZOOMX 1) (ZOOMY 1) (SMOOTH NIL) (GFX-LOADED-P *GFX-LOADED-P*))

Returns a new [SURFACE](#surface) rotated to `DEGREES`. ##### Parameters * `DEGREES` is the rotation in degrees. * `:SURFACE` is the surface to rotate [SURFACE](#surface). * `:FREE` when `T` will free `SURFACE`. * `:ZOOMX` and `ZOOMY` are the the scaling factors. A negative scaling factor will flip the corresponding axis. _Note_: Flipping is only supported with anti-aliasing turned off. * `:SMOOTH` when `T` will anti-aliase the new surface. ##### Packages * Supported in _LISPBUILDER-SDL-GFX_ * _LISPBUILDER-SDL-GFX_ ignores `:FREE`.

SET-CAPTION (WINDOW-CAPTION ICON-CAPTION)

Sets the caption text for window bar, and icon.

SET-CELL (RECTANGLE &KEY (SURFACE *DEFAULT-SURFACE*) (INDEX NIL))

Sets the `CELL` at `INDEX` to the bounds of `RECTANGLE`. *Note:* When `SURFACE` is the source of a blit, only the area within the cell rectangle is drawn.

SET-CELL-* (X Y W H &KEY (SURFACE *DEFAULT-SURFACE*) (INDEX NIL))

Sets the `CELL` at `INDEX` to a rectangle bounded by `X`, `Y`, `W` and `H`. *Note:* When `SURFACE` is the source of a blit, only the area within the cell rectangle is drawn.

SET-CLIP-RECT (RECTANGLE &KEY (SURFACE *DEFAULT-SURFACE*))

See [CLIP-RECT](#clip-rect).

SET-EVENT-FILTER (EVENT EVENT-FILTER-HOOK)

Sets the callback function that handles the event filter. Return `NIL` if the event is to be removed from the event queue. Return `T` if the event is to remain on the event queue. `EVENT-FILTER-HOOK` must use the following template; #'(LAMBDA (SDL-EVENT) t) For example; (setf (SDL:SET-EVENT-FILTER :QUIT-EVENT #(LAMBDA (EVENT) t))

SET-FONT-STYLE (STYLE &KEY (FONT *DEFAULT-FONT*))

Sets the rendering style `STYLE` of font `FONT`. This will flush the internal cache of previously rendered glyphs, even if there is no change in style, so it may be best to check the current style using [GET-FONT-STYLE](#get-font-style) first. ##### Parameters * `FONT` is a `FONT` object. * `STYLE` is a list of one or more: `:STYLE-NORMAL`, `:STYLE-BOLD`, `:STYLE-ITALIC`, `:STYLE-UNDERLINE`. NOTE: Combining `:STYLE-UNDERLINE` with anything can cause a segfault, other combinations may also do this. ##### Packages * Supported in _LISPBUILDER-SDL-TTF_

SHOW-CURSOR (STATE)

Disables the cursor when state is `NIL`, otherwise enables the cursor.

SURFACE-INFO (SURFACE &OPTIONAL (INFO NIL))

Returns information about the SDL surface `SURFACE`. ##### Parameters * `SURFACE` is an SDL surface of type [SDL-SURFACE](#sdl-surface). * `INFO` must be one of `NIL`, [SDL-SW-SURFACE](#sdl-sw-surface), [SDL-HW-SURFACE](#sdl-hw-surface), [SDL-ASYNC-BLIT](#sdl-async-blit), [SDL-ANY-FORMAT](#sdl-any-format), [SDL-HW-PALETTE](#sdl-hw-palette), [SDL-DOUBLEBUF](#sdl-doublebuf), [SDL-FULLSCREEN](#sdl-fullscreen), [SDL-OPENGL](#sdl-opengl), [SDL-RESIZABLE](#sdl-resizable) [SDL-HW-ACCEL](#sdl-hw-accel), [SDL-SRC-COLOR-KEY](#sdl-src-color-key), [SDL-RLE-ACCEL](#sdl-rle-accel), [SDL-SRC-ALPHA](#sdl-src-alpha) or [SDL-PRE-ALLOC](#sdl-pre-alloc). ##### Returns `INFO` when `NIL` will return a list of all enabled surface flags. Otherwise will return `INFO` as `T` or `NIL` if supported by the surface. ##### Example (SURFACE-INFO A-SURFACE '(SDL-HW-SURFACE SDL-HW-PALETTE SDL-HW-ACCELL))

TO-DEGREE (RADIAN)

Converts radians to degrees.

TO-RADIAN (DEGREE)

Converts degrees to radians.

UNICODE-ENABLED-P

Queries the current state of Unicode keyboard translation. Returns T if enabled, NIL if disabled.

UPDATE-DISPLAY (&OPTIONAL (SURFACE *DEFAULT-DISPLAY*))

`UPDATE-DISPLAY` will flip the SDL video buffers and update the screen `SURFACE` if `SDL-HW-SURFACE` is set in [WINDOW](#window). If double buffering is not enabled then SDL will perform an [SDL-UPDATE-RECT](#sdl-update-rect) on the entire screen. If there is an active OpenGL contenxt, then `UPDATE-DISPLAY` will call [SDL-GL-SWAP-BUFFERS](#sdl-gl-swap-buffers) to update the OpenGL display display. `SURFACE` is bound to `*DEFAULT-DISPLAY*` if unspecified.

UPDATE-INPUT-UTIL (TIME)

This must be called once for each time period you are updating the application, in order to update key, mouse button & joystick information. ##### Parameters * `TIME` is the time in seconds this update represents ##### Returns

UPDATE-SURFACE (SURFACE &OPTIONAL TEMPLATE)

Updates the surface

UPDATE-SURFACE-* (SURFACE X Y W H)

See [UPDATE-SURFACE](#update-surface).

VIDEO-DIMENSIONS

Returns the best video dimensions if called before a window is created, using [WINDOW](#window). Returns the current video dimensions if called after a window is created. Must be called after SDL is initialized using [INIT-SDL](#init-sdl) or [WITH-INIT](#with-init)

VIDEO-DRIVER-NAME

Returns the driver name of the initialised video driver. The driver name is a `STRING` containing a one-word identifier like "x11" or "windib". Returns 'NIL' if the video driver is not already initialised with [INIT-SDL](#init-sdl) or [WITH-INIT](#with-init). ##### Example (sdl:with-init () (sdl:video-driver-name)) >> "windib"

VIDEO-INFO (&REST INFO)

Returns information about the video hardware. `VIDEO-INFO` must be called after SDL is initialised using [INIT-SDL](#init-sdl) or [WITH-INIT](#with-init). If `VIDEO-INFO` is called before [WINDOW](#window), the information returned is of the *best* video mode. If `VIDEO-INFO` is called after [WINDOW](#window), the information returned is of the *current* video mode. ##### Parameters * `INFO` can be one of `:HW-AVAILABLE`, `:WM-AVAILABLE`, `:BLIT-HW`, `:BLIT-HW-CC`, `:BLIT-HW-A`, `:BLIT-SW`, `:BLIT-SW-CC`, `:BLIT-SW-A`or `:BLIT-FILL`. If `NIL`, returns a list of all supported video flags. ##### Example (video-info :HW-AVAILABLE)

VIDEO-MEMORY

Returns the amount of video memory of the graphics hardware. Must be called after SDL is initialized using [INIT-SDL](#init-sdl) or [WITH-INIT](#with-init).

WITHIN-RANGE (P1 P2 DISTANCE)

Returns true `T`, if the distance between the `POINT`s `P1` `P2` is <= the distance `DISTANCE`.

WITHIN-RANGE-* (X1 Y1 X2 Y2 DISTANCE)

Returns true `T`, if the distance between the coordinates `X1`, `Y1` and `X2`, `Y2` is <= the distance `DISTANCE`.

ZOOM-SURFACE (ZOOMX ZOOMY &KEY (SURFACE *DEFAULT-SURFACE*) (FREE NIL) (SMOOTH NIL) (GFX-LOADED-P *GFX-LOADED-P*))

Returns a new [SURFACE](#surface) scaled to `ZOOMX` and `ZOOMY`. ##### Parameters * `:ZOOMX` and `ZOOMY` are the scaling factors. A negative scaling factor will flip the corresponding axis. _Note_: Flipping is only supported with anti-aliasing turned off. * `:SURFACE` is the surface to rotate [SURFACE](#surface). * `:FREE` when `T` will free `SURFACE`. * `:SMOOTH` when `T` will anti-aliase the new surface. ##### Packages * Supported in _LISPBUILDER-SDL-GFX_ * _LISPBUILDER-SDL-GFX_ ignores `:FREE`.

Undocumented

ACTIVE-EVENT-P (EVENT)

ACTIVE-GAIN-P (GAIN &OPTIONAL (STATE (SDL-GET-APP-STATE)))

ACTIVE-P (&OPTIONAL (STATE (SDL-GET-APP-STATE)))

AUDIO-INIT-P

AUDIO-OPENED-P

AUDIO-PAUSED-P (&OPTIONAL OBJ)

BLIT-FILL-P

BLIT-HW-CC-P

BLIT-HW-P

BLIT-SW-A-P

BLIT-SW-CC-P

BLIT-SW-P

CATMULL-ROM-SPLINE (VAL V0 V1 V2 V3)

CDROM-INIT-P

CLOSE-AUDIO

COPY-CHANNEL-TO-ALPHA (DESTINATION SOURCE &KEY (CHANNEL R))

CREATE-SIMPLE-FONT-DEFINITION (WIDTH HEIGHT CHAR-MAP CHAR-MASK COLOR-KEY FILENAME LOADER)

DRAW-AA-CIRCLE (P1 R &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-AA-CIRCLE-* (X Y R &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-AA-ELLIPSE (P1 RX RY &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-AA-LINE (P1 P2 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-AA-LINE-* (X1 Y1 X2 Y2 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-AA-POLYGON (VERTICES &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-AA-TRIGON (P1 P2 P3 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-ARC (P1 RAD START END &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-ARC-* (X Y RAD START END &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-BEZIER (VERTICES &KEY (CLIPPING T) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (SEGMENTS 20) (STYLE SOLID) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-CHARACTER-SOLID-* (C X Y &KEY (FONT *DEFAULT-FONT*) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-CIRCLE-* (X0 Y0 R &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (ALPHA NIL) (AA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-FILLED-CIRCLE-* (X0 Y0 R &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (STROKE-COLOR NIL) (ALPHA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-HLINE (X0 X1 Y &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (CLIPPING NIL) (TEMPLATE NIL) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-PIXEL-* (X Y &KEY (CLIPPING T) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-POLYGON (VERTICES &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (CLIPPING T) (AA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-TRIGON (P1 P2 P3 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (CLIPPING T) (AA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-VLINE (X Y0 Y1 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (CLIPPING NIL) (TEMPLATE NIL) (GFX-LOADED-P *GFX-LOADED-P*))

DT (&OPTIONAL (FPSMANAGER *DEFAULT-FPSMANAGER*))

EVENT-TYPE (SDL-EVENT)

SETFFRAME-RATE (RATE &OPTIONAL (FPSMANAGER *DEFAULT-FPSMANAGER*))

FREE-EVENT (EVENT*)

GET-EVENT (EVENT)

GET-EVENT-TYPE (SDL-EVENT)

GET-KEY-STATE (KEY)

GET-KEYS-STATE

GET-LIBRARY-VERSION (VERSION)

GET-MOD-STATE (KEY)

GET-MODS-STATE

GET-SURFACE-RECT (&KEY (SURFACE *DEFAULT-SURFACE*) (RECTANGLE (RECTANGLE)))

HW-AVAILABLE-P

IDLE-EVENT-P (EVENT)

IMAGE-INIT-P (&REST FLAGS)

IMAGE-LIBRARY-VERSION

IMAGE-VERSION-AT-LEAST (X Y Z)

IMAGE-WRAPPER-VERSION

INIT-AUDIO (&OPTIONAL FORCE)

INIT-CDROM (&OPTIONAL FORCE)

INIT-IMAGE (&REST SYSTEMS)

INIT-VIDEO (&OPTIONAL FORCE)

INPUT-FOCUS-P (&OPTIONAL (STATE (SDL-GET-APP-STATE)))

INPUT-GAIN-FOCUS-P (GAIN &OPTIONAL (STATE (SDL-GET-APP-STATE)))

JOY-AXIS-MOTION-EVENT-P (EVENT)

JOY-BALL-MOTION-EVENT-P (EVENT)

JOY-BUTTON-DOWN-EVENT-P (EVENT)

JOY-BUTTON-UP-EVENT-P (EVENT)

JOY-HAT-MOTION-EVENT-P (EVENT)

JOYSTICK-INIT-P

KEY-DOWN-EVENT-P (EVENT)

KEY-UP-EVENT-P (EVENT)

KEY= (KEY1 KEY2)

LOAD-AUDIO (FILENAME)

LOAD-LIBRARY

MAX-DT (&OPTIONAL (FPSMANAGER *DEFAULT-FPSMANAGER*))

MOUSE-BUTTON-DOWN-EVENT-P (EVENT)

MOUSE-BUTTON-UP-EVENT-P (EVENT)

MOUSE-FOCUS-P (&OPTIONAL (STATE (SDL-GET-APP-STATE)))

MOUSE-GAIN-FOCUS-P (GAIN &OPTIONAL (STATE (SDL-GET-APP-STATE)))

MOUSE-MOTION-EVENT-P (EVENT)

NUM-JOYSTICKS

OPEN-AUDIO (&KEY (FREQUENCY +DEFAULT-FREQUENCY+) (FORMAT +DEFAULT-FORMAT+) (CHANNELS +DEFAULT-CHANNELS+) (AUDIO-BUFFER-SIZE +DEFAULT-SAMPLE-BUFFER+) CALLBACK (VOLUME +MAX-VOLUME+))

PAUSE-AUDIO (&OPTIONAL OBJ)

PHYSICS-HOOK-P (&OPTIONAL (FPSMANAGER *DEFAULT-FPSMANAGER*))

PIXEL-BPP (PIXELS)

PIXEL-DATA (PIXELS)

PIXEL-PITCH (PIXELS)

PLAY-AUDIO (&OPTIONAL OBJ &KEY LOOP POS)

QUIT-AUDIO (&OPTIONAL FORCE)

QUIT-CDROM (&OPTIONAL FORCE)

QUIT-EVENT-P (EVENT)

QUIT-IMAGE

QUIT-SDL (&KEY FLAGS FORCE VIDEO CDROM AUDIO JOYSTICK NO-PARACHUTE)

QUIT-VIDEO (&OPTIONAL FORCE)

RESUME-AUDIO (&OPTIONAL OBJ)

ROTATE-SURFACE (DEGREES &KEY (SURFACE *DEFAULT-SURFACE*) (FREE NIL) (ZOOM 1) (SMOOTH NIL) (GFX-LOADED-P *GFX-LOADED-P*))

SDL-GET-TICKS

SDL-GL-GET-PROC-ADDRESS (PROC)

SDL-INIT-P

SDL-JOYSTICK-NAME (DEVICE-INDEX)

SDL-LIBRARY-VERSION

SDL-VERSION-AT-LEAST (X Y Z)

SDL-WM-GRAB-INPUT (MODE)

SDL-WRAPPER-VERSION

SET-AUDIO-DRIVER (DRIVER)

SET-GL-ATTRIBUTE (ATTRIBUTE VALUE)

SET-PHYSICS-HOOK (FN &OPTIONAL (FPSMANAGER *DEFAULT-FPSMANAGER*))

SET-VIDEO-DRIVER (DRIVER)

SUPPORTED-IMAGE-FORMATS

SYS-WM-EVENT-P (EVENT)

SYSTEM-TICKS

TICKS (&OPTIONAL (FPSMANAGER *DEFAULT-FPSMANAGER*))

TIME-SCALE (&OPTIONAL (FPSMANAGER *DEFAULT-FPSMANAGER*))

USER-EVENT-P (EVENT)

VERSION-NUMBER (MAJOR MINOR PATCH)

VIDEO-EXPOSE-EVENT-P (EVENT)

VIDEO-INIT-P

VIDEO-RESIZE-EVENT-P (EVENT)

WM-AVAILABLE-P

WRITE-PIXEL (PIXELS X Y COLOR)

Private

_DRAW-BEZIER_ (VERTICES &KEY (CLIPPING T) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (SEGMENTS 20) (STYLE SOLID) (GFX-LOADED-P *GFX-LOADED-P*))

Draw a bezier curve of [COLOR](#color) to [SURFACE](#surface). The shape of the Bezier curve is defined by several control points. A control point is a vertex containing an X and Y coordinate pair. ##### Parameters * `:VERTICES` is a list of control points of [POINT](#point). * `:STYLE` describes the line style used to draw the curve and may be one of `:SOLID`, `:DASH`, or `:POINTS`. Use `:SOLID` to draw a single continuous line through the specified waypoints. Use `:DASH` to draw a line between alternate waypoint pairs. Use `:POINTS` to draw a single pixel at each waypoint. * `:SEGMENTS` is the number of line segments used to draw the curve. The default is 20 segments if unspecified. The greater the number of segments, the smoother the curve. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the line color, of [COLOR](#color) or [COLOR-A](#color-a). * `:CLIPPING` when left as the default value `T` will ensure that the shape is clipped to the dimensions of `SURFACE`. SDL will core dump if pixels are drawn outside a surface. It is slower, but safer to leave `CLIPPING` as `T`. ##### Example (DRAW-BEZIER (LIST (SDL:POINT :X 60 :Y 40) (SDL:POINT :X 160 :Y 10) (SDL:POINT :X 170 :Y 150) (SDL:POINT :X 60 :Y 150)) :style :SOLID) ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_ * `:STYLE` is ignored in `LISPBUILDER-SDL-GFX`.

_DRAW-BOX-EDGES-*_ (X1 Y1 X2 Y2 &KEY (CLIPPING NIL) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (STROKE-COLOR NIL) (ALPHA NIL))

Draws a filled rectangle of [COLOR](#color) to [SURFACE](#surface). ##### Parameters * `X0` and `Y0` are the `INTEGER` coordinates of the top-left corner of the rectangle. * `X1` and `Y1` are the `INTEGER` coordinates of the bottom-right corner of the rectangle. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the line color, of [COLOR](#color) or [COLOR-A](#color-a). * `:STROKE-COLOR` when not `NIL` will draw a `1` pixel line of color `COLOR` around the perimiter of the box. * `:ALPHA` when between `0` and `255` is used as the alpha transparency value when blitting the rectangle onto `SURFACE`. *Note:* An intermediate surface is created, the rectangle is drawn onto this intermediate surface and then this surface is blitted to `SURFACE`. * `:CLIPPING` is `NIL` The default is `NIL` as the SDL library will perform the necessary clipping automatically. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

_DRAW-CIRCLE-*_ (X0 Y0 R &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (ALPHA NIL) (AA NIL))

Draws a circle circumference of [COLOR](#color) to [SURFACE](#surface). Use [DRAW-FILLED-CIRCLE-*](#draw-filled-circle-*) to draw a filled circle. ##### Parameters * `X` and `Y` specify the center coordinate of the circle, of type `INTEGER`. * `R` is the circle r, of type `INTEGER`. * `:AA` determines if the line is to be drawn using antialiasing. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the line color, of [COLOR](#color) or [COLOR-A](#color-a). * `:ALPHA` when between `0` and `255` is used as the alpha transparency value when blitting the rectangle onto `SURFACE`. *Note:* An intermediate surface is created, the rectangle is drawn onto this intermediate surface and then this surface is blitted to `SURFACE`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_ * `:AA` ignored in _LISPBUILDER-SDL_

_DRAW-FILLED-CIRCLE-*_ (X0 Y0 R &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (STROKE-COLOR NIL) (ALPHA NIL))

Draws a filled circle of [COLOR](#color) to [SURFACE](#surface). ##### Parameters * `X0` and `Y0` specify the center coordinate of the circle, of type `INTEGER`. * `R` is the circle radius, of type `INTEGER`. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the line color, of [COLOR](#color) or [COLOR-A](#color-a). * `:STROKE-COLOR` when not `NIL` will draw a `1` pixel line of color `COLOR` around the perimiter of the box. * `:ALPHA` when between `0` and `255` is used as the alpha transparency value when blitting the rectangle onto `SURFACE`. *Note:* An intermediate surface is created, the rectangle is drawn onto this intermediate surface and then this surface is blitted to `SURFACE`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

_DRAW-HLINE_ (X0 X1 Y &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (CLIPPING NIL) (TEMPLATE NIL))

Draw a horizontal line of [COLOR](#color) from `X0` to `X1` through `Y` onto onto [SURFACE](#surface). ##### Parameters * `X0` and `X1` are the horizontal start and end points of the line, of type `INTEGER`. * `Y` is the vertical `INTEGER` coordinate that the horizontal line must intersect. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the line color, of [COLOR](#color) or [COLOR-A](#color-a). * `:CLIPPING` is `NIL` The default is `NIL` as the SDL library will perform the necessary clipping automatically. * `:TEMPLATE` specifies an optional [RECTANGLE](#rectangle) to fill the surface. Will not free `TEMPLATE`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

_DRAW-PIXEL-*_ (X Y &KEY (CLIPPING T) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

Draw a single pixel of [COLOR](#color) to the [SURFACE](#surface) at the specified `X` and `Y` coordiates. ##### Parameters * `X` and `Y` specify the coordinates of the pixel, and are of type `INTEGER`. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the pixel color, of [COLOR](#color) or [COLOR-A](#color-a). * `:CLIPPING` when left as the default value `T` will ensure that the pixel is clipped to the dimensions of `SURFACE`. SDL will core dump if pixels are drawn outside a surface. It is slower, but safer to leave `CLIPPING` as `T`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

_DRAW-POLYGON_ (VERTICES &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (CLIPPING T) (AA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

Draw the circumference of a polygon of [COLOR](#color) to [SURFACE](#surface) using the vertices in `POINTS`. Use [DRAW-FILLED-POLYGON-*](#draw-filled-polygon-*) to draw a filled polygon. ##### Parameters * `:POINTS` is the list of vertices for the polygon. `POINTS` is a list of `POINT`s. * `:AA` determines if the line is to be drawn using antialiasing. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the pixel color, of [COLOR](#color) or [COLOR-A](#color-a). * `:CLIPPING` when left as the default value `T` will ensure that the pixel is clipped to the dimensions of `SURFACE`. SDL will core dump if pixels are drawn outside a surface. It is slower, but safer to leave `CLIPPING` as `T`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_ * `:AA` ignored in _LISPBUILDER-SDL_

_DRAW-RECTANGLE-EDGES-*_ (X0 Y0 X1 Y1 &KEY (CLIPPING NIL) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (ALPHA NIL))

Draw a rectangle outline of [COLOR](#color) to [SURFACE](#surface). ##### Parameters * `X0` and `Y0` are the `INTEGER` coordinates of the top-left corner of the rectangle. * `X0` and `Y0` are the `INTEGER` coordinates of the bottom-right corner of the rectangle. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the line color, of [COLOR](#color) or [COLOR-A](#color-a). * `:ALPHA` when between `0` and `255` is used as the alpha transparency value when blitting the rectangle onto `SURFACE`. *Note:* An intermediate surface is created, the rectangle is drawn onto this intermediate surface and then this surface is blitted to `SURFACE`. * `:CLIPPING` is `NIL` The default is `NIL` as the SDL library will perform the necessary clipping automatically. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

_DRAW-TRIGON_ (P1 P2 P3 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (CLIPPING T) (AA NIL))

Draw the outline of a trigon or triangle, of [COLOR](#color) to [SURFACE](#surface). Use [DRAW-FILLED-TRIGON-*](#draw-filled-trigon-*) to draw a filled trigon. ##### Parameters * `P1`, `P2` and `P3` specify the vertices of the trigon, of type `SDL:POINT`. * `:AA` determines if the line is to be drawn using antialiasing. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the pixel color, of [COLOR](#color) or [COLOR-A](#color-a). * `:CLIPPING` when left as the default value `T` will ensure that the pixel is clipped to the dimensions of `SURFACE`. SDL will core dump if pixels are drawn outside a surface. It is slower, but safer to leave `CLIPPING` as `T`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_ * `:AA` ignored in _LISPBUILDER-SDL_

_DRAW-VLINE_ (X Y0 Y1 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (CLIPPING NIL) (TEMPLATE NIL))

Draw a vertical line of [COLOR](#color) from `Y0` to `Y1` through `X` onto [SURFACE](#surface). ##### Parameters * `X` is the horizontal `INTEGER` coordinate that the vertical line must intersect. * `Y0` and `Y1` are the vertical start and end points of the line, of `INTEGER`. * `:SURFACE` is the target [SURFACE](#surface). * `:COLOR` is the line color, of [COLOR](#color) or [COLOR-A](#color-a). * `:CLIPPING` is `NIL` The default is `NIL` as the SDL library will perform the necessary clipping automatically. * `:TEMPLATE` specifies an optional [RECTANGLE](#rectangle) to fill the surface. Will not free `TEMPLATE`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

_ROTATE-SURFACE_ (DEGREES &KEY (SURFACE *DEFAULT-SURFACE*) (FREE NIL) (ZOOM 1) (SMOOTH NIL))

Returns a new [SURFACE](#surface) rotated to `DEGREES`. ##### Parameters * `DEGREES` is the rotation in degrees. * `:SURFACE` is the surface to rotate [SURFACE](#surface). * `:FREE` when `T` will free `SURFACE`. * `:ZOOM` is the scaling factor. * `:SMOOTH` when `T` will anti-aliase the new surface. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_ * _LISPBUILDER-SDL_ supports rotations of only `0`, `90`, `180`, or `270` degrees. _LISPBUILDER-SDL-GFX_ supports any rotation. * _LISPBUILDER-SDL_ ignores `:SMOOTH`. _LISPBUILDER-SDL-GFX_ supports `:SMOOTH`. * _LISPBUILDER-SDL_ ignores `:ZOOM`. _LISPBUILDER-SDL-GFX_ supports `:ZOOM`. * _LISPBUILDER-SDL-GFX_ ignores `:FREE`.

CREATE-RWOPS-FROM-BYTE-ARRAY (ARRAY)

Creates and returns a new `RWOPS` object from the Lisp array `ARRAY`.

CURRENT-CELL (&KEY (SURFACE *DEFAULT-SURFACE*))

Returns the [RECTANGLE](#rectangle) describing the bounds of the current `CELL`. *Note:* When `SURFACE` is the source of a blit, only the area within the cell rectangle is drawn.

DRAW-CHARACTER (C P1 FG-COLOR BG-COLOR &KEY (FONT *DEFAULT-FONT*) (SURFACE *DEFAULT-SURFACE*))

See [draw-character-shaded-*](#draw-character-shaded-*). ##### Parameters * `P1` is the `X` and `Y` coordinates to render the text onto `SURFACE`, of type POINT.

DRAW-CHARACTER-* (C X Y FG-COLOR BG-COLOR &KEY (FONT *DEFAULT-FONT*) (SURFACE *DEFAULT-SURFACE*))

Draw the character `C` at location `X` and `Y` using font `FONT` with foreground and background colors `FG-COLOR` and `BG-COLOR` onto surface `SURFACE`. If `BG-COLOR` is `NIL`, then the glyph is rendered using the `SOLID` mode. If `BG-COLOR` is NOT `NIL`, then the glyph is rendered using the `SHADED` mode. ##### Parameters * `C` is the character to render. * `X` and `Y` are the X and Y position coordinates, as `INTEGERS`. * `FG-COLOR` is the foreground color used to render text, of type `COLOR` * `BG-COLOR` is the background color used to render text, of type `COLOR` * `FONT` is the bitmap font used to render the character. Bound to `*DEFAULT-FONT*` if unspecified. * `SURFACE` is the target surface, of type `SDL-SURFACE`. Bound to `*DEFAULT-SURFACE*` if unspecified. ##### Returns * Returns the surface SURFACE. ##### For example: (DRAW-CHARACTER-SHADED-* "Hello World!" 0 0 F-COLOR B-COLOR :SURFACE A-SURFACE)

DRAW-STRING-CENTERED-* (STR X Y FG-COLOR BG-COLOR &KEY (SURFACE *DEFAULT-SURFACE*) (FONT *DEFAULT-FONT*))

Draw the text in the string `STR` *with midpoint centered* at location `X` and `Y` using font `FONT` with foreground and background colors `FG-COLOR` and `BG-COLOR` onto surface `SURFACE`. ##### Parameters * `STR` is the text to render. * `X` and `Y` are the X and Y position coordinates, as `INTEGERS`. * `FG-COLOR` is the foreground color used to render text, of type `COLOR` * `BG-COLOR` is the background color used to render text, of type `COLOR` * `FONT` is the bitmap font used to render the character. Bound to `*DEFAULT-FONT*` if unspecified. * `SURFACE` is the target surface, of type `SDL-SURFACE`. Bound to `*DEFAULT-SURFACE*` if unspecified. ##### Returns * Returns the surface SURFACE.

DRAW-STRING-LEFT-JUSTIFY-* (STR X Y FG-COLOR BG-COLOR &KEY (SURFACE *DEFAULT-SURFACE*) (FONT *DEFAULT-FONT*))

Draw the text in the string `STR` *starting* at location `X` and `Y` using font `FONT` with foreground and background colors `FG-COLOR` and `BG-COLOR` onto surface `SURFACE`. ##### Parameters * `STR` is the text to render. * `X` and `Y` are the X and Y position coordinates, as `INTEGERS`. * `FG-COLOR` is the foreground color used to render text, of type `COLOR` * `BG-COLOR` is the background color used to render text, of type `COLOR` * `FONT` is the bitmap font used to render the character. Bound to `*DEFAULT-FONT*` if unspecified. * `SURFACE` is the target surface, of type `SDL-SURFACE`. Bound to `*DEFAULT-SURFACE*` if unspecified. ##### Returns * Returns the surface SURFACE.

DRAW-STRING-RIGHT-JUSTIFY-* (STR X Y FG-COLOR BG-COLOR &KEY (SURFACE *DEFAULT-SURFACE*) (FONT *DEFAULT-FONT*))

Draw the text in the string `STR` *ending* at location `X` and `Y` using font `FONT` with foreground and background colors `FG-COLOR` and `BG-COLOR` onto surface `SURFACE`. ##### Parameters * `STR` is the text to render. * `X` and `Y` are the X and Y position coordinates, as `INTEGERS`. * `FG-COLOR` is the foreground color used to render text, of type `COLOR` * `BG-COLOR` is the background color used to render text, of type `COLOR` * `FONT` is the bitmap font used to render the character. Bound to `*DEFAULT-FONT*` if unspecified. * `SURFACE` is the target surface, of type `SDL-SURFACE`. Bound to `*DEFAULT-SURFACE*` if unspecified. ##### Returns * Returns the surface SURFACE.

FF-EMPTY-P

Is the stack empty?

FF-EMPTY-STACK

Intializes the stack. Allocates it if necessary.

FILE-TO-BYTE-SEQUENCE (FILEPATH)

Load a file into an Array of unsigned-byte 8

GET-CHARACTER (CHAR FG-COLOR BG-COLOR &KEY (FONT *DEFAULT-FONT*))

Returns the [SURFACE](#surface) asociated with `CHAR`. Returns a new [SURFACE](#surface) if either of the foreground or background colors `FG-COLOR` or `BG-COLOR` are different than specified for the existing surface.

GET-OR-CREATE-INPUT-STATUS (INPUT)

gets the status of a particular input device, for example key, mouse button or joystick. If there is no existing status for the input type then a new status (unknown state) is created and added to the hash table

GET-SURFACE-ATTRIBUTE (SURFACE ATTRIBUTE)

Returns `T` if the attribute is set for the surface surface, or returns `NIL` otherwise.

GFX-DRAW-CHARACTER-SHADED-* (C X Y FG-COLOR BG-COLOR &KEY (FONT *DEFAULT-FONT*) (SURFACE *DEFAULT-SURFACE*))

Draw the character `C` at location `X` `Y` using font `FONT` with text color `FG-COLOR` and background color `BG-COLOR` onto surface `SURFACE`. The surface background is filled with `BG-COLOR` so the surface cannot be keyed over other surfaces. ##### Parameters * `C` is the character to render. * `X` and `Y` are the x and y position coordinates, as `INTEGERS`. * `FG-COLOR` color is the character color, of type `SDL:COLOR` * `BG-COLOR` color is the background color used to fill the surface `SURFACE`, of type `SDL:COLOR` * `FONT` is the font face used to render the character. Of type `FONT`. Bound to `*DEFAULT-FONT*` if unspecified. * `SURFACE` is the target surface, of type `SDL:SDL-SURFACE`. Bound to `SDL:*DEFAULT-SURFACE*` if unspecified. ##### Returns * Returns the surface `SURFACE`. ##### Example (DRAW-CHARACTER-SHADED-* "Hello World!" 0 0 F-COLOR B-COLOR :SURFACE A-SURFACE)

GFX-DRAW-CHARACTER-SOLID-* (C X Y &KEY (FONT *DEFAULT-FONT*) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

Draw character `C` at location `X` `Y` using font `FONT` with text color `COLOR` onto surface `SURFACE`. The character is keyed over `SURFACE`. ##### Parameters * `C` is the character to render. * `X` and `Y` are the x and y position coordinates, as `INTEGERS`. * `FONT` is the font face used to render the character. Of type `FONT`. Bound to `*DEFAULT-FONT*` if unspecified. * `SURFACE` is the target surface, of type `SDL:SDL-SURFACE`. Bound to `SDL:*DEFAULT-SURFACE*` if unspecified. * `COLOR` color is the character color, of type `SDL:COLOR`. ##### Returns * Returns the surface `SURFACE`. ##### Example (DRAW-CHARACTER-SOLID-* "Hello World!" 0 0 :SURFACE A-SURFACE :COLOR A-COLOR)

GLYPH-BG-COLOR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GLYPH-FG-COLOR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GLYPH-SURFACE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

INPUT-EQ (INPUT INPUT-STATUS)

Returns `T` if the input is eq to input-status. ##### Returns `T` if the input is held

INPUT-SET-P (INPUT INPUT-STATUS)

Returns `T` if the status for input has just been set ##### Returns `T` if the input was just pressed

INPUT-STATUS-PREV-STATUS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

INPUT-STATUS-PREV-TIME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

INPUT-STATUS-STATUS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

INPUT-STATUS-TIME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

JOYSTICK-AXIS-X-MOTION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

JOYSTICK-AXIS-Y-MOTION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

JOYSTICK-BALL-X-MOTION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

JOYSTICK-BALL-Y-MOTION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

JOYSTICK-BUTTON-DOWN (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

JOYSTICK-BUTTON-UP (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

JOYSTICK-FP (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

JOYSTICK-HAT-X-MOTION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

JOYSTICK-HAT-Y-MOTION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

JOYSTICK-INDEX (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

JOYSTICK-STATUS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

TIME-IN-CURRENT-STATE (INPUT)

Returns time an input has been in current state ##### Returns Time input is in current state

TIME-IN-PREVIOUS-STATE (INPUT)

Returns time input was in a previous state ##### Returns Time input was in previous state

Undocumented

1/0->T/NIL (VAL)

_DRAW-LINE-*_ (X0 Y0 X1 Y1 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (CLIPPING T) (AA NIL))

ACTIVE-GAIN (SDL-EVENT)

ACTIVE-STATE (SDL-EVENT)

ADJUST-VOLUME (SAMPLE VOLUME)

ADJUST-VOLUME-U8 (SAMPLE VOLUME)

BLIT-HW-A-P

CALCULATE-TIME-SCALE (FPS-MANAGER DELTA-TICKS)

CALCULATED-BUFFER-LENGTH (LEN SRC-FORMAT DST-FORMAT)

CLOSE-JOYSTICK (JOYSTICK)

CONVERT-CHARACTER (CHARACTER PITCH)

CONVERT-CHARACTER-TO-BYTES (CHARACTER)

CONVERT-CHARACTER-TO-PITCH (CHARACTER PITCH)

CONVERT-SIMPLE-FONT (DEFINITION SURFACE)

COPY-GLYPH (INSTANCE)

COPY-INPUT-STATUS (INSTANCE)

COPY-JOYSTICK (INSTANCE)

CREATE-EVENT (SLOT-FN)

CREATE-EVENTS (EVENT-LIST)

DEBUG-VIEW-INPUTS

DRAW-AA-ELLIPSE-* (X Y RX RY &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-BOX-EDGES-* (X0 Y0 X1 Y1 &KEY (CLIPPING NIL) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (STROKE-COLOR NIL) (ALPHA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

DRAW-RECTANGLE-EDGES-* (X0 Y0 X1 Y1 &KEY (CLIPPING NIL) (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (ALPHA NIL) (GFX-LOADED-P *GFX-LOADED-P*))

ELEMENT-SIZE (FORMAT)

EXPAND-EVENT (SDL-EVENT EVENT-TYPE EVENT PARAMS FORMS)

EXPAND-IDLE (FORMS)

EXPAND-QUIT (SDL-EVENT FORMS QUIT)

FF-POP

FF-PUSH (X Y)

FILL-AUDIO-BUFFER (STREAM LEN)

FILL-OUTPUT-BUFFER (OUTPUT AUDIO &KEY LEN)

FROM-S16 (X)

FROM-S8 (X)

FROM-SDL-TYPE (FORMAT)

GENERATE-BEZIER (X0 Y0 X1 Y1 X2 Y2 X3 Y3 &KEY (SEGMENTS 20))

GENERATE-CURVE (P1 P2 P3 P4 SEGMENTS)

GET-GL-ATTRIBUTE (ATTRIBUTE VALUE)

GET-MOUSE-BUTTON

GET-MOUSE-STATUS

GET-RELATIVE-MOUSE-STATUS

GFX-CHARACTER-COLOR (X Y C &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-AA-CIRCLE-* (X Y R &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-AA-ELLIPSE-* (X Y RX RY &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-AA-LINE-* (X0 Y0 X1 Y1 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-AA-POLYGON (VERTICES &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-AA-TRIGON (P1 P2 P3 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-ARC-* (X Y RAD START END &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-BEZIER (VERTICES &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (SEGMENTS 20) (STYLE NIL))

GFX-DRAW-BOX-EDGES-* (X0 Y0 X1 Y1 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-CIRCLE-* (X Y R &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (AA NIL))

GFX-DRAW-ELLIPSE-* (X Y RX RY &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (AA NIL))

GFX-DRAW-FILLED-CIRCLE-* (X Y R &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-FILLED-ELLIPSE-* (X Y RX RY &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-FILLED-PIE-* (X Y RAD START END &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-FILLED-POLYGON (VERTICES &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-FILLED-TRIGON (P1 P2 P3 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-HLINE (X0 X1 Y &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-LINE-* (X0 Y0 X1 Y1 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (AA NIL))

GFX-DRAW-PIE-* (X Y RAD START END &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-PIXEL-* (X Y &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-POLYGON (VERTICES &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (AA NIL))

GFX-DRAW-RECTANGLE-EDGES-* (X0 Y0 X1 Y1 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-DRAW-TRIGON (P1 P2 P3 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*) (AA NIL))

GFX-DRAW-VLINE (X Y0 Y1 &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-FRAME-RATE-DELAY (FPS-MANAGER)

GFX-GET-FRAME-RATE (FPS-MANAGER)

GFX-INIT-FRAME-RATE (FPS-MANAGER)

GFX-PRIMITIVES-SET-FONT (FONTDATA CW CH)

GFX-ROTO-ZOOM-SIZE (WIDTH HEIGHT ANGLE ZOOM)

GFX-ROTO-ZOOM-SIZE-XY (WIDTH HEIGHT ANGLE ZOOMX ZOOMY)

GFX-ROTO-ZOOM-SURFACE (ANGLE ZOOM SMOOTH &KEY (SURFACE *DEFAULT-SURFACE*))

GFX-ROTO-ZOOM-XY (ANGLE ZOOMX ZOOMY SMOOTH &KEY (SURFACE *DEFAULT-SURFACE*))

GFX-SET-FRAME-RATE (FPS-MANAGER RATE)

GFX-STRING-COLOR (X Y C &KEY (SURFACE *DEFAULT-SURFACE*) (COLOR *DEFAULT-COLOR*))

GFX-ZOOM-SURFACE (ZOOMX ZOOMY &KEY (SURFACE *DEFAULT-SURFACE*) (SMOOTH NIL) (FREE NIL))

GFX-ZOOM-SURFACE-SIZE (WIDTH HEIGHT ZOOMX ZOOMY)

GLYPH (CHAR FONT)

SETFGLYPH-BG-COLOR (NEW-VALUE INSTANCE)

SETFGLYPH-FG-COLOR (NEW-VALUE INSTANCE)

GLYPH-P (OBJECT)

SETFGLYPH-SURFACE (NEW-VALUE INSTANCE)

HANDLE-INPUT (INPUT INPUT-STATUS)

IMAGE-IS-BMP (SOURCE)

INIT-JOYSTICK (&OPTIONAL FORCE)

INPUT-STATUS-P (OBJECT)

SETFINPUT-STATUS-PREV-STATUS (NEW-VALUE INSTANCE)

SETFINPUT-STATUS-PREV-TIME (NEW-VALUE INSTANCE)

SETFINPUT-STATUS-STATUS (NEW-VALUE INSTANCE)

SETFINPUT-STATUS-TIME (NEW-VALUE INSTANCE)

JOY-AXIS-MOTION-AXIS (SDL-EVENT)

JOY-AXIS-MOTION-VALUE (SDL-EVENT)

JOY-AXIS-MOTION-WHICH (SDL-EVENT)

JOY-BALL-MOTION-BALL (SDL-EVENT)

JOY-BALL-MOTION-WHICH (SDL-EVENT)

JOY-BALL-MOTION-X-REL (SDL-EVENT)

JOY-BALL-MOTION-Y-REL (SDL-EVENT)

JOY-BUTTON-BUTTON (SDL-EVENT)

JOY-BUTTON-STATE (SDL-EVENT)

JOY-BUTTON-WHICH (SDL-EVENT)

JOY-HAT-MOTION-AXIS (SDL-EVENT)

JOY-HAT-MOTION-VALUE (SDL-EVENT)

JOY-HAT-MOTION-WHICH (SDL-EVENT)

SETFJOYSTICK-AXIS-X-MOTION (NEW-VALUE INSTANCE)

SETFJOYSTICK-AXIS-Y-MOTION (NEW-VALUE INSTANCE)

SETFJOYSTICK-BALL-X-MOTION (NEW-VALUE INSTANCE)

SETFJOYSTICK-BALL-Y-MOTION (NEW-VALUE INSTANCE)

SETFJOYSTICK-BUTTON-DOWN (NEW-VALUE INSTANCE)

SETFJOYSTICK-BUTTON-UP (NEW-VALUE INSTANCE)

SETFJOYSTICK-FP (NEW-VALUE INSTANCE)

SETFJOYSTICK-HAT-X-MOTION (NEW-VALUE INSTANCE)

SETFJOYSTICK-HAT-Y-MOTION (NEW-VALUE INSTANCE)

SETFJOYSTICK-INDEX (NEW-VALUE INSTANCE)

JOYSTICK-P (OBJECT)

SETFJOYSTICK-STATUS (NEW-VALUE INSTANCE)

KEY-KEY (SDL-EVENT)

KEY-MOD (SDL-EVENT)

KEY-MOD-KEY (SDL-EVENT)

KEY-SCANCODE (SDL-EVENT)

KEY-STATE (SDL-EVENT)

KEY-UNICODE (SDL-EVENT)

LOAD-IMAGE-FROM-BYTE-SEQUENCE (ARRAY)

LSB-P (FORMAT)

MAKE-GLYPH (&KEY ((SURFACE DUM35) NIL) ((FG-COLOR DUM36) NIL) ((BG-COLOR DUM37) NIL))

MAKE-INPUT-STATUS (&KEY ((STATUS DUM0) NIL) ((TIME DUM1) NIL) ((PREV-TIME DUM2) NIL) ((PREV-STATUS DUM3) NIL))

MAKE-JOYSTICK (&KEY ((FP DUM42) NIL) ((INDEX DUM43) NIL) ((AXIS-X-MOTION DUM44) NIL) ((AXIS-Y-MOTION DUM45) NIL) ((BUTTON-DOWN DUM46) NIL) ((BUTTON-UP DUM47) NIL) ((HAT-X-MOTION DUM48) NIL) ((HAT-Y-MOTION DUM49) NIL) ((BALL-X-MOTION DUM50) NIL) ((BALL-Y-MOTION DUM51) NIL) ((STATUS DUM52) NIL))

MOUSE-BUTTON-BUTTON (SDL-EVENT)

MOUSE-BUTTON-STATE (SDL-EVENT)

MOUSE-BUTTON-X (SDL-EVENT)

MOUSE-BUTTON-Y (SDL-EVENT)

MOUSE-MOTION-BUTTON (SDL-EVENT)

MOUSE-MOTION-X (SDL-EVENT)

MOUSE-MOTION-X-REL (SDL-EVENT)

MOUSE-MOTION-Y (SDL-EVENT)

MOUSE-MOTION-Y-REL (SDL-EVENT)

MSB-P (FORMAT)

OVERWRITE-ALL (ARRAY VALUE &OPTIONAL (START 0) (END NIL))

PRESSED-P (STATE)

PROCESS-AUDIO

QUIT-JOYSTICK (&OPTIONAL FORCE)

REGISTER-PHYSICS (FN)

RELEASED-P (STATE)

RETRIEVE-LINE (START-X Y WIDTH SURFACE COLOR-KEY)

RETRIEVE-MASK (START-X START-Y WIDTH HEIGHT SURFACE COLOR-KEY)

RETRIEVE-MASK-MAP (MASK SURFACE COLOR-KEY)

RETURN-A-FUNCTION (COLOR)

RETURN-ARGS (PARAMS EVENT EVENT-FP)

RETURN-B-FUNCTION (COLOR)

RETURN-G-FUNCTION (COLOR)

RETURN-INT-TO-DOUBLE-FUNCTION (VALUE)

RETURN-LIST-FOR-ARRAY (POINTS INDEX-TYPE)

RETURN-PACKED-COLOR-FUNCTION (COLOR)

RETURN-R-FUNCTION (COLOR)

RETURN-TRUE-TO-1-FUNCTION (VALUE)

RETURN-WITH-LOCKED-SURFACES (BINDINGS BODY)

RETURN-WITH-RECTANGLE (BINDINGS BODY)

RETURN-WITH-SURFACE (BINDINGS BODY)

RETURN-X-FUNCTION (POS)

RETURN-Y-FUNCTION (POS)

ROTO-ZOOM-SIZE (WIDTH HEIGHT ANGLE ZOOM &KEY (GFX-LOADED-P *GFX-LOADED-P*))

ROTO-ZOOM-SIZE-XY (WIDTH HEIGHT ANGLE ZOOMX ZOOMY &KEY (GFX-LOADED-P *GFX-LOADED-P*))

ROTO-ZOOM-SURFACE (ANGLE ZOOM SMOOTH &KEY (SURFACE *DEFAULT-SURFACE*) (GFX-LOADED-P *GFX-LOADED-P*))

ROTO-ZOOM-XY (ANGLE ZOOMX ZOOMY SMOOTH &KEY (SURFACE *DEFAULT-SURFACE*) (GFX-LOADED-P *GFX-LOADED-P*))

SET-QUIT-ON-EXIT (VAL)

SET-WINDOW-POSITION (POSITION)

SIMPLE-FREE (FUNC-FP TYPE)

SPLIT-CHARACTER (CHARACTER)

SURFACE-POINTER-FUNCTION (SURFACE)

TO-S16 (X)

TO-S8 (X)

USER-CODE (SDL-EVENT)

USER-DATA1 (SDL-EVENT)

USER-DATA2 (SDL-EVENT)

USER-TYPE (SDL-EVENT)

VIDEO-RESIZE-H (SDL-EVENT)

VIDEO-RESIZE-W (SDL-EVENT)

WAV-FREE (FUNC-FP TYPE)

ZOOM-SURFACE-SIZE (WIDTH HEIGHT ZOOMX ZOOMY &KEY (GFX-LOADED-P *GFX-LOADED-P*))

MACRO

Public

ALL-INTEGERS? (&REST VALUES)

Returns `T` if all values are `INTEGERS`.

CAST (TYPE VALUE)

Coerces the value `VALUE` to the type `TYPE`.

CAST-ALL-TO-INT (&REST VALUES)

Casts the values in `REST` to `FIXNUM`s.

CAST-TO-INT (VALUE)

Casts the value `VALUE` to a `FIXNUM`.

CHECK-TYPES (TYPE &REST REST)

Performs `CHECK-TYPE` on items in rest.

WITH-BEZIER ((&OPTIONAL (STYLE SOLID) (SEGMENTS 20)) &BODY BODY)

Draw a bezier curve of `*DEFAULT-COLOR*` to `*DEFAULT-SURFACE*`. The shape of the Bezier curve is defined by control points. A control point is a vertex containing an X and Y coordinate pair. The number of segments `SEGENTS` used to draw the Bezier curve defaults to 10. The greater the number of segments, the smoother the Bezier curve. ##### Local Methods A vertex may be added using: * `ADD-VERTEX` which accepts an `POINT`, or * `ADD-VERTEX-*` which is the x/y spread version `ADD-VERTEX` and `ADD-VERTEX-*` are valid only within the scop of `WITH-BEZIER`. ##### Parameters * `STYLE` is one of `:SOLID`, `:DASH`, or `:POINTS`. When `STYLE` is `:SOLID`, a single continuous line is drawn through the specified waypoints. When `STYLE` is `:DASH`, a line is drawn to alternate waypoint pairs. When `STYLE` is `:POINTS`, a single point is drawn at each waypoint. * `SEGMENTS` is the number of segments used to draw the Bezier curve. Default is 20 segments if unspecified. The greater the number of segments, the smoother the curve. ##### Example (SDL:WITH-COLOR (COL (SDL:COLOR)) (WITH-BEZIER () (ADD-VERTEX-* 60 40) (ADD-VERTEX-* 160 10) (ADD-VERTEX-* 170 150) (ADD-VERTEX-* 60 150))) ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

WITH-COLOR ((VAR &OPTIONAL COLOR (FREE T)) &BODY BODY)

A convience macro that binds `*DEFAULT-COLOR*` to `VAR` within the scope of `WITH-COLOR`. `VAR` is set to `COLOR` when `COLOR` is not `NIL`.`VAR` must be of type [COLOR](#color), or [COLOR-A](#color-a). `VAR` is freed using [FREE](#free) when `FREE` is `T`.

WITH-CURVE ((&OPTIONAL (STYLE SOLID) (SEGMENTS 20)) &BODY BODY)

Draw a Cattmul-Rom spline of `*DEFAULT-COLOR*` to `*DEFAULT-SURFACE*`. The shape of the curve is defined by waypoints. A waypoint is a vertex containing an X and Y coordinate pair. ##### Local Methods A vertex may be added using: * `ADD-VERTEX` which accepts an `SDL:POINT`, or * `ADD-VERTEX-*` which is the x/y spread version `ADD-VERTEX` and `ADD-VERTEX-*` are valid only within the scope of `WITH-CURVE`. ##### Parameters * `STYLE` describes the line style used to draw the curve and may be one of `:SOLID`, `:DASH`, or `:POINTS`. Use `:SOLID` to draw a single continuous line through the specified waypoints. Use `:DASH` to draw a line between alternate waypoint pairs. Use `:POINTS` to draw a single pixel at each waypoint. * `SEGMENTS` is the number of segments used to draw the Catmull-Rom spline. Default is 20 segments if unspecified. The greater the number of segments, the smoother the spline. ##### Example (SDL:WITH-COLOR (COL (SDL:COLOR)) (WITH-CURVE (:SOLID 30) (ADD-VERTEX-* 60 40) (ADD-VERTEX-* 160 10) (ADD-VERTEX-* 170 150) (ADD-VERTEX-* 60 150))) ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

WITH-DEFAULT-FONT ((FONT) &BODY BODY)

Sets `*DEFAULT-FONT*` to `FONT` within the scope of `WITH-DEFAULT-FONT`. ##### Example (WITH-DEFAULT-FONT (new-font) (DRAW-CHARACTER-SHADED-* "Hello World!" 0 0 F-COLOR B-COLOR)) ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_ and _LISPBUILDER-SDL-TTF_

WITH-EVENTS ((&OPTIONAL (TYPE POLL)) &BODY EVENTS)

`WITH-EVENTS` is a convenience macro for managing the main game loop. It processes incoming SDL events and limits the game loop to the specified number of frames per second. Both the [SDL-POLL-EVENT](#sdl-poll-event) and [SDL-WAIT-EVENT](#sdl-wait-event) event mechanisms are supported by specifying the `TYPE` as `:POLL` or `:WAIT` respectively. *NOTE:* `WITH-EVENTS` must be called in the same thread used to set the video mode. ##### Example (SDL:WITH-EVENTS (:POLL) (:QUIT-EVENT () T) (:KEY-DOWN-EVENT (:KEY KEY) (WHEN (SDL:KEY= KEY :SDL-KEY-ESCAPE) (SDL:PUSH-QUIT-EVENT))) (:VIDEO-EXPOSE-EVENT () (SDL:UPDATE-DISPLAY)))))) ##### Frame Rate Limiting The frame rate is specified using [FRAME-RATE](#frame-rate). For example to set the frame rate to 60 frames per second: (SETF (SDL:FRAME-RATE) 60) ##### Event Syntax Events are specified using the format `(:EVENT-TYPE (&KEYS KEYS))` * `EVENT-TYPE` must be one of the following `KEY`words; `:ACTIVE-EVENT, :KEY-DOWN-EVENT, :KEY-UP-EVENT, :MOUSE-MOTION-EVENT, :MOUSE-BUTTON-DOWN-EVENT, :MOUSE-BUTTON-UP-EVENT, :JOY-AXIS-MOTION-EVENT, :JOY-BUTTON-DOWN-EVENT, :JOY-BUTTON-UP-EVENT, :JOY-HAT-MOTION-EVENT, :JOY-BALL-MOTION-EVENT, :VIDEO-RESIZE-EVENT, :VIDEO-EXPOSE-EVENT, :SYS-WM-EVENT, :QUIT-EVENT, :USER-EVENT` or `:IDLE`. * `KEYS` specify the members of the event to return and are specific to each event type. These are discussed in detail below. *NOTE:* `:QUIT-EVENT` must return `T` to exit the `WITH-EVENT` macro. *NOTE:* `:IDLE` is ignored when `TYPE` is `:WAIT`. ##### Polling for Events When `TYPE` is `:POLL`, `WITH-EVENTS` will continually poll for currently pending events. If no events are available then the game loop is run and the forms in `:IDLE` are executed. ##### Waiting for Events When `TYPE` is `:WAIT`, `WITH-EVENTS` will sleep indefinitely for the next available event. If no events are available then the game loop is paused. ##### The :IDLE Event (:IDLE () &BODY BODY) The `:IDLE` event is special in that it is not generated by SDL. Rather the forms in `:IDLE` are executed once each game loop after event queue is emptied. `:IDLE` is ignored when the event mechanism specified by `TYPE` is `:WAIT`. ##### Active Event (:ACTIVE-EVENT (:GAIN GAIN :STATE STATE) &BODY BODY) When the mouse leaves or enters the window area an `SDL-APP-MOUSE-FOCUS` type activation event is generated. If the mouse has entered the window then `GAIN` will be `1`, otherwise `GAIN` will be `0`. An `SDL-APP-INPUT-FOCUS` type activation event occurs when the application loses or gains keyboard focus, usually when a different application is made active. Finally, an `SDL-APP-ACTIVE` type event occurs when the application is either minimised/iconified, `GAIN` is `0`, or restored. A single event can have multiple values set in `STATE`. *Note:* This event does not occur when an application window is first created. * `GAIN` is `0` if the event is a loss or `1` if it is a gain. * `STATE` a bitmask of the following values: `SDL-APP-MOUSE-FOCUS` if mouse focus was gained or lost, `SDL-APP-INPUT-FOCUS` if input focus was gained or lost, and `SDL-APP-ACTIVE` if the application was iconified, `GAIN` is `0`, or restored `GAIN` is `1`. ##### Keyboard Events (:KEY-DOWN-EVENT (:STATE STATE :SCANCODE SCANCODE :KEY KEY :MOD MOD :MOD-KEY MOD-KEY :UNICODE UNICODE) &BODY BODY) (:KEY-UP-EVENT (:STATE STATE :SCANCODE SCANCODE :KEY KEY :MOD MOD :MOD-KEY MOD-KEY :UNICODE UNICODE) &BODY BODY) A keyboard event generally occurs when a key is released or when a key is pressed. The information on the key that generated the event is stored in `KEY` and `MOD`. The `SDL-CAPS-LOCK` and `SDL-NUM-LOCK` keys are special cases and report an `SDL-KEY-DOWN` when first pressed, then an `SDL-RELEASED` when released and pressed again. These keys KEYUP and KEYDOWN events are therefore analogous to the state of the caps lock and num lock LEDs rather than the keys themselves. These special cases are required for compatibility with Sun workstations. *Note:* Repeating `SDL-KEY-DOWN` events will occur if key repeat is enabled using [SDL-ENABLE-KEY-REPEAT](#sdl-enable-key-repeat). * `STATE` is `SDL-PRESSED` or `SDL-RELEASED` if the key is pressed or released respectively. * `SCANCODE` is the hardware-dependent scancode returned by the keyboard. * `KEY` is is the SDL-defined value of the key that generated the event. The SDL-defined value for `KEY` generally takes the following format: `:SDL-KEY-0` to `:SDL-KEY-1` for numeric keys. `SDL-KEY-a` to `SDL-KEY-z` for alpha keys in the range a-z. Other keys are generally spelled out, for example `SDL-KEY-PAGEDOWN`, `SDL-KEY-F1` or `SDL-KEY-NUMLOCK` . * `MOD` is the keyboard modifier state returned as an `INTEGER`. * `MOD-KEY` is the current state of the keyboard modifiers as explained in SDL_GetModState. Returned as a `LIST` of one or more of `:SDL-KEY-MOD-LSHIFT, :SDL-KEY-MOD-RSHIFT, :SDL-KEY-MOD-LCTRL, :SDL-KEY-MOD-RCTRL, :SDL-KEY-MOD-LALT, :SDL-KEY-MOD-RALT, :SDL-KEY-MOD-LMETA, :SDL-KEY-MOD-RMETA, :SDL-KEY-MOD-NUM, :SDL-KEY-MOD-CAPS, :SDL-KEY-MOD-MODE or :SDL-KEY-MOD-RESERVED`. * `UNICODE` is the translated character. The unicode field is only used when UNICODE translation is enabled with SDL_EnableUNICODE. If unicode is non-zero then this is the UNICODE character corresponding to the keypress. If the high 9 bits of the character are 0, then this maps to the equivalent ASCII character. ##### Mouse Motion Event (:MOUSE-MOTION-EVENT (:STATE STATE :X X :Y Y :X-REL X-REL :Y-REL Y-REL) &BODY BODY) A `MOUSE-MOTION-EVENT` event occurs when the mouse moves within the application window or when [SDL-WARP-MOUSE](#SDL-WARP-MOUSE) is called. Both the absolute `X` and `Y` and relative `X-REL` and `Y-REL` coordinates are reported along with the current button state `STATE`. The button state can be interpreted using [SDL-BUTTON](#sdl-button), see [SDL-GET-MOUSE-STATE](#sdl-get-mouse-state). If the cursor is hidden using [SDL-SHOW-CURSOR](#sdl-show-cursor) and the input is grabbed using [SDL-WM-GRAB-INPUT](#sdl-wm-grab-input), then the mouse will give relative motion events even when the cursor reaches the edge of the screen. This is currently only implemented on Windows and Linux/Unix-alikes. * `STATE` is the current button state. * `X` is the `X` coordinates of the mouse * `Y` is the `Y` coordinates of the mouse * `X-REL` is the relative motion in the `X` direction * `Y-REL` is the relative motion in the `Y` direction ##### Mouse Button Events (:MOUSE-BUTTON-DOWN-EVENT (:BUTTON BUTTON :STATE STATE :X X :Y Y) &BODY BODY) (:MOUSE-BUTTON-UP-EVENT (:BUTTON BUTTON :STATE STATE :X X :Y Y) &BODY BODY) When a mouse button press or release is detected the number of the button pressed (from 1 to 255, with 1 usually being the left button and 2 the right) is placed into `BUTTON`, the position of the mouse when this event occured is stored in the `X` and the `Y` fields. Mouse wheel events are reported as buttons 4 (up) and 5 (down). Two events are generated i.e. a `SDL-MOUSE-BUTTON-DOWN` followed by a `SDL-MOUSE-BUTTON-UP` event. * `BUTTON` is the mouse button index which is one of `SDL-BUTTON-LEFT`, `SDL-BUTTON-MIDDLE`, `SDL-BUTTON-RIGHT`, `SDL-BUTTON-WHEELUP` or `SDL-BUTTON-WHEELDOWN`. * `STATE` is the state of the button which is `SDL-PRESSED` or `SDL-RELEASED`. * `X` is the `X` coordinates of the mouse at press/release time. * `Y` is the `Y` coordinates of the mouse at press/release time. ##### Joystick Motion Event (:JOY-AXIS-MOTION-EVENT (:WHICH WHICH :AXIS AXIS :VALUE VALUE) &BODY BODY) A JOY-AXIS-MOTION-EVENT event occurs whenever a user moves an axis on the joystick. * `WHICH` is the joystick device index. The index of the joystick that reported the event. * `AXIS` is the joystick axis index * `VALUE` is the current position of the axis (range: -32768 to 32767) ##### Joystick Button Events (:JOY-BUTTON-DOWN-EVENT (:WHICH WHICH :BUTTON BUTTON :STATE STATE) &BODY BODY) (:JOY-BUTTON-UP-EVENT (:WHICH WHICH :BUTTON BUTTON :STATE STATE) &BODY BODY) A `JOY-BUTTON-DOWN-EVENT` or `JOY-BUTTON-DOWN-EVENT` event occurs whenever a user presses or releases a button on a joystick. * `WHICH` is the index of the joystick that reported the event. * `BUTTON` is the button pressed that caused the event. * `STATE` is the current state of the button and is either `SDL-PRESSED` or `SDL-RELEASED`. ##### Joystick Hat Motion Event (:JOY-HAT-MOTION-EVENT (:WHICH WHICH :HAT HAT :VALUE VALUE) &BODY BODY) A `JOY-HAT-MOTION-EVENT` event occurs when ever a user moves a hat on the joystick. * `WHICH` is the index of the joystick that reported the event. * `HAT` is the index of the hat that generated the event. * `VALUE` is the current position of the hat, a bitwise OR'd combination of the following values `SDL-HAT-CENTERED`, `SDL-HAT-UP`, `SDL-HAT-RIGHT`, `SDL-HAT-DOWN`, `SDL-HAT-LEFT`, `SDL-HAT-RIGHT-UP`, `SDL-HAT-RIGHT-DOWN`, `SDL-HAT-LEFT-UP` and `SDL-HAT-LEFT-DOWN`. ##### Joystick Ball Motion Event (:JOY-BALL-MOTION-EVENT (:WHICH WHICH :BALL BALL :X-REL X-REL :Y-REL Y-REL) &BODY BODY) A `JOY-BALL-MOTION-EVENT` event occurs when a user moves a trackball on the joystick. Trackballs only return relative motion. * `WHICH` is the index of the joystick that reported the event. * `BALL` is the index of the trackball that generated the event. * `X-REL` is the change in `X` position of the ball since it was last polled (last cycle of the event loop). * `Y-REL` is the change in `Y` position of the ball since it was last polled (last cycle of the event loop). ##### Quit Event (:QUIT-EVENT () &BODY BODY) If `QUIT-EVENT` is filtered or ignored then it is impossible for the user to close the window. If `QUIT-EVENT` is accepted and returns `T` then the application window will be closed. *Note:* Screen updates will continue to report success even though the application is no longer visible. If `QUIT-EVENT` is accepted and returns `NIL` then the application window will _not_ be closed. [QUIT-REQUESTED](#quit-requested) will return non-zero if a `QUIT-EVENT` event is pending. ##### SDL Window Resize Event (:VIDEO-RESIZE-EVENT (:W W :H H) ...) When `SDL-RESIZABLE` is passed as a flag to [WINDOW](#window), the user is allowed to resize the application window. When the window is resized a `VIDEO-RESIZE-EVENT` event is reported, with the new window width and height values stored in `W` and `H` respectively. When an `VIDEO-RESIZE-EVENT` event is recieved the window should be resized to the new dimensions using [WINDOW](#window). * `W` is the window width as an `INTEGER`. * `H` is the window height as an INTERGER`. ##### SDL Window Expose Event (:VIDEO-EXPOSE-EVENT () ...) `VIDEO-EXPOSE-EVENT` is triggered when the screen has been modified outside of the application, usually by the window manager, and needs to be redrawn. ##### System Window Events (:SYS-WM-EVENT () ...) The system window manager event contains a pointer to system-specific information about unknown window manager events. If this event is enabled using [SDL-EVENT-STATE](#sdl-event-state), it will be generated whenever unhandled events are received from the window manager. This can be used, for example, to implement cut-and-paste in your application. If you want to obtain system-specific information about the window manager, you can fill in the version member of a `SDL-SYS-WM-INFO` structure using [SDL-VERSION](#sdl-version), and pass it to the function: [SDL-GET-WM-INFO](#sdl-get-wm-info) ##### User (:USER-EVENT (:TYPE TYPE :CODE CODE :DATA1 DATA1 :DATA2 DATA2) ...) `USER-EVENT` is unique in that it is created by the user not SDL. `USER-EVENT` can be pushed onto the event queue using [PUSH-USER-EVENT](#push-user-event). The contents of the event are completely up to the programmer. * `TYPE` is a value from `SDL-USER-EVENT to `(- SDL-NUM-EVENTS 1)` inclusive. * `CODE` is a user defined event code * `DATA1` is a user defined data pointer * `DATA2` is a user defined data pointer ##### Syntax (WITH-EVENTS (TYPE) (:ACTIVE-EVENT (:GAIN GAIN :STATE STATE) ... ) (:KEY-DOWN-EVENT (:STATE STATE :SCANCODE SCANCODE :KEY KEY :MOD MOD :MOD-KEY MOD-KEY :UNICODE UNICODE) ... ) (:KEY-UP-EVENT (:STATE STATE :SCANCODE SCANCODE :KEY KEY :MOD MOD :MOD-KEY MOD-KEY :UNICODE UNICODE) ...) (:MOUSE-MOTION-EVENT (:STATE STATE :X X :Y Y :X-REL X-REL :Y-REL Y-REL) ...) (:MOUSE-BUTTON-DOWN-EVENT (:BUTTON BUTTON :STATE STATE :X X :Y Y) ...) (:MOUSE-BUTTON-UP-EVENT (:BUTTON BUTTON :STATE STATE :X X :Y Y) ...) (:JOY-AXIS-MOTION-EVENT (:WHICH WHICH :AXIS AXIS :VALUE VALUE) ...) (:JOY-BUTTON-DOWN-EVENT (:WHICH WHICH :BUTTON BUTTON :STATE STATE) ...) (:JOY-BUTTON-UP-EVENT (:WHICH WHICH :BUTTON BUTTON :STATE STATE) ...) (:JOY-HAT-MOTION-EVENT (:WHICH WHICH :HAT HAT :VALUE VALUE) ...) (:JOY-BALL-MOTION-EVENT (:WHICH WHICH :BALL BALL :X-REL X-REL :Y-REL Y-REL) ...) (:VIDEO-RESIZE-EVENT (:W W :H H) ...) (:VIDEO-EXPOSE-EVENT () ...) (:SYS-WM-EVENT () ...) (:USER-EVENT (:TYPE TYPE :CODE CODE :DATA1 DATA1 :DATA2 DATA2) ...) (:QUIT-EVENT () ... T) (:IDLE () ... ))

WITH-FONT ((FONT FONT-DEFINITION) &BODY BODY)

Sets `*DEFAULT-FONT*` to a new [BITMAP-FONT](#bitmap-font) in `FONT` within the scope of `WITH-FONT`. Frees `FONT` when `WITH-FONT` goes out of scope, and sets `*DEFAULT-FONT* to `NIL. ##### Example (WITH-FONT (new-font *font-8x8*) (DRAW-CHARACTER-SHADED-* "Hello World!" 0 0 F-COLOR B-COLOR)) ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

WITH-FOREIGN-COLOR-COPY ((STRUCT COLOR) &BODY BODY)

Creates and assigns a new foreign `SDL_Color` to `STRUCT`. Then copies the color components from `COLOR` into `STRUCT`. `STRUCT` is free'd when out of scope.

WITH-INIT (FLAGS &BODY BODY)

`WITH-INIT` is a convenience macro that will attempt to initialise the SDL library and SDL subsystems prior to executing the forms in `BODY`. Upon exit `WITH-INIT` will uninitialize the SDL library and SDL subsystems. The lispbuilder-sdl initialization routines are somewhat complicated by the fact that a Lisp development environment will load a foreign library once but then initialise and uninitialise the library multiple times. A C/C++ development environment will open and then close a library after each execution, freeing all resources left hanging by incomplete or buggy uninitialise functions. C libraries may therefore frequently core dump in a Lisp environment when resources are not feed properly prior to the library being reinitialized. LISPBUILDER-SDL provides functionality affording the programmer a finer granularity of control of the initialisation/uninitialisation of foreign libraries. The fuctions that provide these capabilities are as follows: * [INIT-SUBSYSTEMS](#init-subsystems) * [QUIT-SUBSYSTEMS](#quit-subsystems) * [INIT-SDL](#init-sdl) * [QUIT-SDL](#quit-sdl) * [LIST-SUBSYSTEMS](#list-subsystems) * [RETURN-SUBSYSTEMS-OF-STATUS](#return-subsystems-of-status) ##### Defaults `WITH-INIT` will initialize the SDL subsystem and additional subsystems in `:FLAGS` if specified. If `:FLAGS` is not specified, then initializes the subsystems specified by [INITIALIZE-SUBSYSTEMS-ON-STARTUP](#initialize-subsystems-on-startup). `WITH-INIT` will uninitialize the SDL subsystem and additional subsystems in `:FLAGS` if specified. ###### Initialisation/Uninitialisation of the SDL library The SDL library is initialized only: * If the library is not yet already initialized. The SDL library is uninitialized only: * When [*QUIT-ON-EXIT*](#*quit-on-exit*) is `T`. ###### Initialisation/Uninitialisation of external libraries Hooks are provided to allow external libraries to be initialized or uninitialised automatically following the initialisation or uninitialisation of the SDL library. To initialise an external library, push a function that initialises the external library onto `*EXTERNAL-INIT-SUBSYSTEMS-ON-STARTUP*`. The function must take no arguments. For example: (defun init-ttf () (if (is-init) t (sdl-ttf-cffi::ttf-init))) (pushnew 'init-ttf sdl:*external-init-subsystems-on-startup*) To uninitialise an external library, push a function that uninitialises the external library onto `*EXTERNAL-QUIT-SUBSYSTEMS-ON-EXIT*`. The function must take no arguments. For example: (defun quit-ttf () (if (is-init) (sdl-ttf-cffi::ttf-quit))) (pushnew 'quit-ttf sdl:*external-quit-subsystems-on-exit*) ##### Parameters * `FLAGS` may be one or more of: `SDL-INIT-VIDEO`, `SDL-INIT-CDROM`, `SDL-INIT-AUDIO`, `SDL-INIT-JOYSTICK`, and `SDL-INIT-NOPARACHUTE`. *Note*: When `FLAGS` is set by `WITH-INIT`, subsequent calls to [INITIALIZE-SUBSYSTEMS-ON-STARTUP](#initialize-subsystems-on-startup) and [QUIT-SUBSYSTEMS-ON-EXIT](#quit-subsystems-on-exit) are ignored. `WITH-INIT` will only initialize and uninitialize the subsytems specified in `FLAGS`. ##### Example (with-init (SDL-INIT-VIDEO SDL-INIT-CDROM SDL-INIT-AUDIO) ....) (with-init () (INITIALIZE-SUBSYSTEMS-ON-STARTUP SDL-INIT-VIDEO SDL-INIT-CDROM SDL-INIT-AUDIO) (QUIT-SUBSYSTEMS-ON-EXIT SDL-INIT-VIDEO SDL-INIT-CDROM SDL-INIT-AUDIO) ....)

WITH-POINT ((VAR &OPTIONAL POINT) &BODY BODY)

A convenience macro that binds `*DEFAULT-POINT*` to `VAR` within the scope of `WITH-POINT`. `VAR` must be of type `POINT`. If `POINT` is not `NIL`, then `VAR is set to `POINT`.

WITH-RECTANGLE ((VAR &OPTIONAL RECTANGLE (FREE T)) &BODY BODY)

A convenience macro that binds `*DEFAULT-RECTANGLE*` to `VAR` within the scope of `WITH-RECTANGLE`. `VAR` must be of type `RECTANGLE`. `VAR` is set to `RECTANGLE` when `RECTANGLE` is not `NIL`. `VAR` is freed when `FREE` is `T`. ##### Example (WITH-RECTANGLE (a-rect (RECTANGLE :x 0 :y 0 :w 100 :h 100)) ...)

WITH-RECTANGLES (BINDINGS &BODY BODY)

A convenience macro that binds multiple rectangles as per [WITH-RECTANGLE](#with-rectangle). ##### Example (WITH-RECTANGLES ((a-rect (RECTANGLE :x 0 :y 0 :w 100 :h 100)) ((b-rect (RECTANGLE :x 0 :y 100 :w 100 :h 100)) ((c-rect (RECTANGLE :x 0 :y 200 :w 100 :h 100))) ...)

WITH-SHAPE ((&OPTIONAL (STYLE SOLID)) &BODY BODY)

Draw a polygon of `*DEFAULT-COLOR*` to `*DEFAULT-SURFACE*`. ##### Local Methods A vertex may be added using: * `ADD-VERTEX` which accepts an `SDL:POINT`, or * `ADD-VERTEX-*` which is the x/y spread version ADD-VERTEX and ADD-VERTEX-* are valid only within the scop of WITH-SHAPE. ##### Parameters * `STYLE` describes the line style used to draw the shape and may be one of `:SOLID`, `:DASH`, or `:POINTS`. Use `:SOLID` to draw a single continuous line through the specified waypoints. Use `:DASH` to draw a line between alternate waypoint pairs. Use `:POINTS` to draw a single pixel at each waypoint. ##### Example (SDL:WITH-COLOR (COL (SDL:COLOR)) (WITH-SHAPE (:POINTS) (ADD-VERTEX-* 60 40) (ADD-VERTEX-* 160 10) (ADD-VERTEX-* 170 150) (ADD-VERTEX-* 60 150))) ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

Undocumented

WITH-ACTIVE-EVENT ((&REST PARAMS) EVENT-FP &BODY BODY)

WITH-FRAME-RATE (&BODY BODY)

WITH-JOY-AXIS-MOTION-EVENT ((&REST PARAMS) EVENT-FP &BODY BODY)

WITH-JOY-BALL-MOTION-EVENT ((&REST PARAMS) EVENT-FP &BODY BODY)

WITH-JOY-BUTTON-DOWN-EVENT ((&REST PARAMS) EVENT-FP &BODY BODY)

WITH-JOY-BUTTON-UP-EVENT ((&REST PARAMS) EVENT-FP &BODY BODY)

WITH-JOY-HAT-MOTION-EVENT ((&REST PARAMS) EVENT-FP &BODY BODY)

WITH-KEY-DOWN-EVENT ((&REST PARAMS) EVENT-FP &BODY BODY)

WITH-KEY-UP-EVENT ((&REST PARAMS) EVENT-FP &BODY BODY)

WITH-LOCKED-SURFACE ((VAR &OPTIONAL SURFACE) &BODY BODY)

WITH-LOCKED-SURFACES (BINDINGS &REST BODY)

WITH-MOUSE-BUTTON-DOWN-EVENT ((&REST PARAMS) EVENT-FP &BODY BODY)

WITH-MOUSE-BUTTON-UP-EVENT ((&REST PARAMS) EVENT-FP &BODY BODY)

WITH-MOUSE-MOTION-EVENT ((&REST PARAMS) EVENT-FP &BODY BODY)

WITH-PIXEL ((VAR SURFACE) &BODY BODY)

WITH-PIXELS (BINDINGS &REST BODY)

WITH-SURFACE ((VAR &OPTIONAL SURFACE (FREE T)) &BODY BODY)

WITH-SURFACE-SLOTS ((VAR &OPTIONAL SURFACE) &BODY BODY)

WITH-SURFACES (BINDINGS &REST BODY)

WITH-TIMESTEP (&BODY BODY)

WITH-USER-EVENT ((&REST PARAMS) EVENT-FP &BODY BODY)

WITH-VIDEO-RESIZE-EVENT ((&REST PARAMS) EVENT-FP &BODY BODY)

Private

Undocumented

WITH-EVENT ((&REST PARAMS) EVENT-FP EVENT &BODY BODY)

WITH-INPUT-STATUS (INPUT STATUS &BODY BODY)

GENERIC-FUNCTION

Public

SETFA (VALUE COLOR)

Sets/Returns the alpha color component of the object.

SETFALPHA (VALUE SURFACE)

Manages per-surface alpha. Returns the per-surface alpha value. 0 is transparent, and 255 is opaque. Sets the per-surface alpha value. 0 is transparent, and 255 is opaque. *Note*: The per-surface alpha value of 128 is considered a special case and is optimised, so it's much faster than other per-surface values. *Note*: A surface need not have an alpha channel to use alpha blending. *Note*: When blitting, the presence or absence of [SDL-SRC-ALPHA](#sdl-src-alpha) is relevant only on the source surface, not the destination. *Note*: Per-pixel and per-surface alpha cannot be combined; the per-pixel alpha is always used if available.

SETFALPHA-ENABLED-P (VALUE SURFACE)

Manage alpha blending for a `SURFACE`. Returns `T` when alpha blending is enabled for `SURFACE`, and `NIL` when disabled. Enable surface alpha blending for when `T`. Disable surface alpha blending when `NIL`. A `SURFACE` need not have a pixel alpha component (RGBA) to use surface alpha blending.

ANY-COLOR-BUT-THIS (COLOR)

Returns a new color that is different to `COLOR`.

SETFB (VALUE COLOR)

Sets/Returns the blue color component of the object.

SETFCLIP-RECT (VALUE SURFACE)

Manages the clipping `RECTANGLE` for a`SURFACE`. Returns the clipping `RECTANGLE` for `SURFACE`. Sets the clipping [RECTANGLE](#rectangle) for the `SURFACE`. Removes the clipping rectangle when `NIL`. When `SURFACE` is the destination of a blit, only the area within the clipping rectangle is drawn into.

COLOR-* (COLOR)

Returns the `RGB/A` color components as a spread. [COLOR-A](#color-a) returns `(VALUES R G B A)`. [COLOR](#color) returns `(VALUES R G B)`

SETFCOLOR-KEY-ENABLED-P (VALUE SURFACE)

Manages colorkeying for a `SURFACE`. Returns `T` when color keying is enabled, and `NIL` when color keying is disabled. Enables color keying when `T`. Disable color keying when `NIL`

COLOR= (COLOR1 COLOR2)

Returns `T` if the `RGB`<->`RGB` or `RGBA`<->`RGBA` color components in `COLOR1` and `COLOR2` match. Returns `NIL` otherwise.

DRAW-FONT (&KEY FONT SURFACE (FONT *DEFAULT-FONT*) (SURFACE *DEFAULT-SURFACE*))

Blit the cached [SURFACE](#surface) in [font](#FONT) to the destination `SURFACE`. The cached surface is created during a previous call to any of the DRAW-STRING* functions. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_, and _LISPBUILDER-SDL-TTF_

DRAW-FONT-AT (POSITION &KEY FONT SURFACE (FONT *DEFAULT-FONT*) (SURFACE *DEFAULT-SURFACE*))

See [DRAW-FONT](#draw-font). The cached surface is rendered at `POSITION` [POINT](#point). ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_, and _LISPBUILDER-SDL-TTF_

DRAW-FONT-AT-* (X Y &KEY FONT SURFACE (FONT *DEFAULT-FONT*) (SURFACE *DEFAULT-SURFACE*))

See [DRAW-FONT](#draw-font). The cached surface is rendered at poisition `X` and `Y`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_, and _LISPBUILDER-SDL-TTF_

FREE (FOREIGN-OBJECT)

The general explicit cleanup method for the FOREIGN-OBJECT wrapper class. Objects that subclass FOREIGN-OBJECT should specify an :AFTER method on FREE to clean up any additional fields, if necessary.

SETFG (VALUE COLOR)

Sets/Returns the green color component of the object.

SETFGC-P (VALUE FOREIGN-OBJECT)

Turns on garbage collection for the FOREIGN-OBJECT when T, or turns off garbage collection when NIL.

GET-POINT (OBJECT)

Returns the `X` and `Y` coordinates of object `OBJ` as a `POINT`.

GET-POSITION (OBJECT)

See [GET-POINT](#get-POINT)

GET-RECTANGLE (OBJ)

Returns the rectangle `RECTANGLE`.

SETFHEIGHT (VALUE OBJ)

Sets/Returns the height of the object, as an `INTEGER`.

IMAGE-P (SOURCE IMAGE-TYPE)

Returns `T` when the image type in `SOURCE` is of `IMAGE-TYPE`. Returns `NIL` otherwise. Attempts to detect the image type using the *magic number* contained in the image if one is available. `NIL` is always returned for images of type `TGA` as a `TGA` image does not contain a *magic number*. `IMAGE-TYPE` must be one of `:BMP`, `:GIF`, `:JPG`, `:LBM`, `:PCX`, `:PNG`, `:PNM`, `:TIF`, `:XCF`, `:XPM` or `:XV`. ##### Example (RWOPS-P SOURCE :IMAGE-TYPE :BMP) (IMAGE-P "image.bmp" :IMAGE-TYPE :BMP) ##### Packages * Supported in _LISPBUILDER-SDL-IMAGE_

IMAGE-TYPE-OF (SOURCE)

Returns the type of image in source `SOURCE`. Attempts to detect the image type using the *magic number* contained in the image if one is available. Returns one of `:BMP`, `:GIF`, `:JPG`, `:LBM`, `:PCX`, `:PNG`, `:PNM`, `:TIF`, `:XCF`, `:XPM` or `:XV`, if the image type can be determined. Returns `NIL` if the image cannot be determined (The *magic number* is not supported or the *magic number* is not found). `NIL` is always returned for images of type `TGA` as a `TGA` image does not contain a *magic number*. ##### Example (IMAGE-TYPE-OF SOURCE) (IMAGE-TYPE-OF "image.bmp") ##### Packages * Supported in _LISPBUILDER-SDL-IMAGE_

INITIALISE-FONT (FONT-DEFINITION)

Returns a new [SDL-BITMAP-FONT](#sdl-bitmap-font) initialized from `FONT-DEFINITION` data, or `NIL` if the font cannot be created. `FONT-DEFINITION` must be one of the following built-in fonts: `*FONT-10X20*`, `*FONT-5X7*`, `*FONT-5X8*`, `*FONT-6X10*`, `*FONT-6X12*`, `*FONT-6X13*`, `*FONT-6X13B*`, `*FONT-6X13O*`, `*FONT-6X9*`, `*FONT-7X13*`, `*FONT-7X13B*`, `*FONT-7X13O*`, `*FONT-7X14*`, `*FONT-7X14B*`, `*FONT-8X13*`, `*FONT-8X13B*`, `*FONT-8X13O*`, `*FONT-8X8*`, `*FONT-9X15*`, `*FONT-9X15B*`, `*FONT-9X18*` OR `*FONT-9X18B*`. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

LOAD-IMAGE (SOURCE &KEY COLOR-KEY ALPHA IMAGE-TYPE FORCE FREE-RWOPS COLOR-KEY-AT (COLOR-KEY-AT NIL))

Creates and returns a new `SURFACE` from the image in `SOURCE`, or returns `NIL` if `SOURCE` does not contain a valid image or the image type cannot be determined. The *magic number* if present is be used to determine the image type. To load an image when the *magic number* is unavailable (image formats such as `TGA` do not contain a *magic number*), specify the image type using `:IMAGE-TYPE`. All non-magicable image formats, such as `TGA`, must be specified using `IMAGE-TYPE`. To load a TGA image use `:IMAGE-TYPE :TGA` ##### Parameters * `SOURCE` is an image. * `COLOR-KEY` sets the color key, and turns on color keying. * 'COLOR-KEY-AT' uses the pixel color at `POINT` x/y as the color key, and turns on color keying. * `ALPHA` sets the transparency level for the surface, and turns on alpha blending. Must be in the range 0-255, where 255 is opaque and 0 is transparent. * `IMAGE-TYPE` specifies the image type. May be `:BMP`, `:GIF`, `:JPG`, `:LBM`, `:PCX`, `:PNG`, `:PNM`, `:TGA`, `:TIF`, `:XCF`, `:XPM` or `:XV`. The image type is determined using the *magic number* when present in the image if `NIL`. If the *magic number* is available and does not match `IMAGE-TYPE`, then `IMAGE-TYPE` is ignored. * `FORCE` when `T` will ignore any *magic number* present in the image and load an image as `:IMAGE-TYPE`. Images of type `TGA` must be loaded using `:FORCE T`. * `FREE-RWOPS` will free a RWOPS passed as a parameter in `SOURCE`. Default is `T` ##### Example * To load a `BMP` image using the *magic number* (LOAD-IMAGE "image.bmp") * To load a `TGA` image (LOAD-IMAGE "image.tga" :IMAGE-TYPE :TGA) * Try to load a `BMP` image as `TGA` (LOAD-IMAGE "image.bmp" :IMAGE-TYPE :BMP :FORCE T) ##### Packages * Also supported in _LISPBUILDER-SDL-IMAGE_ * _LISPBUILDER-SDL_ only supports `BMP` images. Any alpha channel present in the source image is ignored. The new `SURFACE` is created as an `RGB` surface, not `RGBA`. * _LISPBUILDER-SDL-IMAGE_ supports the following image formats, `BMP`, `GIF`, `JPG`, `LBM`, `PCX`, `PNG`, `PNM`, `TIF`, `XCF`, `XPM`, `XV`. `BMP` and `TGA`. Alpha channels are supported. The new `SURFACE` is created as `RGB` or `RGBA` as appropriate. * `:IMAGE-TYPE` and `:FORCE` are ignored for _LISPBUILDER-SDL_.

MAP-COLOR (COLOR &OPTIONAL SURFACE)

Maps [COLOR](#color) or [COLOR-A](#color-a) to the pixel format of [SURFACE](#surface) and returns the pixel value that best approximates the color value of the surface. If the surface has a palette (8-bit) the index of the closest matching color in the palette will be returned. If the surface has an alpha component it will be returned as all `1` bits (fully opaque). If the surface color depth is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e.g., with a 16-bpp format the return value can be assigned to a Uint16, and similarly a Uint8 for an 8-bpp format).

MAP-COLOR-* (R G B A &OPTIONAL SURFACE)

Maps the color specified by the `R`, `G`, `B`, and `A` color components to the pixel format of [SURFACE](#surface) and returns the pixel value that best approximates the color value of the surface. If `A` is not `NIL` then the color is assumed to contain an alpha component. See [MAP-COLOR](#map-color) for more details.

MODIFIER-P (KEY &OPTIONAL MODIFIERS)

Returns a list of the modifiers in `KEY` that match `MODIFIERS`, or `NIL` if no modifiers match. By default, `MODIFIERS` is the list of valid modifiers. ##### Example 1 (:KEY-DOWN-EVENT (:MOD MOD) (SDL:MODIFIER-P MOD '(:SDL-KEY-MOD-LCTRL :SDL-KEY-MOD-LALT))) ##### Example 2 (:KEY-DOWN-EVENT (:MOD MOD) (SDL:MODIFIER-P MOD))

MODIFIER= (MOD KEY)

Returns `MOD` only when all of the modifiers in `MOD` exactly match `KEY`, and returns `NIL` otherwise. `MOD` may be a list of modifiers, or a single modifier. ##### Example (:KEY-DOWN-EVENT (:MOD MOD) (SDL:MODIFIER= '(:SDL-KEY-MOD-LCTRL :SDL-KEY-MOD-LALT) MOD))

PACK-COLOR (COLOR)

Packs [COLOR](#color) or [COLOR-A](#color-a) into a four byte `INTEGER`.

PIXEL-ALPHA-ENABLED-P (SURFACE)

Returns `T` if a pixel alpha component (RGBA) is available, or `NIL` if unavailable (RGB). *Note*: The pixel alpha component differs from the surface alpha component which is retrieved using [ALPHA-ENABLED-P](#alpha-enabled-p).

POINT-* (POINT)

Returns the `X` and `Y` coordinates of the object as a spread. The `RESULT` is `(VALUES X Y)`

POSITION-* (OBJ)

See [POINT-*](#point-*)

SETFR (VALUE COLOR)

Sets/Returns the red color component of the object.

RECTANGLE-* (OBJ)

Returns the `X`, `Y`, `WIDTH` and `HEIGHT` coordinates of the object as a spread. The `RESULT` is `(VALUES X Y WIDTH HEIGHT)`

RESIZE-WINDOW (WIDTH HEIGHT &KEY FLAGS SW HW FULLSCREEN ASYNC-BLIT ANY-FORMAT PALETTE DOUBLE-BUFFER OPENGL RESIZABLE NO-FRAME TITLE-CAPTION ICON-CAPTION BPP OPENGL-ATTRIBUTES)

Resizes the current display to the specified `WIDTH` and `HEIGHT`. The pixel depth, title and icon captions, and surface flags will remain the same

SETFRLE-ACCEL-ENABLED-P (VALUE SURFACE)

Manages RLE acceleration for a `SURFACE`. Returns `T` if RLE acceleration is enabled, and `NIL` when RLE is disabled. Enables RLE blit acceleration when `T`, disables RLE acceleration when `NIL`. RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i.e., pixels that match the key color).

SET-COLOR (DST SRC)

Copies the `RGB/A` color components to the destination `DST` from the source `SRC`.

SET-COLOR-* (COLOR &KEY R G B A)

Sets `COLOR` to the red `R`, green `G`, blue `B` and alpha `A` color components.

SET-DEFAULT-FONT (FONT)

Sets the font `FONT` as the default font to be used for subsequent font rendering or drawing operations. Binds the symbol `*DEFAULT-FONT*` to font. Functions that take a `FONT` argument use `*DEFAULT-FONT*` unless otherwise specified. Returns a new `FONT`, or `NIL` if unsuccessful.

SET-POINT (DST SRC)

Copies the `X` and `Y` coordinates to the destination `DST` from the source `SRC`.

SET-POINT-* (OBJ &KEY X Y)

Sets the `X` and `Y` coordinates of the object `OBJ`. `X` and `Y` are `KEY`word parameters.

SET-POSITION (DST SRC)

See [SET-POINT](#set-point)

SET-POSITION-* (OBJ &KEY X Y)

See [SET-POINT-*](#set-point-*)

SET-RECTANGLE (DST SRC)

Copies the `X`, `Y`, `WIDTH` and `HEIGHT` coordinates to the destination rectangle `DST` from the source rectangle `SRC`.

SET-RECTANGLE-* (RECTANGLE &KEY X Y W H)

Sets the `X`, `Y`, `WIDTH` and `HEIGHT` coordinates of the rectangle `RECTANGLE`. `X`, `Y`, `WIDTH` and `HEIGHT` are `KEY`word parameters having default values of `0` if unspecified.

SET-SURFACE (SURFACE POSITION)

Sets the coordinates of the surface SURFACE to `POSITION`, where position is of type `POINT`.

SET-SURFACE-* (SURFACE &KEY X Y)

Sets the coordinates of the surface `SURFACE`. `X` and `Y` are `KEY`word parameters having default values of `0` if unspecified.

SETFWIDTH (VALUE OBJ)

Sets/Returns the width of the object, as an `INTEGER`.

WINDOW (WIDTH HEIGHT &KEY BPP FLAGS SW HW FULLSCREEN ASYNC-BLIT ANY-FORMAT PALETTE DOUBLE-BUFFER OPENGL RESIZABLE NO-FRAME TITLE-CAPTION ICON-CAPTION FPS POSITION VIDEO-DRIVER AUDIO-DRIVER OPENGL-ATTRIBUTES EVENT-FILTER)

Creates a new SDL window of pixel width `WIDTH` and height `HEIGHT` using SDL_SetVideoMode. Use `SDL-SW-SURFACE` if you plan on doing per-pixel manipulations, or blit surfaces with alpha channels, and require a high framerate. When you use hardware surfaces like `SDL-HW-SURFACE`, SDL copies the surfaces from video memory to system memory when you lock them, and back when you unlock them. This can cause a major performance hit. (Be aware that you may request a hardware surface, but receive a software surface. Many platforms can only provide a hardware surface when using `SDL-FULL-SCREEN.) `SDL-HW-SURFACE` is best used when the surfaces you'll be blitting can also be stored in video memory. *Note:* To control the position on the screen when creating a windowed surface, set the environment variables `SDL_VIDEO_CENTERED=center` or `SDL_VIDEO_WINDOW_POS=x,y`. These may be set using [SDL-PUT-ENV](#sdl-put-env). ##### Parameters * `WIDTH` the pixel width of the window, of type `INTEGER`. * `HEIGHT` the pixel height of the window, of type `INTEGER`. If `WIDTH` and `HEIGHT` are both `0`, then the width and height of the current video mode is used (or the desktop mode, if no mode has been set). * `BPP` the number of bits per pixel. Defaults to `0` which is the current display bits per pixel. *Note:* A `BPP` of `24` uses the packed representation of 3 bytes/pixel. For the more common 4 bytes/pixel mode, use a `BPP` of 32. * `FLAGS` is a bitmasked logior of one or more of the following; [SDL-SW-SURFACE](#sdl-sw-surface), [SDL-HW-SURFACE](#sdl-hw-surface), [SDL-ASYNC-BLIT](#sdl-async-blit), [SDL-ANY-FORMAT](#sdl-any-format), [SDL-HW-PALETTE](#sdl-hw-palette), [SDL-DOUBLEBUF](#sdl-doublebuf), [SDL-FULLSCREEN](#sdl-fullscreen), [SDL-OPENGL](#sdl-opengl), [SDL-RESIZABLE](#sdl-resizable) and [SDL-NO-FRAME](#SDL-NO-FRAME). * `TITLE-CAPTION` is the title that appears in the Window title bar, of type `STRING`. * `ICON-CAPTION` is the title that appears when the Window is minimized, of type `STRING`. * `POSITION` is the x and y display positions of the window. When `NIL` will use the previous x and y positions, when `T` will center the window on the screen, when `(VECTOR x y)` will set the window to the specified x and y positions. ##### Returns * Returns a new `DISPLAY-SURFACE` if successful, `NIL` if unsuccessful. Whatever flags SDL_SetVideoMode could satisfy are set in the flags member of `SURFACE`. The `SURFACE` returned is freed by SDL and should never be freed by the caller. This rule includes consecutive calls to `WINDOW` (i.e. upon resize or resolution change) - any existing surface will be released automatically by SDL. ##### Example (WINDOW 320 240 :TITLE-CAPTION "Random-Rects" :ICON-CAPTION "Random-Rects" :FLAGS '(SDL-DOUBLEBUF SDL-FULLSCREEN))

SETFX (VALUE OBJ)

Sets/Returns the `X` coordinate of the object, as an `INTEGER`.

SETFX2 (VALUE OBJ)

Returns `(+ X WIDTH)` of the object, as an `INTEGER`. Sets the WIDTH of the object to `(- X2 X)`

SETFY (VALUE OBJ)

Sets/Returns the `Y` coordinate of the object, as an `INTEGER`.

SETFY2 (VALUE OBJ)

Returns `(+ Y HEIGHT)` of the object, as an `INTEGER`. Sets the HEIGHT of the object to `(- Y2 Y)`

Undocumented

A (COLOR)

ALPHA (SURFACE)

ALPHA-ENABLED-P (SURFACE)

AUDIO-BUFFER-SIZE (AUDIO-SPEC)

AUDIO-BUFFER-SIZE-CALCULATED (AUDIO-SPEC)

AUDIO-FINISHED-CALLBACK (AUDIO-SPEC)

AUDIO-FORMAT (AUDIO-SPEC)

AUDIO-PLAYING-P (&OPTIONAL OBJ)

AUDIO-SILENCE (AUDIO-SPEC)

B (COLOR)

BUILD-AUDIO-CVT (AUDIO MIXER)

SETFCELLS (NUM SELF)

CLIP-RECT (SURFACE)

COLOR-KEY-ENABLED-P (SURFACE)

COPY-AUDIO (AUDIO-SPEC)

COPY-RECTANGLE (SELF)

FREE-CACHED-SURFACE (FONT)

G (COLOR)

HEIGHT (OBJ)

IMAGE-SUPPORTED-P (SOURCE)

LOAD-AND-CONVERT-IMAGE (SOURCE &KEY FORCE IMAGE-TYPE (COLOR-KEY-AT NIL) ALPHA COLOR-KEY &ALLOW-OTHER-KEYS)

LOAD-SAMPLE (FILENAME)

OUTPUT-CHANNELS (AUDIO-SPEC)

R (COLOR)

REGISTER-AUDIO-FINISHED (AUDIO-SPEC FN)

REWIND-AUDIO (AUDIO &OPTIONAL POS)

RLE-ACCEL-ENABLED-P (SURFACE)

SAMPLE-FREQUENCY (AUDIO-SPEC)

SAVE-IMAGE (SURFACE FILENAME)

SPEC-CALLBACK (AUDIO-SPEC)

SPEC-USER-DATA (AUDIO-SPEC)

UNREGISTER-AUDIO-FINISHED (AUDIO-SPEC)

WIDTH (OBJ)

X (OBJ)

X2 (OBJ)

Y (OBJ)

Y2 (OBJ)

Private

GET-RECTANGLE-* (OBJ)

Creates and returns a `RECTANGLE` object from the `X`, `Y`, `WIDTH` and `HEIGHT` values in obj.

PACK-COLOR-* (R G B &OPTIONAL A)

Packs [COLOR](#color) or [COLOR-A](#color-a) into a four byte `INTEGER`. Assumes an alpha component when `A` is not `NIL`.

PROCESS-TIMESTEP (FPSMNGR FN)

Manages the timestep. Called once per game loop.

SETFTARGET-FRAME-RATE (RATE FPSMNGR)

Set the target frame rate for the game loop. RATE > 0 will lock the game loop to the specified frame rate, and calculate the average frame rate over a number of frames. RATE = 0 will unlock the frame rate, and calculate the average frame rate over a number of frames. RATE < 0 will unlock the frame rate. The average frane rate is not calculated

THIS-FP (FOREIGN-OBJECT)

Returns the reference to the foreign object for this FOREIGN-OBJECT. The difference between FP and THIS-FP, is that FP can be overriden, for example to refer to the TARGET-NODE of a META-NODE.

Undocumented

%IMAGE-LOAD-IMAGE% (SOURCE &KEY COLOR-KEY ALPHA (IMAGE-TYPE NIL) (FORCE NIL) (FREE-RWOPS T) (COLOR-KEY-AT NIL))

%SDL-LOAD-IMAGE% (SOURCE &KEY COLOR-KEY ALPHA IMAGE-TYPE FORCE FREE-RWOPS (COLOR-KEY-AT NIL))

_AUDIO-PAUSED-P_ (AUDIO)

_AUDIO-PLAYING-P_ (AUDIO)

_AVERAGE-FPS_ (FPS-MANAGER)

_DRAW-STRING-BLENDED-*_ (STRING X Y JUSTIFY COLOR SURFACE FONT)

_DRAW-STRING-SHADED-*_ (STRING X Y FG-COLOR BG-COLOR JUSTIFY SURFACE FONT)

_DRAW-STRING-SOLID-*_ (STRING X Y JUSTIFY SURFACE FONT COLOR)

_FONT-FIXED-WIDTH-P_ (FONT)

_GET-FONT-ASCENT_ (FONT)

_GET-FONT-DESCENT_ (FONT)

_GET-FONT-FACE-FAMILY-NAME_ (FONT)

_GET-FONT-FACE-STYLE-NAME_ (FONT)

_GET-FONT-FACES_ (FONT)

_GET-FONT-HEIGHT_ (FONT)

_GET-FONT-LINE-SKIP_ (FONT)

_GET-FONT-SIZE_ (FONT TEXT SIZE)

_GET-FONT-STYLE_ (FONT)

_GET-GLYPH-METRIC_ (FONT CH METRIC)

_PAUSE-AUDIO_ (SELF)

_PLAY-AUDIO_ (AUDIO &KEY LOOP POS)

_RENDER-STRING-BLENDED_ (STRING FONT COLOR FREE CACHE)

_RENDER-STRING-SHADED_ (STRING FG-COLOR BG-COLOR FONT FREE CACHE)

_RENDER-STRING-SOLID_ (STRING FONT COLOR FREE CACHE)

_RESUME-AUDIO_ (SELF)

_SET-FONT-STYLE_ (FONT STYLE)

ASYNC-BLIT-P (SURFACE)

AUDIO-HALTED-P (AUDIO)

CHAR-DATA (FONT)

CLOSE-FONT (FONT)

COPY-CELLS (SELF &OPTIONAL INDEX)

FONT-DATA (FONT)

HALT-AUDIO (AUDIO &OPTIONAL IGNORE-CALLBACK)

HARDWARE-ACCEL-P (SURFACE)

HARDWARE-PALETTE-P (SURFACE)

HARDWARE-SURFACE-P (SURFACE)

OPEN-FONT (DEFINITION)

POST-PROCESS (AUDIO)

PRE-ALLOC-P (SURFACE)

RESET-CELLS (SELF)

SOFTWARE-SURFACE-P (SURFACE)

SLOT-ACCESSOR

Public

SETFCOLOR-KEY (VALUE SURFACE)

The Manages the colorkey for a `SURFACE`. Returns the current color key (transparent pixel) as [COLOR](#color). Set the (RGB) [COLOR](#color) key (transparent pixel).

FP (FOREIGN-OBJECT)

The Returns the foreign pointer in FOREIGN-OBJECT

SETFFP (NEW-VALUE OBJECT)

Set the Returns the foreign pointer in FOREIGN-OBJECT

Undocumented

AUDIO-BUFFER (OBJECT)

AUDIO-BUFFER-HANDLE (OBJECT)

AUDIO-LENGTH (OBJECT)

AUDIO-POSITION (OBJECT)

SETFAUDIO-POSITION (NEW-VALUE OBJECT)

AUDIO-REMAINING (OBJECT)

SETFAUDIO-REMAINING (NEW-VALUE OBJECT)

AUDIO-SPEC (AUDIO-SPEC)

AUDIO-VOLUME (OBJECT)

SETFAUDIO-VOLUME (NEW-VALUE OBJECT)

CACHED-SURFACE (OBJECT)

SETFCACHED-SURFACE (NEW-VALUE OBJECT)

CALLBACK-FINISHED (OBJECT)

SETFCALLBACK-FINISHED (NEW-VALUE OBJECT)

CELL-INDEX (OBJECT)

SETFCELL-INDEX (NEW-VALUE OBJECT)

CELLS (OBJECT)

CHAR-HEIGHT (FONT)

SETFCHAR-HEIGHT (NEW-VALUE OBJECT)

CHAR-WIDTH (FONT)

SETFCHAR-WIDTH (NEW-VALUE OBJECT)

COLOR-KEY (SURFACE)

DEFAULT-FONT-P (OBJECT)

SETFDEFAULT-FONT-P (NEW-VALUE OBJECT)

GC-P (OBJECT)

MIXER-OPENED-P (OBJECT)

OUTPUT-AUDIO-BUFFER-SIZE (OBJECT)

OUTPUT-BUFFER (OBJECT)

SETFOUTPUT-BUFFER (NEW-VALUE OBJECT)

REQUESTED-AUDIO-BUFFER-SIZE (OBJECT)

SETFREQUESTED-AUDIO-BUFFER-SIZE (NEW-VALUE OBJECT)

REQUESTED-AUDIO-FORMAT (OBJECT)

SETFREQUESTED-AUDIO-FORMAT (NEW-VALUE OBJECT)

REQUESTED-OUTPUT-CHANNELS (OBJECT)

SETFREQUESTED-OUTPUT-CHANNELS (NEW-VALUE OBJECT)

REQUESTED-SAMPLE-FREQUENCY (OBJECT)

SETFREQUESTED-SAMPLE-FREQUENCY (NEW-VALUE OBJECT)

Private

Undocumented

_DT_ (OBJECT)

ACCUMULATOR (OBJECT)

SETFACCUMULATOR (NEW-VALUE OBJECT)

AVERAGE-WINDOW (OBJECT)

SETFAVERAGE-WINDOW (NEW-VALUE OBJECT)

CHAR-PITCH (FONT)

CHAR-SIZE (FONT)

CHARACTER-MAP (OBJECT)

SETFCHARACTER-MAP (NEW-VALUE OBJECT)

CHARACTER-MASK (OBJECT)

SETFCHARACTER-MASK (NEW-VALUE OBJECT)

CHARACTERS (OBJECT)

CONVERTED-P (OBJECT)

CURRENT-TICKS (OBJECT)

SETFCURRENT-TICKS (NEW-VALUE OBJECT)

DATA (OBJECT)

SETFDATA (NEW-VALUE OBJECT)

DELAY-TICKS (OBJECT)

SETFDELAY-TICKS (NEW-VALUE OBJECT)

DELTA-TICKS (OBJECT)

SETFDELTA-TICKS (NEW-VALUE OBJECT)

DISPLAY-SURFACE-P (OBJECT)

SETFDISPLAY-SURFACE-P (NEW-VALUE OBJECT)

FILENAME (OBJECT)

SETFFILENAME (NEW-VALUE OBJECT)

FONT-DEFINITION (OBJECT)

FPS-TICKS (OBJECT)

SETFFPS-TICKS (NEW-VALUE OBJECT)

FRAME-COUNT (OBJECT)

SETFFRAME-COUNT (NEW-VALUE OBJECT)

INDEX (OBJECT)

SETFINDEX (NEW-VALUE OBJECT)

LAST-TICKS (OBJECT)

SETFLAST-TICKS (NEW-VALUE OBJECT)

LEN (OBJECT)

LOADER (OBJECT)

SETFLOADER (NEW-VALUE OBJECT)

LOOP-P (OBJECT)

SETFLOOP-P (NEW-VALUE OBJECT)

LOWER-LIMIT (OBJECT)

SETFLOWER-LIMIT (NEW-VALUE OBJECT)

NOT-THROUGH-P (OBJECT)

SETFNOT-THROUGH-P (NEW-VALUE OBJECT)

PINNED-VECTOR (OBJECT)

SETFPINNED-VECTOR (NEW-VALUE OBJECT)

PLAY-COUNT (OBJECT)

SETFPLAY-COUNT (NEW-VALUE OBJECT)

POSITION-RECT (OBJECT)

PS-FN (OBJECT)

SETFPS-FN (NEW-VALUE OBJECT)

RATE-TICKS (OBJECT)

SETFRATE-TICKS (NEW-VALUE OBJECT)

REMOVE-AUDIO-P (OBJECT)

SETFREMOVE-AUDIO-P (NEW-VALUE OBJECT)

TARGET-FRAME-RATE (OBJECT)

UPPER-LIMIT (OBJECT)

SETFUPPER-LIMIT (NEW-VALUE OBJECT)

WORLD (OBJECT)

SETFWORLD (NEW-VALUE OBJECT)

VARIABLE

Public

*ALLOW-CONVERT-TO-DISPLAY-FORMAT*

`CONVERT-TO-DISPLAY-FORMAT` will convert the input surface to the display format when `T`, and copy to a new surface when `NIL`.

*BLACK*

`RGB` [COLOR](#color) black.

*BLUE*

`RGB` [COLOR](#color) blue.

*CYAN*

`RGB` [COLOR](#color) cyan.

*DEFAULT-COLOR*

Functions that accept the `KEY`word parameter `COLOR` will most likely bind to the symbol `*DEFAULT-COLOR*` by default if `COLOR` is not specified. A color is bound to `*DEFAULT-COLOR*` by the following macro: [WITH-COLOR](#with-color). ##### Example (DRAW-BOX A-BOX :SURFACE SDL:DEFAULT-DISPLAY* :COLOR SDL:*BLACK*) (DRAW-BOX B-BOX :SURFACE SDL:DEFAULT-DISPLAY* :COLOR SDL:*BLACK*) (DRAW-BOX C-BOX :SURFACE SDL:DEFAULT-DISPLAY* :COLOR SDL:*BLACK*) The above can be shortened by setting `*DEFAULT-COLOR*` to `*BLACK*`. (WITH-SURFACE (DISP SDL:*DEFAULT-DISPLAY*) (WITH-COLOR (COL SDL:*BLACK*) (DRAW-BOX A-BOX) (DRAW-BOX B-BOX) (DRAW-BOX C-BOX)))

*DEFAULT-DISPLAY*

The symbol `*DEFAULT-DISPLAY*` is bound to the current display surface [DISPLAY-SURFACE](#display-surface)) by the function [WINDOW](#WINDOW)).

*DEFAULT-FONT*

Functions that accept the `KEY`word parameter `FONT` will most likely bind to the symbol `*DEFAULT-FONT*` by default if `FONT` is not specified. A font is bound to `*DEFAULT-FONT*` by the following; [WITH-DEFAULT-FONT](#with-default-font), [WITH-FONT](#with-font) and [INITIALISE-DEFAULT-FONT](#initialise-default-font). ##### Example (draw-string-solid-* "draw string centered" 100 100 :justify :center :color sdl:*white* :font a-font) (draw-string-solid-* "draw string left" 100 100 :justify :left :color sdl:*white* :font a-font) (draw-string-solid-* "draw string right" 100 100 :justify :right :color sdl:*white* :font a-font) The above can be shortened by setting `*DEFAULT-FONT*` to `a-font`. (WITH-DEFAULT-FONT (a-font) (WITH-COLOR (COL SDL:*WHITE*) (DRAW-STRING-SOLID-* "draw string centered" 100 100 :JUSTIFY :CENTER) (DRAW-STRING-SOLID-* "draw string left" 100 100 :JUSTIFY :LEFT) (DRAW-STRING-SOLID-* "draw string right" 100 100 :JUSTIFY :RIGHT)))

*DEFAULT-SURFACE*

Functions that accept the `KEY`word parameter `:SURFACE` will most likely bind to the symbol `*DEFAULT-SURFACE*` by default if `SURFACE` is not specified. A surface is bound to `*DEFAULT-SURFACE*` by the following macros: [WITH-SURFACE](#with-surface), and [WITH-SURFACES](#with-surfaces). ##### Example (DRAW-SURFACE SURF-1 :SURFACE SDL:*DEFAULT-DISPLAY*) (DRAW-SURFACE SURF-2 :SURFACE SDL:*DEFAULT-DISPLAY*) (DRAW-SURFACE SURF-2 :SURFACE SDL:*DEFAULT-DISPLAY*) The above can be shortened using by setting the `*DEFAULT-SURFACE*` to the display surface. (WITH-SURFACE (DISP SDL:*DEFAULT-DISPLAY*) (DRAW-SURFACE SURF-1) (DRAW-SURFACE SURF-2) (DRAW-SURFACE SURF-2))

*EXTERNAL-INIT-SUBSYSTEMS-ON-STARTUP*

The list of functions that are called from [INIT-SDL](#init-sdl).

*EXTERNAL-QUIT-SUBSYSTEMS-ON-EXIT*

The list of functions that are called from [QUIT-SDL](#quit-sdl).

*FONT-10X20*

Contains the font data for an 10x20 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-5X7*

Contains the font data for an 5x7 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-5X8*

Contains the font data for an 5x8 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-6X10*

Contains the font data for an 6x10 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-6X12*

Contains the font data for an 6x12 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-6X13*

Contains the font data for an 6x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-6X13B*

Contains the font data for an 6x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-6X13O*

Contains the font data for an 6x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-6X9*

Contains the font data for an 6x9 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-7X13*

Contains the font data for an 7x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-7X13B*

Contains the font data for an 7x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-7X13O*

Contains the font data for an 7x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-7X14*

Contains the font data for an 7x14 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-7X14B*

Contains the font data for an 7x14 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-8X13*

Contains the font data for an 8x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-8X13B*

Contains the font data for an 8x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-8X13O*

Contains the font data for an 8x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-8X8*

Contains the font data for an 8x8 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-9X15*

Contains the font data for an 9x15 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-9X15B*

Contains the font data for an 9x15 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-9X18*

Contains the font data for an 9x18 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*FONT-9X18B*

Contains the font data for an 9x18 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-10X20*

Contains the font data for an 10x20 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-5X7*

Contains the font data for an 5x7 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-5X8*

Contains the font data for an 5x8 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-6X10*

Contains the font data for an 6x10 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-6X12*

Contains the font data for an 6x12 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-6X13*

Contains the font data for an 6x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-6X13B*

Contains the font data for an 6x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-6X13O*

Contains the font data for an 6x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-6X9*

Contains the font data for an 6x9 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-7X13*

Contains the font data for an 7x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-7X13B*

Contains the font data for an 7x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-7X13O*

Contains the font data for an 7x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-7X14*

Contains the font data for an 7x14 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-7X14B*

Contains the font data for an 7x14 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-8X13*

Contains the font data for an 8x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-8X13B*

Contains the font data for an 8x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-8X13O*

Contains the font data for an 8x13 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-8X8*

Contains the font data for an 8x8 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-9X15*

Contains the font data for an 9x15 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-9X15B*

Contains the font data for an 9x15 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-9X18*

Contains the font data for an 9x18 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GFX-FONT-9X18B*

Contains the font data for an 9x18 bitmap font. ##### Packages * Also supported in _LISPBUILDER-SDL-GFX_

*GREEN*

`RGB` [COLOR](#color) green.

*MAGENTA*

`RGB` [COLOR](#color) magenta.

*RED*

`RGB` [COLOR](#color) red.

*WHITE*

`RGB` [COLOR](#color) white.

*YELLOW*

`RGB` [COLOR](#color) yellow.

Undocumented

*DEFAULT-ASSET-PATH*

*DEFAULT-AUDIO-PATH*

*DEFAULT-FONT-PATH*

*DEFAULT-FPSMANAGER*

*DEFAULT-IMAGE-PATH*

*DEFAULT-POSITION*

*DEFAULT-RECTANGLE*

*DEFAULT-TTF-FONT*

*GFX-LOADED-P*

*GLUE-LOADED-P*

*IMAGE-LOADED-P*

*MANAGED-AUDIO*

*MIXER*

*QUIT-ON-EXIT*

*SDL-EVENT*

*SIMPLE-FONT-4X5*

MOUSE-LEFT

MOUSE-MIDDLE

MOUSE-RIGHT

MOUSE-WHEEL-DOWN

MOUSE-WHEEL-UP

MOUSE-X1

MOUSE-X2

Private

*OPENGL-CONTEXT*

The symbol `*OPENGL-CONTEXT*` is `T` when an OpenGL display context is created, and `NIL` otherwise. [UPDATE-SURFACE](#update-surface) will swap the `OPENGL` buffers when `*OPENGL-CONTEXT*` is `T`, and swap the `SDL` video buffers otherwise.

Undocumented

*10X20-FONT-DATA*

*5X7-FONT-DATA*

*5X8-FONT-DATA*

*6X10-FONT-DATA*

*6X12-FONT-DATA*

*6X13-FONT-DATA*

*6X13B-FONT-DATA*

*6X13O-FONT-DATA*

*6X9-FONT-DATA*

*7X13-FONT-DATA*

*7X13B-FONT-DATA*

*7X13O-FONT-DATA*

*7X14-FONT-DATA*

*7X14B-FONT-DATA*

*8X13-FONT-DATA*

*8X13B-FONT-DATA*

*8X13O-FONT-DATA*

*8X8-FONT-DATA*

*9-18B-FONT-DATA*

*9X15-FONT-DATA*

*9X15B-FONT-DATA*

*9X18-FONT-DATA*

*ADDITIONAL-IMAGE-SUPPORT*

*BASE-IMAGE-SUPPORT*

*CURRENT-IMAGE-SUPPORT*

*EVENT-FILTERS*

*EVENTS*

*FF-MAX-HEIGHT*

*FF-STACK*

*FF-STACK-POINTER*

*FF-STACK-SIZE*

*FILTER-ACTIVE-EVENT*

*FILTER-EVENT-HOOKS*

*FILTER-JOY-AXIS-MOTION-EVENT*

*FILTER-JOY-BALL-MOTION-EVENT*

*FILTER-JOY-BUTTON-DOWN-EVENT*

*FILTER-JOY-BUTTON-UP-EVENT*

*FILTER-JOY-HAT-MOTION-EVENT*

*FILTER-KEY-DOWN-EVENT*

*FILTER-KEY-UP-EVENT*

*FILTER-MOUSE-BUTTON-DOWN-EVENT*

*FILTER-MOUSE-BUTTON-UP-EVENT*

*FILTER-MOUSE-MOTION-EVENT*

*FILTER-QUIT-EVENT*

*FILTER-SYS-WM-EVENT*

*FILTER-USER-EVENT*

*FILTER-VIDEO-EXPOSE-EVENT*

*FILTER-VIDEO-RESIZE-EVENT*

*INITIALIZE-SUBSYSTEMS-ON-STARTUP*

*INITIALIZED*

*INPUT-EVENT-STATUS*

*INPUT-UTIL-INITIALISED*

*M11*

*M12*

*M13*

*M14*

*M21*

*M22*

*M23*

*M24*

*M31*

*M32*

*M33*

*M34*

*M41*

*M42*

*M43*

*M44*

*QUIT-SUBSYSTEMS-ON-EXIT*

CLASS

Public

COLOR (&KEY (R 0) (G 0) (B 0) (A NIL))

A color containing `INTEGER` Red, Green and Blue components. Free using [FREE](#free).

COLOR-A

An color containing `INTEGER` Red, Green, Blue and Alpha components. Free using [FREE](#free).

DISPLAY-SURFACE

The current display surface. Can be accessed using `SDL:*DEFAULT-DISPLAY*`.

RECTANGLE (&KEY (X 0) (Y 0) (W 0) (H 0) (FP NIL))

A `RECTANGLE` object manages the foreign SDL_Rect object. Free using [FREE](#free).

RWOPS

A wrapper around a foreign SDL_RWops object. Free using [FREE](#free).

SDL-BITMAP-FONT

The `SDL-BITMAP-FONT` object manages the resources for a bitmap font. Prior to the first call to a `RENDER-STRING*` function, the cached [SURFACE](#surface) is `NIL`. The cached surface is created by a call to any of the RENDER-STRING* functions. Use [DRAW-FONT](#draw-font), [DRAW-FONT-AT](#draw-font-at) or [DRAW-FONT-AT-*](#draw-font-at-*) to draw the cached surface. Free using [FREE](#free)

SDL-SURFACE

A wrapper for the foreign SDL_Surface object.

SURFACE

This object is garbage collected and the `SDL_Surface` object freed when out of scope. Free using [FREE](#free).

Undocumented

AUDIO

AUDIO-BUFFER (OBJECT)

AUDIO-CVT

AUDIO-SPEC (AUDIO-SPEC)

BITMAP-FONT

FPS-FIXED

FPS-MIXED

FPS-TIMESTEP

FPS-UNLOCKED

GFX-BITMAP-FONT

MIXER

PIXELS

SIMPLE-FONT-DEFINITION

Private

FONT

The generic SDL font class. All fonts in `LISPBUILDER-SDL` inherit from this class. Free using [FREE](#free).

PINNED-SURFACE

This object is garbage collected and the `SDL_Surface` object freed when out of scope. Free using [FREE](#free).

Undocumented

BITMAP-FONT-DEFINITION

DISPLAY

FONT-DEFINITION (OBJECT)

FOREIGN-OBJECT

FPS-MANAGER

FPS-MANAGER-TCLASS

GFX-FONT-DEFINITION

GLYPH (CHAR FONT)

INPUT-STATUS

JOYSTICK

RECTANGLE-ARRAY

T-COLOR-RGBA-TCLASS

T-COLOR-Y-TCLASS

CONSTANT

Public

+CHANNEL-POST+

Default channel of `-2` used for post-processing.

+CHANNELS+

Default number of `8` mixer channels.

+DEFAULT-CHANNELS+

Default number of `2` sound channels for Stereo output.

+DEFAULT-FORMAT+

Default SDL audio format; little-endian is `SDL:AUDIO-S16LSB`, big-endian is `SDL:AUDIO-S16MSB`. Audio formats are defined in `SDL_audio.h`; * `SDL:AUDIO-U8` : Unsigned 8-bit samples * `SDL:AUDIO-S8` : Signed 8-bit samples * `SDL:AUDIO-U16LSB` : Unsigned 16-bit samples, in little-endian byte order * `SDL:AUDIO-S16LSB` : Signed 16-bit samples, in little-endian byte order * `SDL:AUDIO-U16MSB` : Unsigned 16-bit samples, in big-endian byte order * `SDL:AUDIO-S16MSB` : Signed 16-bit samples, in big-endian byte order * `SDL:AUDIO-U16` : same as `SDL:AUDIO-U16LSB` (for backwards compatability probably) * `SDL:AUDIO-S16` : same as `SDL:AUDIO-S16LSB` (for backwards compatability probably) * `SDL:AUDIO-U16SYS` : Unsigned 16-bit samples, in system byte order * `SDL:AUDIO-S16SYS` : Signed 16-bit samples, in system byte order

+DEFAULT-FREQUENCY+

Default sampling frequency of `22,050hz`

+DEFAULT-SAMPLE-BUFFER+

Default size of the sample output buffer is `4096` bytes

+MAX-VOLUME+

Default volume of `128` for [CHUNK](#chunk), output channels and mix channels.

SDL-ANY-FORMAT

Applies to [DISPLAY-SURFACE](#display-surface). * When passed as a `FLAG` to [WINDOW](#window); Causes SDL to return a [DISPLAY-SURFACE](#display-surface) of any pixel depth if the requested pixel depth is unavailable. * When read from the `FLAGS` field in [DISPLAY-SURFACE](#display-surface); Indicates that the surface was created with `SDL-ANY-FORMAT`. Normally, if a [DISPLAY-SURFACE](#display-surface) of the requested bits-per-pixel (bpp) is not available, SDL will emulate one with a shadow surface. Passing `SDL-ANY-FORMAT` prevents this and causes SDL to use the [DISPLAY-SURFACE](#display-surface) surface, regardless of its pixel depth.

SDL-ASYNC-BLIT

Applies to [DISPLAY-SURFACE](#display-surface). * When passed as a `FLAG` to [WINDOW](#window); Enables the use of asynchronous updates of the [DISPLAY-SURFACE](#display-surface). * When read from the `FLAGS` field in [SURFACE](#surface) or [DISPLAY-SURFACE](#display-surface); Indicates if the surface uses asynchronous blits when possible. Asynchronous blits usually slows down blitting on single CPU machines, but may provide a speed increase on SMP systems.

SDL-DOUBLEBUF

Applies to [DISPLAY-SURFACE](#display-surface). * When passed as a `FLAG` to [WINDOW](#window); Enable hardware double buffering; only valid with [SDL-HW-SURFACE](#sdl-hw-surface). * When read from the `FLAGS` field in [DISPLAY-SURFACE](#display-surface); Indicages that the surface is double buffered. Calling [SDL-FLIP](#sdl-flip) will flip the buffers and update the screen. All drawing will take place on the surface that is not displayed at the moment. If double buffering could not be enabled then [SDL-FLIP](#sdl-flip) will just perform a [SDL-UPDATE-RECT](#sdl-update-rect) on the entire screen.

SDL-FULLSCREEN

Applies to [DISPLAY-SURFACE](#display-surface). * When passed as a `FLAG` to [WINDOW](#window); SDL will attempt to use a fullscreen mode. If a hardware resolution change is not possible (for whatever reason), the next higher resolution will be used and the display window centered on a black background. * When read from the `FLAGS` field in [DISPLAY-SURFACE](#display-surface); Indicates that the surface is full-screen.

SDL-HW-ACCEL

Applies to [SURFACE](#surface) and [DISPLAY-SURFACE](#display-surface). * When read from the `FLAGS` field in [SURFACE](#surface) and [DISPLAY-SURFACE](#display-surface); Indicates that surface blitting will use hardware acceloration.

SDL-HW-PALETTE

Applies to [SURFACE](#surface) and [DISPLAY-SURFACE](#display-surface). * When passed as a `FLAG` to [WINDOW](#window); Gives SDL exclusive palette access to [DISPLAY-SURFACE](#display-surface). * When read from the `FLAGS` field in [SURFACE](#surface) or [DISPLAY-SURFACE](#display-surface); Indicates that the surface has an exclusive palette. Without this flag you may not always get the the colors you request with [SDL-SET-COLORS](#sdl-set-colors) or [SDL-SET-PALETTE](#sdl-set-palette).

SDL-HW-SURFACE

Applies to [SURFACE](#surface) and [DISPLAY-SURFACE](#display-surface). * When passed as a `FLAG` to [WINDOW](#window) or [CREATE-SURFACE](#create-surface); Create the [SURFACE](#surface) or [DISPLAY-SURFACE](#display-surface) in video memory. * When read from the `FLAGS` field in [SURFACE](#surface) or [DISPLAY-SURFACE](#display-surface); Indicates if the surface is stored in video memory. This will allow SDL to take advantage of Video->Video blits (which are often accelerated).

SDL-NO-FRAME

Applies to [DISPLAY-SURFACE](#display-surface). * When passed as a `FLAG` to [WINDOW](#window); If possible, `SDL-NO-FRAME` causes SDL to create a window with no title bar or frame decoration. * When read from the `FLAGS` field in [DISPLAY-SURFACE](#display-surface); __Note: Per the SDL documentation, this is not stored in `FLAGS`. Fullscreen modes automatically have this flag set.

SDL-OPENGL

Applies to [DISPLAY-SURFACE](#display-surface). * When passed as a `FLAG` to [WINDOW](#window); Create an OpenGL rendering context. You should have previously set OpenGL video attributes with [SET-GL-ATTRIBUTE](#set-gl-attribute). * When read from the `FLAGS` field in [DISPLAY-SURFACE](#display-surface) Indicates that the surface has an OpenGL rendering context.

SDL-PRE-ALLOC

Applies to [SURFACE](#surface). * When read from the `FLAGS` field in [SURFACE](#surface); Indicates that surface uses preallocated memory.

SDL-RESIZABLE

Applies to [DISPLAY-SURFACE](#display-surface). * When passed as a `FLAG` to [WINDOW](#window); Create a resizable window. * When read from the `FLAGS` field in [DISPLAY-SURFACE](#display-surface); Indicates that the surface is resizable. When the window is resized by the user a :VIDEO-RESIZE-EVENT event is generated and [WINDOW](#window) can be called again with the new size.

SDL-RLE-ACCEL

Applies to [SURFACE](#surface) * When passed as a `FLAG` to [SET-COLOR-KEY](#set-color-key); The surface will be drawn using RLE acceleration when drawn with [BLIT-SURFACE](#blit-surface), and [DRAW-SURFACE](#draw-surface). The surface will actually be encoded for RLE acceleration the first time [BLIT-SURFACE](#blit-surface), [DRAW-SURFACE](#draw-surface) or [CONVERT-SURFACE](#convert-surface) is called on the surface. * When read from the `FLAGS` field in [SURFACE](#surface); Indicates that colorkey blitting is accelerated with RLE. RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i.e., pixels that match the key color). The key must be of the same pixel format as the surface, [MAP-COLOR](#map-color) is often useful for obtaining an acceptable value.

SDL-RLE-ACCEL-OK

Applies to [SURFACE](#surface).

SDL-SRC-ALPHA

Applies to [SURFACE](#surface). * When passed as a `FLAG` to [CREATE-SURFACE](#create-surface) and [SET-ALPHA](#set-alpha); Turns on alpha-blending for blits from this surface. If [SDL-HW-SURFACE](#sdl-hw-surface) is also specified and alpha-blending blits are hardware-accelerated, then the surface will be placed in video memory if possible. If the screen is a hardware surface and alpha-blending blits are hardware-accelerated then the [SDL-HW-SURFACE](#sdl-hw-surface) flag will be set. Use [SET-ALPHA](#set-alpha) to set or clear this flag after surface creation. * When read from the `FLAGS` field in [SURFACE](#surface); Indicates that surface blitting uses alpha blending.

SDL-SRC-COLOR-KEY

Applies to [SURFACE](#surface). * When passed as a `FLAG` to [CREATE-SURFACE](#create-surface) and [SET-COLOR-KEY](#set-color-key); Turns on color keying for blits from this surface. If [SDL-HW-SURFACE](#sdl-hw-surface) is also specified and color keyed blits are hardware-accelerated, then SDL will attempt to place the surface in video memory. If the screen is a hardware surface and color keyed blits are hardware-accelerated then the [SDL-HW-SURFACE](#sdl-hw-surface) flag will be set. Use [SET-COLOR-KEY](#set-color-key) to set or clear this flag after surface creation. * When read from the `FLAGS` field in [SURFACE](#surface); Indicates that the surface uses colorkey blitting.

SDL-SW-SURFACE

Applies to [SURFACE](#surface) and [DISPLAY-SURFACE](#display-surface). * When passed as a `FLAG` to [WINDOW](#window) or [CREATE-SURFACE](#create-surface); Create the [SURFACE](#surface) or [DISPLAY-SURFACE](#display-surface) in system memory. * When read from the `FLAGS` field in [SURFACE](#surface) or [DISPLAY-SURFACE](#display-surface); Indicates if the surface is stored in system memory. This improves the performance of pixel level access, however you may not be able to take advantage of some types of hardware blitting.

Undocumented

+MAX-AUDIO-16+

+MAX-AUDIO-8+

+MIN-AUDIO-16+

+MIN-AUDIO-8+

SDL-BUTTON-LEFT

SDL-BUTTON-MIDDLE

SDL-BUTTON-RIGHT

SDL-BUTTON-WHEEL-DOWN

SDL-BUTTON-WHEEL-UP

SDL-BUTTON-X1

SDL-BUTTON-X2

SDL-INIT-AUDIO

SDL-INIT-CDROM

SDL-INIT-EVENTTHREAD

SDL-INIT-EVERYTHING

SDL-INIT-JOYSTICK

SDL-INIT-NOPARACHUTE

SDL-INIT-TIMER

SDL-INIT-VIDEO

SDL-IYUV-OVERLAY

SDL-UYVY-OVERLAY

SDL-YUY2-OVERLAY

SDL-YV12-OVERLAY

SDL-YVYU-OVERLAY

Private

Undocumented

FPS-DEFAULT

FPS-LOWER-LIMIT

FPS-UPPER-LIMIT

M-PI

SMOOTHING-OFF

SMOOTHING-ON