The cl-sdl2 Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-sdl2 Reference Manual

This is the cl-sdl2 Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 03:32:19 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

cl-sdl2

cl-sdl2 is a Common Lisp wrapper for the SDL 2.0 C Library, with many contributors, maintained primarily by the following:

It is licensed under the MIT license.

Installation

sdl2 is in Quicklisp, see below for instructions.

SDL 2.0 C Library Install

See https://wiki.libsdl.org/Installation

On Linux, you can probably find SDL2 in your distribution's package set. For other platforms, or for building manually, download the source.

Package

sudo apt-get install libsdl2-2.0
sudo pacman -S sdl2

Compilation

If you need to compile from source for your Linux platform:

  1. Download source code
  2. Compile
  3. Install

For example:

cd /tmp
wget https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
tar -xzvf SDL2-2.?.?.tar.gz
cd SDL2-2.?.?
./configure
make
sudo make install

This will install the SDL-2.0.x C Library into your /usr/local location.

It's generally a good idea to install at a minimum the version of SDL2 that was wrapped; however, sub revisions should not introduce binary incompatibility and should be fine. If you install a different version, certain features may not be available or may not work correctly.

Quicklisp Install

sdl2 is best installed via QuickLisp, though for cutting-edge changes, you may want to install from github as below.

If you don't have Quicklisp, then follow the directions to install it. We assume you placed the Quicklisp repository in the default place as indicated by the directions and have added it to your lisp init file.

github install

cd $HOME/quicklisp/local-projects
git clone https://github.com/rpav/cl-autowrap.git
git clone https://github.com/lispgames/cl-sdl2.git

Then, use quicklisp to install the libraries required by cl-sdl2:

Start your lisp. Then, just:

(ql:quickload "sdl2")

Swank/Slynk features

sdl2 enables certain restarts for friendly interaction with SLIME or Sly if you have either properly installed. "Proper installation" in this case means swank.asd or slynk.asd is linked such that ASDF can find and load it.

Note this is easily achieved even if you have installed them from github or some other non-Quicklisp repository:

Similarly you could just clone into ~/quicklisp/local-projects as well; this should work on Windows as well. There are numerous other options for configuring and managing ASDs, as well.

Running the sdl2 examples

Start your lisp:

(ql:quickload :sdl2/examples)
(sdl2-examples:basic-test)

This example will open a window with an opengl primitive in it. Any mouse movements or keystrokes are recorded in the terminal (or emacs SLIME output buffer *inferior-lisp*). Hitting the ESCAPE key will terminate the example.

OSX

Newer versions of OSX have had some difficulties as calls which require nextEventMatchingMask must be called from the main thread of your program.

This is especially relevant to SBCL, although issues have also been noticed in CCL.

Currently, initialisation must take place on your main thread:

(ql:quickload :sdl2/examples)

;; We should be able to run examples as normal on CCL
#-sbcl (sdl2-examples:basic-test)

;; SBCL requires that we initialise in the main thread
#+sbcl (sdl2:make-this-thread-main #'sdl2-examples:basic-test)

Thank you for using sdl2!


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 sdl2

Author

Chip Collier <photex@lofidelitygames.com>

License

MIT

Description

Bindings for SDL2 using c2ffi.

Dependencies
Source

sdl2.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 sdl2/autowrap-spec

Parent

sdl2 (system)

Location

spec/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Next: , Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 sdl2.asd

Location

/home/quickbuilder/quicklisp/dists/quicklisp/software/cl-sdl2-20171130-git/sdl2.asd

Systems

