/chez-sdl

SDL 2 interface for chez-scheme.

Primary LanguageSchemeMIT LicenseMIT

Chez-SDL

This is an interface to SDL 2 for the Chez Scheme system. (in development)

(import (sdl))

(sdl-init SDL-INIT-VIDEO)

(define win
  (sdl-create-window "chezscheme"
                     SDL-WINDOWPOS-UNDEFINED
                     SDL-WINDOWPOS-UNDEFINED
                     640
		     480))

(define (event-loop)
  (sdl-poll-event)
  (cond
    ((sdl-event-none?) (event-loop))
    ((sdl-event-quit?) '())
    (else
      (event-loop))))

(event-loop)

(sdl-destroy-window win)
(sdl-quit)

Features

  • Scheme style interface to SDL 2
  • Minimal overhead wrapping
  • Full marshalling of Scheme data to C data
  • Lower level ftype interface provided
  • Developer friendly documentation

Quickstart Guide

  1. Install the Chez Scheme system and the SDL2 development library.

  2. Install Chez-SDL where the Chez Scheme system can find it.

export CHEZSCHEMELIBDIRS="/path/to/chez-sdl/lib:$CHEZSCHEMELIBDIRS"
  1. Start running the demos.
scheme --script ./events.ss
  1. Read the documentation.