Common Lisp Package: LISPBUILDER-SDL-BASE

The basic wrapper package of `lispbuilder-sdl'.

README:

FUNCTION

Public

BLIT-SURFACE (SRC DST SRC-RECT DST-RECT &KEY (UPDATE NIL))

Blits the entire SRC Sdl-Surface to the DST Sdl-Surface using SDL_BlitSurface. use :src-rect SDL_Rect to blit only a portion of the SRC to the DST surface Use :dst-rect SDL_Rect to position the SRC on the DST surface.

CLAMP (V L U)

Returns V clamped to L <= V <= U.

CLONE-RECTANGLE (SRC)

Initializes and returns a new rectangle with the contents of the rectangle SRC. SRC and DST are both of type SDL_Rect.

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

Returns a new surface that has been converted to the display format and optionally free the source surface. Returns NIL if the surface cannot be converted.

COPY-RECTANGLE (SRC DST)

Copies the contents of the rectangle SRC to the rectangle DST. SRC and DST are both of type SDL_Rect.

CREATE-SURFACE (WIDTH HEIGHT &KEY (BPP 32) SURFACE (TYPE SW) ENABLE-COLOR-KEY PIXEL-ALPHA ENABLE-ALPHA RLE-ACCEL PIXELS PITCH MASK)

create a surface compatible with the supplied :surface, if provided.

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

Fill the entire surface with the specified RGB/A color. Use :template to specify the SDL_Rect to be used as the fill template. Use :update to call SDL_UpdateRect, using :template if provided. This allows for a 'dirty recs' screen update. *Note*: `TEMPLATE` is clipped to the surface `SURFACE`, when `CLIPPING` is `T`.

IS-VALID-PTR (POINTER)

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

MUST-LOCK? (SURFACE)

Checks if a surface can be locked. Re-implementation of the SDL_MUSTLOCK macro. Returns T if the surface can be locked. NIL if the surface cannot be locked.

PIXEL-FORMAT (SURFACE)

Returns the pixel format of a surface.

RECTANGLE (&KEY (X 0) (Y 0) (W 0) (H 0) SRC)

Creates a new rectangle initialized with values x, y, width W and height H, or the contents of rectangle SRC if specified.

SURF-H (SURFACE)

return the height of the Sdl-Surface.

SURF-W (SURFACE)

return the width of the SDL_surface.

TO-INT (NUM)

Returns num as an INTEGER.

UPDATE-SURFACE (SURFACE &KEY TEMPLATE X Y W H (CLIPPING T))

Updates the screen using the keyword co-ordinates in the Vector, :template. All co-ordinates default to 0, updating the entire screen.

Undocumented

CREATE-RWOPS-FROM-FILE (FILENAME)

GET-SURFACE-RECT (SURFACE RECTANGLE)

RECT-H (RECT)

SETFRECT-H (H-VAL RECT)

RECT-W (RECT)

SETFRECT-W (W-VAL RECT)

RECT-X (RECT)

SETFRECT-X (X-VAL RECT)

RECT-X2 (RECT)

SETFRECT-X2 (H-VAL RECT)

RECT-Y (RECT)

SETFRECT-Y (Y-VAL RECT)

RECT-Y2 (RECT)

SETFRECT-Y2 (H-VAL RECT)

Private

CLIP-TO-COORDS (X Y W H W-COORD H-COORD)

Clips the rectangle `TEMPLATE` to the `X`, `Y`, `WIDTH` and `HEIGHT` coordinates. *Note*: `TEMPLATE` is modified.

CLIP-TO-SURFACE (TEMPLATE SURFACE)

Clips the rectangle `TEMPLATE` to the surface `SURFACE`s `X`, `Y`, `WIDTH` and `HEIGHT`. *Note*: `TEMPLATE` is modified.

CONVERT-SURFACE (SURFACE TO-SURFACE &KEY ENABLE-COLOR-KEY ENABLE-ALPHA (RLE-ACCEL NIL) (TYPE SW) (FREE NIL))

Returns a new surface of the specified pixel format, and then copies and maps the given surface to it. Returns NIL if the surface cannot be converted.

GET-PIXEL (SURFACE X Y)

Get the pixel at (x, y) as a Uint32 color value NOTE: The surface must be locked before calling this. Also NOTE: Have not tested 1,2,3 bpp surfaces, only 4 bpp

LOAD-IMAGE (FILENAME)

load in the supplied filename, must be a bmp file

PIXELS-BPP (INSTANCE)

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

PIXELS-FP-DATA (INSTANCE)

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

PIXELS-FP-READER (INSTANCE)

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

PIXELS-FP-WRITER (INSTANCE)

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

PIXELS-PITCH (INSTANCE)

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

SET-PIXEL (SURFACE X Y COLOR)

Set the pixel at (x, y) to the given value NOTE: The surface must be locked before calling this. Also NOTE: Have not tested 1,2,3 bpp surfaces, only 4 bpp

VEC-TO-INT (VEC)

vec-to-int will create a new VECTOR of the same length as VEC, but the contents are converted to integers. Returns VEC if the contents are not of type float.

Undocumented

1/0->T/NIL (VAL)

ALPHA (SURFACE)

SETFALPHA (VALUE SURFACE)

ALPHA-ENABLED-P (SURFACE)

SETFALPHA-ENABLED-P (VALUE SURFACE)

CLAMP-TO-SBYTE (V)

CLAMP-TO-SSHORT (V)

CLAMP-TO-UBYTE (V)

CLAMP-TO-USHORT (V)

COLOR-KEY (SURFACE)

SETFCOLOR-KEY (VALUE SURFACE)

COLOR-KEY-ENABLED-P (SURFACE)

SETFCOLOR-KEY-ENABLED-P (VALUE SURFACE)

COPY-PIXELS (INSTANCE)

DELTA-CLAMP (V D L U)

GENERATE-READ-PIXEL (SURFACE)

GENERATE-WRITE-PIXEL (SURFACE)

GET-CLIP-RECT (SURFACE RECTANGLE)

INIT-P (&KEY (FLAGS))

INIT-SDL (&KEY (FLAGS NIL))

MAKE-PIXELS (&KEY ((FP-READER DUM0) #'(LAMBDA () NIL)) ((FP-WRITER DUM1) #'(LAMBDA () NIL)) ((FP-DATA DUM2) NIL) ((BPP DUM3) NIL) ((PITCH DUM4) NIL))

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

MAP-PIXEL (PIXEL SURFACE &OPTIONAL A)

PIXEL-ALPHA-ENABLED-P (SURFACE)

PIXEL-BPP (PIXELS)

PIXEL-DATA (PIXELS)

PIXEL-PITCH (PIXELS)

SETFPIXELS-BPP (NEW-VALUE INSTANCE)

SETFPIXELS-FP-DATA (NEW-VALUE INSTANCE)

SETFPIXELS-FP-READER (NEW-VALUE INSTANCE)

SETFPIXELS-FP-WRITER (NEW-VALUE INSTANCE)

PIXELS-P (OBJECT)

SETFPIXELS-PITCH (NEW-VALUE INSTANCE)

READ-PIXEL (PIXELS X Y)

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

RETURN-WITH-LOCKED-SURFACE (BINDINGS BODY)

RETURN-WITH-PIXELS (BINDINGS BODY)

RETURN-WITH-RECTANGLE (BINDINGS BODY)

RETURN-WITH-SURFACE (BINDINGS BODY)

RLE-ACCEL-ENABLED-P (SURFACE)

SETFRLE-ACCEL-ENABLED-P (VALUE SURFACE)

SET-CLIP-RECT (SURFACE RECTANGLE)

SET-FLAGS (&REST KEYWORD-ARGS)

SURFACE-FLAG (SURFACE FLAG)

WRITE-PIXEL (PIXELS X Y COLOR)

MACRO

Public

CHECK-BOUNDS (MIN BELOW &REST VARS)

Clamps the values in VARS to MIN <= VARS <= BELOW. Returns as a list the values in VARS.

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

Don't use this for managing the display surface.

Undocumented

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

WITH-POSSIBLE-LOCK-AND-UPDATE ((VAR &KEY SURFACE TEMPLATE) &BODY BODY)

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

WITH-SURFACES (BINDINGS &REST BODY)

Private

WITH-INIT (INIT-FLAGS &BODY BODY)

Attempts to initialize the SDL subsystems using SDL-Init. Automatically shuts down the SDL subsystems using SDL-Quit upon normal application termination or if any fatal error occurs within &body. init-flags can be any combination of SDL-INIT-TIMER, SDL-INIT-AUDIO, SDL-INIT-VIDEO, SDL-INIT-CDROM, SDL-INIT-JOYSTICK, SDL-INIT-NOPARACHUTE, SDL-INIT-EVENTTHREAD or SDL-INIT-EVERYTHING.

Undocumented

WITH-LOCKED-SURFACES (BINDINGS &REST BODY)

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

WITH-PIXELS (BINDINGS &REST BODY)

WITH-RECTANGLES (BINDINGS &BODY BODY)

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

CLASS

Private

Undocumented

PIXELS