cl-sdl2

API Reference

sdl2

Bindings for SDL2 using c2ffi.

SDL2

  • Variable +PIXELFORMAT-UNKNOWN+
    sdl2-ffi:+sdl-pixelformat-unknown+
  • Variable +PIXELFORMAT-INDEX1LSB+
    sdl2-ffi:+sdl-pixelformat-index1lsb+
  • Variable +PIXELFORMAT-INDEX1MSB+
    sdl2-ffi:+sdl-pixelformat-index1msb+
  • Variable +PIXELFORMAT-INDEX14LSB+
    sdl2-ffi:+sdl-pixelformat-index4lsb+
  • Variable +PIXELFORMAT-INDEX14MSB+
    sdl2-ffi:+sdl-pixelformat-index4msb+
  • Variable +PIXELFORMAT-INDEX8+
    sdl2-ffi:+sdl-pixelformat-index8+
  • Variable +PIXELFORMAT-RGB332+
    sdl2-ffi:+sdl-pixelformat-rgb332+
  • Variable +PIXELFORMAT-RGB444+
    sdl2-ffi:+sdl-pixelformat-rgb444+
  • Variable +PIXELFORMAT-RGB555+
    sdl2-ffi:+sdl-pixelformat-rgb555+
  • Variable +PIXELFORMAT-BGR555+
    sdl2-ffi:+sdl-pixelformat-bgr555+
  • Variable +PIXELFORMAT-ARGB4444+
    sdl2-ffi:+sdl-pixelformat-argb4444+
  • Variable +PIXELFORMAT-RGBA4444+
    sdl2-ffi:+sdl-pixelformat-rgba4444+
  • Variable +PIXELFORMAT-ABGR4444+
    sdl2-ffi:+sdl-pixelformat-abgr4444+
  • Variable +PIXELFORMAT-ABGR1555+
    sdl2-ffi:+sdl-pixelformat-abgr1555+
  • Variable +PIXELFORMAT-BGRA5551+
    sdl2-ffi:+sdl-pixelformat-bgra5551+
  • Variable +PIXELFORMAT-RGB565+
    sdl2-ffi:+sdl-pixelformat-rgb565+
  • Variable +PIXELFORMAT-BGR565+
    sdl2-ffi:+sdl-pixelformat-bgr565+
  • Variable +PIXELFORMAT-RGB24+
    sdl2-ffi:+sdl-pixelformat-rgb24+
  • Variable +PIXELFORMAT-BGR24+
    sdl2-ffi:+sdl-pixelformat-bgr24+
  • Variable +PIXELFORMAT-RGB888+
    sdl2-ffi:+sdl-pixelformat-rgb888+
  • Variable +PIXELFORMAT-RGBX8888+
    sdl2-ffi:+sdl-pixelformat-rgbx8888+
  • Variable +PIXELFORMAT-BGR888+
    sdl2-ffi:+sdl-pixelformat-bgr888+
  • Variable +PIXELFORMAT-BGRX8888+
    sdl2-ffi:+sdl-pixelformat-bgrx8888+
  • Variable +PIXELFORMAT-ARGB8888+
    sdl2-ffi:+sdl-pixelformat-argb8888+
  • Variable +PIXELFORMAT-RGBA8888+
    sdl2-ffi:+sdl-pixelformat-rgba8888+
  • Variable +PIXELFORMAT-BGR8888+
    sdl2-ffi:+sdl-pixelformat-abgr8888+
  • Variable +PIXELFORMAT-BGRA8888+
    sdl2-ffi:+sdl-pixelformat-bgra8888+
  • Variable +PIXELFORMAT-RGB2101010+
    sdl2-ffi:+sdl-pixelformat-argb2101010+
  • Variable +PIXELFORMAT-RGBA32+
    sdl2-ffi:+sdl-pixelformat-rgba32+
  • Variable +PIXELFORMAT-ARGB32+
    sdl2-ffi:+sdl-pixelformat-argb32+
  • Variable +PIXELFORMAT-BGRA32+
    sdl2-ffi:+sdl-pixelformat-bgra32+
  • Variable +PIXELFORMAT-ABGR32+
    sdl2-ffi:+sdl-pixelformat-abgr32+
  • Variable +PIXELFORMAT-YV12+
    sdl2-ffi:+sdl-pixelformat-yv12+
  • Variable +PIXELFORMAT-IYUV+
    sdl2-ffi:+sdl-pixelformat-iyuv+
  • Variable +PIXELFORMAT-YUY2+
    sdl2-ffi:+sdl-pixelformat-yuy2+
  • Variable +PIXELFORMAT-UYVY+
    sdl2-ffi:+sdl-pixelformat-uyvy+
  • Variable +PIXELFORMAT-YVYU+
    sdl2-ffi:+sdl-pixelformat-yvyu+
  • Variable +PIXELFORMAT-NV12+
    sdl2-ffi:+sdl-pixelformat-nv12+
  • Variable +PIXELTYPE-UNKNOWN+
    sdl2-ffi:+sdl-pixeltype-unknown+
  • Variable +PIXELTYPE-INDEX1+
    sdl2-ffi:+sdl-pixeltype-index1+
  • Variable +PIXELTYPE-INDEX4+
    sdl2-ffi:+sdl-pixeltype-index4+
  • Variable +PIXELTYPE-INDEX8+
    sdl2-ffi:+sdl-pixeltype-index8+
  • Variable +PIXELTYPE-PACKED8+
    sdl2-ffi:+sdl-pixeltype-packed8+
  • Variable +PIXELTYPE-PACKED16+
    sdl2-ffi:+sdl-pixeltype-packed16+
  • Variable +PIXELTYPE-PACKED32+
    sdl2-ffi:+sdl-pixeltype-packed32+
  • Variable +PIXELTYPE-ARRAYU8+
    sdl2-ffi:+sdl-pixeltype-arrayu8+
  • Variable +PIXELTYPE-ARRAYU16+
    sdl2-ffi:+sdl-pixeltype-arrayu16+
  • Variable +PIXELTYPE-ARRAYU32+
    sdl2-ffi:+sdl-pixeltype-arrayu32+
  • Variable +PIXELTYPE-ARRAYF16+
    sdl2-ffi:+sdl-pixeltype-arrayf16+
  • Variable +PIXELTYPE-ARRAYF32+
    sdl2-ffi:+sdl-pixeltype-arrayf32+
  • Variable +BITMAPORDER-NONE+
    sdl2-ffi:+sdl-bitmaporder-none+
  • Variable +BITMAPORDER-4321+
    sdl2-ffi:+sdl-bitmaporder-4321+
  • Variable +BITMAPORDER-1234+
    sdl2-ffi:+sdl-bitmaporder-1234+
  • Variable +PACKEDORDER-NONE+
    sdl2-ffi:+sdl-packedorder-none+
  • Variable +PACKEDORDER-XRGB+
    sdl2-ffi:+sdl-packedorder-xrgb+
  • Variable +PACKEDORDER-RGBX+
    sdl2-ffi:+sdl-packedorder-rgbx+
  • Variable +PACKEDORDER-ARGB+
    sdl2-ffi:+sdl-packedorder-argb+
  • Variable +PACKEDORDER-RGBA+
    sdl2-ffi:+sdl-packedorder-rgba+
  • Variable +PACKEDORDER-XBGR+
    sdl2-ffi:+sdl-packedorder-xbgr+
  • Variable +PACKEDORDER-BGRX+
    sdl2-ffi:+sdl-packedorder-bgrx+
  • Variable +PACKEDORDER-ABGR+
    sdl2-ffi:+sdl-packedorder-abgr+
  • Variable +PACKEDORDER-BGRA+
    sdl2-ffi:+sdl-packedorder-bgra+
  • Variable +ARRAYORDER-NONE+
    sdl2-ffi:+sdl-arrayorder-none+
  • Variable +ARRAYORDER-RGB+
    sdl2-ffi:+sdl-arrayorder-rgb+
  • Variable +ARRAYORDER-RGBA+
    sdl2-ffi:+sdl-arrayorder-rgba+
  • Variable +ARRAYORDER-ARGB+
    sdl2-ffi:+sdl-arrayorder-argb+
  • Variable +ARRAYORDER-BGR+
    sdl2-ffi:+sdl-arrayorder-bgr+
  • Variable +ARRAYORDER-BGRA+
    sdl2-ffi:+sdl-arrayorder-bgra+
  • Variable +ARRAYORDER-ABGR+
    sdl2-ffi:+sdl-arrayorder-abgr+
  • Variable +PACKEDLAYOUT-NONE+
    sdl2-ffi:+sdl-packedlayout-none+
  • Variable +PACKEDLAYOUT-332+
    sdl2-ffi:+sdl-packedlayout-332+
  • Variable +PACKEDLAYOUT-4444+
    sdl2-ffi:+sdl-packedlayout-4444+
  • Variable +PACKEDLAYOUT-1555+
    sdl2-ffi:+sdl-packedlayout-1555+
  • Variable +PACKEDLAYOUT-5551+
    sdl2-ffi:+sdl-packedlayout-5551+
  • Variable +PACKEDLAYOUT-565+
    sdl2-ffi:+sdl-packedlayout-565+
  • Variable +PACKEDLAYOUT-8888+
    sdl2-ffi:+sdl-packedlayout-8888+
  • Variable +PACKEDLAYOUT-2101010+
    sdl2-ffi:+sdl-packedlayout-2101010+
  • Variable +PACKEDLAYOUT-1010102+
    sdl2-ffi:+sdl-packedlayout-1010102+
  • Condition SDL-CONTINUE  (CONDITION)
  • Macro IN-MAIN-THREAD ((&key background no-event) &body b)
  • Function MAKE-THIS-THREAD-MAIN (&optional function)
    Designate the current thread as the SDL2 main thread. This function will not return until `SDL2:QUIT` is handled. Users of this function will need to start other threads before this call, or specify `FUNCTION`. If `FUNCTION` is specified, it will be called when the main thread channel is ensured. This is like calling `IN-MAIN-THREAD`, except it allows for a potentially single-threaded application. This function does **not** return just because `FUNCTION` returns; it still requires `SDL2:QUIT` be processed. This does **not** call `SDL2:INIT` by itself. Do this either with `FUNCTION`, or from a separate thread.
  • Function INIT (&rest sdl-init-flags)
    Initialize SDL2 with the specified subsystems. Initializes everything by default.
  • Function WAS-INIT (&rest flags)
  • Function QUIT
    Shuts down SDL2.
  • Macro WITH-INIT ((&rest sdl-init-flags) &body body)
  • Function VERSION
  • Function VERSION-WRAPPED
  • Function MAKE-POINT (x y)
    Return an SDL_Point filled in with the arguments. It will be garbage collected as needed.
  • Function POINT-X (point)
  • Function (setf POINT-X) (v point)
  • Function POINT-Y (point)
  • Function (setf POINT-Y) (v point)
  • Function COPY-POINT (point)
    Allocate and return a new SDL_Point and make its slots be equal to the passed in SDL_Point.
  • Function COPY-INTO-POINT (dest-point src-point)
    Copy the information from the SDL_Point src-point into the SDL_Point dest-point. Return the dest-point.
  • Function FREE-POINT (point)
    Specifically free the SDL_Point structure which will do the right thing with respect to the garbage collector. This is not required, but may make garbage collection performance better if used in tight SDL_Point allocating loops.
  • Macro WITH-POINTS (bindings &body body)
    A LET-like convenient bindings facility for SDL_point structures. Raw symbols are bound to (make-point 0 0). Example: (let ((a 1) (b 2)) (with-points (foo (qux 5 10) (bar (1+ a) b) (list foo qux bar)))) -> (#<SDL-FFI:SDL-POINT x 0 y 0> #<SDL-FFI:SDL-POINT x 5 y 10> #<SDL-FFI:SDL-POINT x 2 y 2>)
  • Function POINTS* (&rest points)
    Return a pointer to SDL_Point and the number of elements in it.
  • Function MAKE-RECT (x y w h)
    Allocate and return a new SDL_Rect filled in with the arguments. It will be garbage collected as needed.
  • Function RECT-X (rect)
  • Function (setf RECT-X) (v rect)
  • Function RECT-Y (rect)
  • Function (setf RECT-Y) (v rect)
  • Function RECT-WIDTH (rect)
  • Function (setf RECT-WIDTH) (v rect)
  • Function RECT-HEIGHT (rect)
  • Function (setf RECT-HEIGHT) (v rect)
  • Function COPY-RECT (rect)
    Allocate and return a new SDL_Rect and make its slots be equal to the passed in SDL_Rect.
  • Function COPY-INTO-RECT (dest-rect src-rect)
    Copy the information from the SDL_Rect src-rect into the SDL_Rect dest-rect. Return the dest-rect.
  • Function FREE-RECT (rect)
    Specifically free the SDL_Rect structure which will do the right thing with respect to the garbage collector. This is not required, but may make garbage collection performance better if used in tight SDL_Rect allocating loops.
  • Macro WITH-RECTS (bindings &body body)
    A LET-like convenient bindings facility for SDL_Rect structures. Raw symbols are bound to (make-rect 0 0 0 0). Example: (let ((a 1) (b 2) (c 3) (d 4)) (with-rects (foo (qux 5 10 15 20) (bar (1+ a) b c (* d 10))) (list foo qux bar))) -> (#<SDL-FFI:SDL-RECT x 0 y 0 w 0 z 0> #<SDL-FFI:SDL-RECT x 5 y 10 w 15 h 20> #<SDL-FFI:SDL-RECT x 2 y 2 w 3 d 40>)
  • Function RECTS* (&rest rects)
    Return a pointer to SDL_Rect and the number of elements in it.
  • Function RECT-EMPTY (&rest rects)
    Return T if the rectangle has no width or height.
  • Function RECT-EQUALS (first-rect &rest rects)
    Return T if the passed in SDL_Rect structures are valid and all slots are equal to each other.
  • Function HAS-INTERSECT (first-rect &rest rects)
    Return T if every SDL_Rect structure intersects every other SDL_Rect structure.
  • Function INTERSECT-RECT (first-rect &rest rects)
    Return two values. The first one is T if the intersection of ALL rectangles results in a non-empty intersection. The second value is the SDL_Rect of the intersection rectangle. If an empty intersection is discovered, then NIL and an empty rectangle at the origin is returned. The second value is always a newly allocated SDL_Rect structure.
  • Function UNION-RECT (first-rect &rest rects)
    Calculate and return the union of all rectangles passed in. The result will be one large rectangle as a newly allocated SDL_rect in which all others fit perfectly.
  • Function GET-NUM-VIDEO-DRIVERS
  • Function GET-VIDEO-DRIVER (driver-index)
  • Function GET-CURRENT-VIDEO-DRIVER
  • Function GET-NUM-VIDEO-DISPLAYS
  • Function GET-DISPLAY-NAME (display-index)
  • Function GET-NUM-DISPLAY-MODES (display-index)
  • Function GET-CURRENT-DISPLAY-MODE (display-index)
  • Function GET-DISPLAY-MODE (display-index mode-index)
  • Function GET-DISPLAY-BOUNDS (display-index)
    Use this function to get the desktop area represented by a display, with the primary display located at 0,0.
  • Function WINDOWPOS-UNDEFINED (&optional (display 0))
  • Function WINDOWPOS-CENTERED (&optional (display 0))
  • Function WINDOWPOS-FROM-COORD (n)
  • Function CREATE-WINDOW (&key (title "sdl2 window") (x :centered) (y :centered) (w 800) (h 600) flags)
  • Function DESTROY-WINDOW (win)
  • Macro WITH-WINDOW ((win &key (title "sdl2 window") (x :centered) (y :centered) (w 800) (h 600) flags) &body body)
  • Macro WITH-EVERYTHING ((&key window gl) &body body)
  • Function HIDE-WINDOW (win)
  • Function SHOW-WINDOW (win)
  • Function MAXIMIZE-WINDOW (win)
  • Function MINIMIZE-WINDOW (win)
  • Function RAISE-WINDOW (win)
  • Function RESTORE-WINDOW (win)
  • Function UPDATE-WINDOW (win)
  • Function SET-WINDOW-TITLE (win title)
  • Function SET-WINDOW-FULLSCREEN (win fullscreen-value)
    `FULLSCREEN-VALUE` of `t` or `:fullscreen` is "regular" fullscreen, `SDL_WINDOW_FULLSCREEN`. Specifying `:windowed` or `:desktop` is "windowed" fullscreen, using `SDL_WINDOW_FULLSCREEN_DESKTOP`.
  • Function SET-WINDOW-SIZE (win w h)
  • Function SET-WINDOW-POSITION (win x y)
  • Function GET-WINDOW-TITLE (win)
  • Function GET-WINDOW-POSITION (win)
  • Function GET-WINDOW-SIZE (win)
  • Function GET-WINDOW-ASPECT-RATIO (win)
  • Function GET-WINDOW-SURFACE (win)
  • Function GET-WINDOW-FLAGS (win)
  • Function GET-WINDOW-PIXEL-FORMAT (win)
    Use this function to get the pixel format associated with the window.
  • Function GET-WINDOW-ID (win)
  • Function ENABLE-SCREENSAVER
  • Function DISABLE-SCREENSAVER
  • Function SCREENSAVER-ENABLED-P
  • Function GL-CREATE-CONTEXT (win)
  • Function GL-DELETE-CONTEXT (gl-context)
  • Macro WITH-GL-CONTEXT ((gl-context-sym win) &body body)
  • Function GL-EXTENSION-SUPPORTED-P (extension)
  • Function GL-MAKE-CURRENT (win gl-context)
  • Function GL-GET-SWAP-INTERVAL
  • Function GL-SET-SWAP-INTERVAL (interval)
    0 for immediate updates, 1 for updates synchronized with the vertical retrace
  • Function GL-SWAP-WINDOW (win)
  • Function GL-GET-ATTR (attr)
  • Function GL-GET-ATTRS (&rest attrs)
  • Function GL-SET-ATTR (attr value)
  • Function GL-SET-ATTRS (&rest attr-plist)
  • Function GL-GET-PROC-ADDRESS (proc-name)
  • Function NEW-EVENT (&optional (event-type :firstevent))
  • Function FREE-EVENT (event)
  • Function REGISTER-USER-EVENT-TYPE (user-event-type)
    Register a new sdl event-type if it doesn't already exist
  • Macro WITH-SDL-EVENT ((event &optional (event-type :firstevent)) &body body)
    Allocate and automatically free an sdl event struct.
  • Function GET-EVENT-TYPE (event)
  • Function PUMP-EVENTS
  • Function PUSH-EVENT (event)
    Allocates a new sdl event struct of the specified type and pushes it into the queue.
  • Function PUSH-USER-EVENT (user-event &optional user-data)
    Allocates a new user-defined sdl event struct of the specified type and pushes it into the queue. Stores the optional user-data in sdl2::*user-events*
  • Function PUSH-QUIT-EVENT
  • Function NEXT-EVENT (event &optional (method :poll) timeout)
    Method can be either :poll, :wait. If :wait is used, `TIMEOUT` may be specified.
  • Macro WITH-EVENT-LOOP ((&key background (method :poll) (timeout nil) recursive) &body event-handlers)
  • Function KEY-DOWN-P (state)
  • Function KEY-UP-P (state)
  • Function SCANCODE-VALUE (keysym)
    Converts a keysym to the numerical value of its scancode.
  • Function SCANCODE (keysym)
    Converts a keysym to a scancode keyword.
  • Function SCANCODE-SYMBOL (scancode)
    Converts a scancode number to a scancode keyword.
  • Function SCANCODE-KEY-TO-VALUE (scancode-key)
    Converts a scancode keyword to its numerical value.
  • Function MOD-VALUE (keysym)
  • Function SYM-VALUE (keysym)
  • Generic-Function SCANCODE= (value scancode-key)
  • Method SCANCODE= ((scancode integer) scancode-key)
  • Method SCANCODE= ((keysym sdl-keysym) scancode-key)
  • Function MOD-KEYWORDS (value)
  • Function MOD-VALUE-P (value &rest keywords)
  • Function KEYBOARD-STATE-P (scancode)
    Whether the key corresponding to the given scancode is currently pressed.
  • Function GET-KEY-FROM-SCANCODE (scancode)
  • Function GET-KEY-NAME (key)
  • Function SCANCODE-NAME (scancode)
  • Function SCANCODE-KEY-NAME (scancode)
  • Function START-TEXT-INPUT
  • Function STOP-TEXT-INPUT
  • Macro WARP-MOUSE-IN-WINDOW (win x y)
    Use this function to move the mouse to the given position within the window.
  • Function HIDE-CURSOR
  • Function SHOW-CURSOR
  • Function SET-RELATIVE-MOUSE-MODE (enabled)
  • Function RELATIVE-MOUSE-MODE-P
  • Function TOGGLE-RELATIVE-MOUSE-MODE
  • Function MOUSE-STATE
    Returns (VALUES X Y BITMASK) where X, Y give the mouse cursor position relative to the focused window and BITMASK has bit i from the right set if and only if mouse button i is pressed.
  • Function MOUSE-STATE-P (button)
    Whether the mouse button numbered BUTTON is pressed inside the focused window. 1 indicates the left mouse button, 2 the middle mouse button and 3 the right mouse button.
  • Function GET-GLOBAL-MOUSE-STATE
    Returns (X Y BITMASK) where X and Y are positions of the mouse cursor relative to the desktop and BITMASK has bit i from the right set if and only if mouse button i is pressed.
  • Function GLOBAL-MOUSE-STATE-P (button)
    Whether the mouse button numbered BUTTON is pressed. 1 indicates the left mouse button, 2 the middle mouse button and 3 the right mouse button. This function works relative to desktop and can be used even when there is no SDL window open.
  • Macro JOYSTICK-UPDATE
    Use this function to update the current state of the open joysticks. This function is called automatically by the event loop if joystick events are enabled.
  • Function JOYSTICK-COUNT
  • Function JOYSTICK-OPEN (device-index)
  • Function JOYSTICK-CLOSE (joystick)
  • Function JOYSTICK-NAME-FOR-INDEX (device-index)
  • Function JOYSTICK-NAME (joystick)
  • Function JOYSTICK-HAT-COUNT (joystick)
  • Function JOYSTICK-AXIS-COUNT (joystick)
  • Function JOYSTICK-BALL-COUNT (joystick)
  • Function JOYSTICK-BUTTON-COUNT (joystick)
  • Function JOYSTICK-INSTANCE-ID (joystick)
  • Function GAME-CONTROLLER-P (device-index)
    Returns t if the device-index provided belongs to a joystick with a known gamecontroller mapping.
  • Function GAME-CONTROLLER-NAME-FOR-INDEX (device-index)
    Return the human readable name for the device-index provided.
  • Function GAME-CONTROLLER-OPEN (device-index)
  • Function GAME-CONTROLLER-CLOSE (gamecontroller)
  • Function GAME-CONTROLLER-ATTACHED-P (gamecontroller)
  • Function GAME-CONTROLLER-ADD-MAPPING (mapping-string)
    Use this function to add support for controllers that SDL is unaware of or to cause an existing controller to have a different binding.
  • Function GAME-CONTROLLER-GET-JOYSTICK (gamecontroller)
  • Function GAME-CONTROLLER-INSTANCE-ID (c)
  • Function GAME-CONTROLLER-FROM-INSTANCE-ID (instance-id)
  • Function GAME-CONTROLLER-ADD-MAPPINGS-FROM-FILE (file-name)
  • Function GAME-CONTROLLER-NAME (gamecontroller)
  • Function JOYSTICK-IS-HAPTIC-P (joystick)
  • Function MOUSE-IS-HAPTIC-P
  • Function HAPTIC-OPEN (source)
    Use this function to open the N'th haptic device for use.
  • Function HAPTIC-OPEN-FROM-JOYSTICK (source)
    Use this function to open a joystick haptic device for use.
  • Function HAPTIC-OPEN-FROM-MOUSE
    Use this function to open the mouses haptic device for use.
  • Function HAPTIC-CLOSE (haptic)
    Use this function to close an opened haptic device.
  • Function HAPTIC-INDEX (haptic)
  • Function HAPTIC-OPENED-P (haptic)
  • Function RUMBLE-SUPPORTED-P (haptic)
    Use this function to test whether rumble is supported on a haptic device.
  • Function RUMBLE-INIT (haptic)
    Use this function to initialize a haptic device for simple rumble.
  • Function RUMBLE-PLAY (haptic strength duration)
    Use this function to play a simple rumble effect on a haptic device.
  • Function RUMBLE-STOP (haptic)
    Use this function to stop the rumble on a haptic device.
  • Macro DELAY (ms)
    This function waits a specified number of milliseconds before returning. It waits at least the specified time, but possibly longer due to OS scheduling
  • Macro GET-TICKS
    Returns an unsigned 32-bit value representing the number of milliseconds since the SDL library initialized.
  • Macro GET-PERFORMANCE-COUNTER
    This function is typically used for profiling. The counter values are only meaningful relative to each other. Differences between values can be converted to times by using 'get-performance-frequency'.
  • Macro GET-PERFORMANCE-FREQUENCY
    Returns a platform-specific count per second.
  • Function ADD-TIMER (interval fn args)
    Use this function to set up a callback function to be run on a separate thread after the specified number of milliseconds has elapsed. The callback function is passed the current timer interval and the user supplied parameter from the 'add-timer' call and returns the next timer interval. If the returned value from the callback is 0, the timer is canceled.
  • Function REMOVE-TIMER (timer)
    Use this function to remove a timer created with 'add-timer'.
  • Function PLATFORM
    Returns the name of the platform. If the correct platform name is not available, returns a string beginning with the text "Unknown"
  • Macro CPU-CACHE-LINE-SIZE
    Returns the L1 cache line size of the CPU. This is useful for determining multi-threaded structure padding or SIMD prefetch sizes.
  • Macro CPU-COUNT
    Returns the total number of logical CPU cores. On CPUs that include technologies such as hyperthreading, the number of logical cores may be more than the number of physical cores.
  • Macro MMX-P
    Returns t if CPU has MMX features, nil if not.
  • Macro ALTI-VEC-P
    Returns t if CPU has MMX features, nil if not.
  • Macro RDTSC-P
    Returns t if CPU has the RDTSC instruction, nil if not.
  • Macro SSE-P
    Returns t if CPU has SSE features, nil if not.
  • Macro SSE2-P
    Returns t if CPU has SSE 2 features, nil if not.
  • Macro SSE3-P
    Returns t if CPU has SSE 3 features, nil if not.
  • Macro SSE41-P
    Returns t if CPU has SSE 4.1 features, nil if not.
  • Macro SSE42-P
    Returns t if CPU has SSE 4.2 features, nil if not.
  • Function POWER-INFO
    Use this function to get the current power supply details. Returns the current power state, seconds remaining, and percent remaining. - Power state will be one of: :unknown, :on-battery, :no-battery, :charging, :charged - Seconds will be -1 if a value can't be determined or you're not running on battery. - Percent remaining will be a value between 0 and 100, or -1 if a value can't be determined or you're not running on battery. You should never take a battery status as absolute truth. Batteries (especially failing batteries) are delicate hardware, and the values reported here are best estimates based on what that hardware reports. It's not uncommon for older batteries to lose stored power much faster than it reports, or completely drain when reporting it has 20 percent left, etc. Battery status can change at any time; if you are concerned with power state, you should call this function frequently, and perhaps ignore changes until they seem to be stable for a few seconds.
  • Function MAP-RGB (pixel-format r g b)
  • Function GET-PIXEL-FORMAT-NAME (format-integer)
    Returns the human readable name for a surface's pixel format, useful for debugging.
  • Function SURFACE-WIDTH (surface)
  • Function SURFACE-HEIGHT (surface)
  • Function SURFACE-PIXELS (surface)
    Access raw pixel data from a surface object
  • Function SURFACE-FORMAT (surface)
  • Function SURFACE-PITCH (surface)
  • Function SURFACE-FORMAT-FORMAT (surface)
  • Function CREATE-RGB-SURFACE (width height depth &key (r-mask 0) (g-mask 0) (b-mask 0) (a-mask 0) (flags 0))
  • Function CREATE-RGB-SURFACE-FROM (pixels width height depth pitch &key (r-mask 0) (g-mask 0) (b-mask 0) (a-mask 0))
  • Function CREATE-RGB-SURFACE-WITH-FORMAT-FROM (pixels width height depth pitch &key (format +pixelformat-rgba8888+))
  • Function FREE-SURFACE (surface)
  • Function LOAD-BMP (filename)
  • Function CONVERT-SURFACE (surface format &key (flags 0))
  • Function CONVERT-SURFACE-FORMAT (surface pixel-format-enum &key (flags 0))
  • Function BLIT-SURFACE (surface-src src-rect surface-dst dst-rect)
  • Function BLIT-SCALED (surface-src src-rect surface-dst dst-rect)
  • Function FILL-RECT (surface-dst rect color)
  • Function SET-COLOR-KEY (surface flag key)
    Use this function to set the color key (transparent pixel) in a surface.
  • Function GET-COLOR-KEY (surface)
    Use this function to get the color key (transparent pixel) for a surface.
  • Function SET-ALPHA-MOD (surface alpha)
    Use this function to set an additional alpha value used in blit operations.
  • Function GET-ALPHA-MOD (surface)
    Use this function to get the additional alpha value used in blit operations.
  • Function SET-COLOR-MOD (surface r g b)
    Use this function to set an additional color value multiplied into blit operations.
  • Function GET-COLOR-MOD (surface)
    Use this function to get the additional color value multiplied into blit operations.
  • Function RW-CLOSE (sdl-rwops-struct)
    Flush the file represented by the sdl-rwops object and free the memory associated with it. Returns 0 if the file is successfully flushed and -1 otherwise. Even if the file fails to flush the memory is freed and pointer is invalid
  • Function RW-FROM-FILE (file-name mode)
    Create an RWops structure from a given file name in a given mode.
  • Function GET-NUM-RENDER-DRIVERS
    Return the number of 2D rendering drivers available for the current display.
  • Function GET-RENDER-DRIVER-INFO (index)
    Allocate and return a new SDL_RendererInfo structure and fill it with information relating to the specific 2D rendering driver specified in the index.
  • Function CREATE-WINDOW-AND-RENDERER (width height flags)
  • Function CREATE-RENDERER (window &optional index flags)
    Create a 2D rendering context for a window.
  • Function CREATE-SOFTWARE-RENDERER (surface)
    Create and return a 2D software rendering context for the surface.
  • Function DESTROY-RENDERER (r)
  • Macro WITH-RENDERER ((renderer-sym window &key index flags) &body body)
  • Function GET-RENDERER (window)
    Return NIL if there is no renderer associated with the window, or otherwise the SDL_Renderer structure.
  • Function RENDER-COPY (renderer texture &key source-rect dest-rect)
    Use this function to copy a portion of the texture to the current rendering target.
  • Function RENDER-COPY-EX (renderer texture &key source-rect dest-rect angle center flip)
    Use this function to copy a portion of the texture to the current rendering target, optionally rotating it by angle around the given center and also flipping it top-bottom and/or left-right.
  • Function SET-RENDER-DRAW-COLOR (renderer r g b a)
    Use this function to set the color used for drawing operations (Rect, Line and Clear).
  • Function GET-RENDER-DRAW-COLOR (renderer)
    Use this function to get the current color used by renderer for drawing operations
  • Function SET-TEXTURE-BLEND-MODE (texture blend-mode)
    Use this function to set the blend mode for a texture, used by SDL_RenderCopy().
  • Function SET-RENDER-DRAW-BLEND-MODE (renderer blend-mode)
    Use this function to set the blend mode used for drawing operations (Fill and Line).
  • Function SET-RENDER-TARGET (renderer texture)
    Use this function to set a texture as the current rendering target.
  • Function RENDER-DRAW-LINE (renderer x1 y1 x2 y2)
    Use this function to draw a line on the current rendering target.
  • Function RENDER-DRAW-LINES (renderer points num-points)
    Pass a pointer to SDL_Point to render connected lines on the current rendering target.
  • Function RENDER-DRAW-POINT (renderer x y)
    Use this function to draw a point on the current rendering target.
  • Function RENDER-DRAW-POINTS (renderer points num-points)
    Use this function to draw multiple points on the current rendering target.
  • Function RENDER-DRAW-RECT (renderer sdl-rect)
    Use this function to draw a rectangle on the current rendering target.
  • Function RENDER-DRAW-RECTS (renderer rects num-rects)
    Use this function to draw some number of rectangles on the current rendering target.
  • Function RENDER-FILL-RECT (renderer sdl-rect)
    Use this function to fill a rectangle on the current rendering target with the drawing color.
  • Function RENDER-FILL-RECTS (renderer rects num-rects)
    Use this function to fill some number of rectangles on the current rendering target with the drawing color.
  • Function RENDER-SET-VIEWPORT (renderer sdl-rect)
    Use this function to set the drawing area for rendering on the current target.
  • Function RENDER-GET-VIEWPORT (renderer)
    Use this function to get the drawing area for the current target.
  • Function RENDER-CLEAR (renderer)
    Use this function to clear the current rendering target with the drawing color.
  • Function RENDER-PRESENT (renderer)
    Use this function to update the screen with rendering performed.
  • Function GET-RENDERER-INFO (renderer)
    Allocate a new SDL_RendererInfo structure, fill it in with information about the specified renderer, and return it.
  • Function GET-RENDERER-OUTPUT-SIZE (renderer)
  • Function QUERY-TEXTURE (texture)
  • Function TEXTURE-WIDTH (texture)
  • Function TEXTURE-HEIGHT (texture)
  • Function UPDATE-TEXTURE (texture rect pixels pitch)
    Use this function to update the given texture rectangle with new pixel data.
  • Function CREATE-TEXTURE (renderer pixel-format access width height)
    Use this function to create a texture for a rendering context.
  • Function CREATE-TEXTURE-FROM-SURFACE (renderer surface)
    Use this function to create a texture from sdl2 surface for a rendering context.
  • Function SET-TEXTURE-COLOR-MOD (texture r g b)
    Use this function to set an additional color value multiplied into render copy operations.
  • Function GET-TEXTURE-COLOR-MOD (texture)
    Use this function to get the additional color value multiplied into render copy operations.
  • Function SET-TEXTURE-ALPHA-MOD (texture alpha)
    Use this function to set an additional alpha value multiplied into render copy operations.
  • Function GET-TEXTURE-ALPHA-MOD (texture)
    Use this function to get the additional alpha value multiplied into render copy operations.
  • Function DESTROY-TEXTURE (texture)
    Use this function to destroy the specified texture.
  • Function LOCK-TEXTURE (texture &optional rect)
    Use this function to lock a portion of the texture for write-only pixel access.
  • Function UNLOCK-TEXTURE (texture)
    Use this function to unlock a texture, uploading the changes to video memory, if needed. Warning: See Bug No. 1586 before using this function!
  • Function GL-BIND-TEXTURE (texture)
  • Function GL-UNBIND-TEXTURE (texture)

Also exports

  • SDL2-FFI.FUNCTIONS:SDL-QUIT

SDL2-EXAMPLES

No exported symbols.