sdl2 (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 sdl2/package.lisp

Dependency

autowrap-spec (module)

Parent

sdl2 (system)

Location

package.lisp

Packages

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.3 sdl2/optional-deps.lisp

Dependency

package.lisp (file)

Parent

sdl2 (system)

Location

optional-deps.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.4 sdl2/library.lisp

Dependency

optional-deps.lisp (file)

Parent

sdl2 (system)

Location

library.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.5 sdl2/autowrap.lisp

Dependency

library.lisp (file)

Parent

sdl2 (system)

Location

autowrap.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.6 sdl2/util.lisp

Dependency

autowrap.lisp (file)

Parent

sdl2 (system)

Location

util.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.7 sdl2/sdl2.lisp

Dependency

util.lisp (file)

Parent

sdl2 (system)

Location

sdl2.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.8 sdl2/rect.lisp

Dependency

sdl2.lisp (file)

Parent

sdl2 (system)

Location

rect.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.9 sdl2/video.lisp

Dependency

rect.lisp (file)

Parent

sdl2 (system)

Location

video.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.10 sdl2/events.lisp

Dependency

video.lisp (file)

Parent

sdl2 (system)

Location

events.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.11 sdl2/keyboard.lisp

Dependency

events.lisp (file)

Parent

sdl2 (system)

Location

keyboard.lisp

Exported Definitions
Internal Definitions

c-keysym (macro)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.12 sdl2/mouse.lisp

Dependency

keyboard.lisp (file)

Parent

sdl2 (system)

Location

mouse.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.13 sdl2/syswm.lisp

Dependency

mouse.lisp (file)

Parent

sdl2 (system)

Location

syswm.lisp

Exported Definitions

get-window-wm-info (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.14 sdl2/joystick.lisp

Dependency

syswm.lisp (file)

Parent

sdl2 (system)

Location

joystick.lisp

Exported Definitions
Internal Definitions

joystick-caps-query (macro)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.15 sdl2/gamecontroller.lisp

Dependency

joystick.lisp (file)

Parent

sdl2 (system)

Location

gamecontroller.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.16 sdl2/haptic.lisp

Dependency

gamecontroller.lisp (file)

Parent

sdl2 (system)

Location

haptic.lisp

Exported Definitions
Internal Definitions

%haptic-open (macro)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.17 sdl2/timer.lisp

Dependency

haptic.lisp (file)

Parent

sdl2 (system)

Location

timer.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.18 sdl2/audio.lisp

Dependency

timer.lisp (file)

Parent

sdl2 (system)

Location

audio.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.19 sdl2/platform.lisp

Dependency

audio.lisp (file)

Parent

sdl2 (system)

Location

platform.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.20 sdl2/pixels.lisp

Dependency

platform.lisp (file)

Parent

sdl2 (system)

Location

pixels.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.21 sdl2/surface.lisp

Dependency

pixels.lisp (file)

Parent

sdl2 (system)

Location

surface.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.22 sdl2/rwops.lisp

Dependency

surface.lisp (file)

Parent

sdl2 (system)

Location

rwops.lisp

Exported Definitions
Internal Definitions

%sdl-rw-close (function)


Previous: , Up: Lisp files   [Contents][Index]

4.1.23 sdl2/render.lisp

Dependencies
Parent

sdl2 (system)

Location

render.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Files   [Contents][Index]

4.2 Other


Next: , Previous: , Up: Other files   [Contents][Index]

4.2.1 sdl2/autowrap-spec/SDL2.h

Parent

autowrap-spec (module)

Location

spec/SDL2.h


Next: , Previous: , Up: Other files   [Contents][Index]

4.2.2 sdl2/autowrap-spec/SDL2.arm-pc-linux-gnu.spec

Parent

autowrap-spec (module)

Location

spec/SDL2.arm-pc-linux-gnu.spec


Next: , Previous: , Up: Other files   [Contents][Index]

4.2.3 sdl2/autowrap-spec/SDL2.i386-unknown-freebsd.spec

Parent

autowrap-spec (module)

Location

spec/SDL2.i386-unknown-freebsd.spec


Next: , Previous: , Up: Other files   [Contents][Index]

4.2.4 sdl2/autowrap-spec/SDL2.i386-unknown-openbsd.spec

Parent

autowrap-spec (module)

Location

spec/SDL2.i386-unknown-openbsd.spec


Next: , Previous: , Up: Other files   [Contents][Index]

4.2.5 sdl2/autowrap-spec/SDL2.i686-apple-darwin9.spec

Parent

autowrap-spec (module)

Location

spec/SDL2.i686-apple-darwin9.spec


Next: , Previous: , Up: Other files   [Contents][Index]

4.2.6 sdl2/autowrap-spec/SDL2.i686-pc-linux-gnu.spec

Parent

autowrap-spec (module)

Location

spec/SDL2.i686-pc-linux-gnu.spec


Next: , Previous: , Up: Other files   [Contents][Index]

4.2.7 sdl2/autowrap-spec/SDL2.i686-pc-windows-msvc.spec

Parent

autowrap-spec (module)

Location

spec/SDL2.i686-pc-windows-msvc.spec


Next: , Previous: , Up: Other files   [Contents][Index]

4.2.8 sdl2/autowrap-spec/SDL2.x86_64-apple-darwin9.spec

Parent

autowrap-spec (module)

Location

spec/SDL2.x86_64-apple-darwin9.spec


Next: , Previous: , Up: Other files   [Contents][Index]

4.2.9 sdl2/autowrap-spec/SDL2.x86_64-pc-linux-gnu.spec

Parent

autowrap-spec (module)

Location

spec/SDL2.x86_64-pc-linux-gnu.spec


Next: , Previous: , Up: Other files   [Contents][Index]

4.2.10 sdl2/autowrap-spec/SDL2.x86_64-pc-windows-msvc.spec

Parent

autowrap-spec (module)

Location

spec/SDL2.x86_64-pc-windows-msvc.spec


Next: , Previous: , Up: Other files   [Contents][Index]

4.2.11 sdl2/autowrap-spec/SDL2.x86_64-unknown-freebsd.spec

Parent

autowrap-spec (module)

Location

spec/SDL2.x86_64-unknown-freebsd.spec


Previous: , Up: Other files   [Contents][Index]

4.2.12 sdl2/autowrap-spec/SDL2.x86_64-unknown-openbsd.spec

Parent

autowrap-spec (module)

Location

spec/SDL2.x86_64-unknown-openbsd.spec


Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

5.1 sdl2-examples

Source

package.lisp (file)

Use List

Next: , Previous: , Up: Packages   [Contents][Index]

5.2 sdl2

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

5.3 sdl2-ffi.functions

Source

package.lisp (file)

Use List

common-lisp

Used By List

sdl2

Exported Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

5.4 sdl2-ffi.accessors

Source

package.lisp (file)

Use List

common-lisp

Used By List

sdl2


Previous: , Up: Packages   [Contents][Index]

5.5 sdl2-ffi

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions