Guile-SDL2

Guile-SDL2 provides Guile Scheme bindings for the SDL2 C shared library. The bindings are written in pure Scheme using Guile's foreign function interface.

Usage

Guile-SDL2 provides modules in the (sdl2 ...) namespace, roughly organized how the SDL2 C header files are organized. Low-level bindings are available in the(sdl2 bindings ...) namespace, but these are not recommended for normal usage.

Additionally, SDL2 extension library bindings are available in the following modules:

Here is a short “hello, world” example program:

(use-modules (sdl2)
             (sdl2 render)
             (sdl2 surface)
             (sdl2 video))

(define (draw ren)
  (let* ((surface (load-bmp "hello.bmp"))
         (texture (surface->texture ren surface)))
    (clear-renderer ren)
    (render-copy ren texture)
    (present-renderer ren)
    (sleep 2)))

(sdl-init)

(call-with-window (make-window)
  (lambda (window)
    (call-with-renderer (make-renderer window) draw)))

(sdl-quit)

Releases

Requirements

Installation

Guile-SDL2 uses the standard GNU build system. To build and install Guile-SDL2 from source, run:

./configure
make
make install

License

GNU LGPLv3+

Source Code

Guile-SDL2 is developed using the Git version control system. The official repository is hosted at https://git.dthompson.us/guile-sdl2.git

Anonymous clone

git clone https://git.dthompson.us/guile-sdl2.git

Community

Real-time discussion for Guile-SDL2 can be found on the #guile channel on the Freenode IRC network.

Contributing

Send patches and bug reports to davet@gnu.org.