You are looking at historical revision 32844 of this page. It may differ significantly from its current revision.

sdl2

Introduction

The sdl2 egg provides bindings to Simple DirectMedia Layer version 2 (SDL2). SDL is a popular library used in games and other media-rich software.

The sdl2 egg provides a programmer-friendly, convenient, and CHICKEN-idiomatic interface to SDL2. It takes care of the annoying low-level C stuff for you, so you can focus on making your game.

Project / Source Code Repository
https://gitlab.com/chicken-sdl2/chicken-sdl2
Issue Tracker
https://gitlab.com/chicken-sdl2/chicken-sdl2/issues
Maintainer
John Croisant (john+chicken at croisant dot net)
License
BSD 2-Clause

Help Wanted!

This egg needs volunteers to help with several things:

If you wish to help in any way, please contact the project maintainer.

Installation

When installing the egg, you should set the SDL2_FLAGS environment variable to a string of compiler flags to be used when compiling the egg. If you have the sdl2-config helper program installed on your system, you can set appropriate flags and install the extension like so (notice these are back ticks, not quotes):

SDL2_FLAGS=`sdl2-config --cflags --libs` chicken-install sdl2

If you do not have the sdl2-config helper program installed on your computer, you may manually specify SDL-related compiler flags (notice these are double quotes, not back ticks):

SDL2_FLAGS="-I/usr/local/include/SDL2 -L/usr/local/lib -lSDL2" chicken-install

The SDL2_FLAGS environment variable only needs to be set during installation of the egg, not during normal use.

Demos and Examples

After you have installed chicken-sdl2, you can try compiling and running chicken-sdl2 demos and examples.

The demos directory contains small programs demonstrating how to use various features of chicken-sdl2. E.g. to compile and run the basics demo:

csc demos/basics.scm
demos/basics

The chicken-sdl2-examples repository contains complete example games and programs made with chicken-sdl2.

The sdl2-image egg provides bindings to version 2 of the SDL_image library. It is built to be compatible with sdl2.

The sdl-base egg provides bindings to older versions of SDL. Its API is not compatible with sdl2.

Version History

sdl2 has not yet been released. Coming soon!

Reference Documentation

Struct Record Types

[procedure] (sdl-struct-null? record)

Returns #t if the given record instance, which can be an instance of any of the struct record types provided by this library, is wrapping a null pointer. Usually this indicates that the struct's memory has been manually freed. It is an error to get or set any field of a record that is wrapping a null pointer. So, you can use this procedure to test whether it is safe to use the object.

sdl-audio-cvt

sdl-audio-cvt is a record type that wraps a pointer to a SDL_AudioCVT struct.

[procedure] (sdl-audio-cvt? x) → boolean

Returns #t if x is a sdl-audio-cvt instance.

[procedure] (sdl-audio-cvt-needed audio-cvt) → fixnum
[procedure] (sdl-audio-cvt-src-format audio-cvt) → symbol
[procedure] (sdl-audio-cvt-src-format-raw audio-cvt) → fixnum
[procedure] (sdl-audio-cvt-dst-format audio-cvt) → symbol
[procedure] (sdl-audio-cvt-dst-format-raw audio-cvt) → fixnum
[procedure] (sdl-audio-cvt-rate-incr audio-cvt) → double
[procedure] (sdl-audio-cvt-buf audio-cvt) → pointer
[procedure] (sdl-audio-cvt-len audio-cvt) → fixnum
[procedure] (sdl-audio-cvt-len-cvt audio-cvt) → fixnum
[procedure] (sdl-audio-cvt-len-mult audio-cvt) → fixnum
[procedure] (sdl-audio-cvt-len-ratio audio-cvt) → double

sdl-audio-spec

sdl-audio-spec is a record type that wraps a pointer to a SDL_AudioSpec struct.

[procedure] (sdl-audio-spec? x) → boolean

Returns #t if x is a sdl-audio-spec instance.

[procedure] (sdl-audio-spec-freq audio-spec)
[setter] (set! (sdl-audio-spec-freq audio-spec) val)
[setter] (sdl-audio-spec-freq-set! audio-spec freq)
[procedure] (sdl-audio-spec-format audio-spec) → symbol
[setter] (set! (sdl-audio-spec-format audio-spec) val)
[setter] (sdl-audio-spec-format-set! audio-spec format)
[procedure] (sdl-audio-spec-format-raw audio-spec) → fixnum
[setter] (set! (sdl-audio-spec-format-raw audio-spec) val)
[procedure] (sdl-audio-spec-channels audio-spec) → fixnum
[setter] (set! (sdl-audio-spec-channels audio-spec) val)
[setter] (sdl-audio-spec-channels-set! audio-spec channels)
[procedure] (sdl-audio-spec-silence audio-spec) → fixnum
[procedure] (sdl-audio-spec-samples audio-spec) → fixnum
[setter] (set! (sdl-audio-spec-samples audio-spec) val)
[setter] (sdl-audio-spec-samples-set! audio-spec samples)
[procedure] (sdl-audio-spec-size audio-spec) → fixnum
[procedure] (sdl-audio-spec-userdata audio-spec) → pointer
[setter] (set! (sdl-audio-spec-userdata audio-spec) val)
[setter] (sdl-audio-spec-userdata-set! audio-spec userdata)

sdl-color

sdl-color is a record type that wraps a pointer to a SDL_Color struct.

Procedures related to sdl-color each have an alias spelled as "colour", for the convenience of anyone who spells it that way. Aside from the name difference, the procedures behave exactly the same.

[procedure] (sdl-color? x) → boolean
[procedure] (sdl-colour? x) → boolean

Returns #t if x is a sdl-color instance.

[procedure] (sdl-make-color #!optional r g b a) → sdl-color
[procedure] (sdl-make-colour #!optional r g b a) → sdl-color

Allocate and initialize a new sdl-color instance. The instance will have a finalizer set so that the underlying struct's memory will automatically be freed when the record instance is garbage collected. It is not necessary to call sdl-free-color!, although it is safe to do so.

r g b and a are the red, green, blue, and alpha (opacity) components of the color. They must be integers in the range 0 to 255 (inclusive). r g and b default to 0. a defaults to 255 (full opacity).

[procedure] (sdl-alloc-color) → sdl-color
[procedure] (sdl-alloc-colour) → sdl-color

Allocate (but do not initialize) a new sdl-color instance. You probably want to use sdl-make-color instead.

The instance will have a finalizer set so that the underlying struct's memory will automatically be freed when the record instance is garbage collected. It is not necessary to call sdl-free-color!, although it is safe to do so.

[procedure] (sdl-alloc-color*) → sdl-color
[procedure] (sdl-alloc-colour*) → sdl-color

Allocate (but do not initialize) a new sdl-color instance. This is like sdl-alloc-color, except that the instance will not have a finalizer set, so the underlying struct's memory will not be automatically freed when the instance is garbage collected. You must manually call sdl-free-color! on the record instance when you are done with it; otherwise, your program will have a memory leak.

[procedure] (sdl-free-color! color)
[procedure] (sdl-free-colour! color)

Manually free the memory of the given sdl-color instance. The instance's pointer will be set to null (see sdl-struct-null?), so you cannot get or set any attribute of the instance after it has been freed. It is safe to free an instance that has a finalizer. It is safe to free an instance that has already been freed.

[procedure] (sdl-color-r color) → fixnum
[procedure] (sdl-colour-r color) → fixnum
[setter] (set! (sdl-color-r color) r)
[setter] (set! (sdl-colour-r color) r)
[setter] (sdl-color-r-set! color r)
[setter] (sdl-colour-r-set! color r)

Get or set the r (red) component of the sdl-color, as an integer in the range 0 to 255 (inclusive).

[procedure] (sdl-color-g color) → fixnum
[procedure] (sdl-colour-g color) → fixnum
[setter] (set! (sdl-color-g color) g)
[setter] (set! (sdl-colour-g color) g)
[setter] (sdl-color-g-set! color g)
[setter] (sdl-colour-g-set! color g)

Get or set the g (green) component of the sdl-color, as an integer in the range 0 to 255 (inclusive).

[procedure] (sdl-color-b color) → fixnum
[procedure] (sdl-colour-b color) → fixnum
[setter] (set! (sdl-color-b color) b)
[setter] (set! (sdl-colour-b color) b)
[setter] (sdl-color-b-set! color b)
[setter] (sdl-colour-b-set! color b)

Get or set the b (blue) component of the sdl-color, as an integer in the range 0 to 255 (inclusive).

[procedure] (sdl-color-a color) → fixnum
[procedure] (sdl-colour-a color) → fixnum
[setter] (set! (sdl-color-a color) a)
[setter] (set! (sdl-colour-a color) a)
[setter] (sdl-color-a-set! color a)
[setter] (sdl-colour-a-set! color a)

Get or set the a (alpha) component of the sdl-color, as an integer in the range 0 to 255 (inclusive).

[setter] (sdl-color-set! color #!optional r g b a) → color
[setter] (sdl-colour-set! color #!optional r g b a) → color

Set multiple components of the sdl-color. If any of the arguments are not #f, that component of the color will be set. Any arguments that are #f will cause no change to that component of the color. Returns color after it is modified.

[procedure] (sdl-color->list color) → list of fixnums
[procedure] (sdl-colour->list color) → list of fixnums

Returns a list (r g b a) containing all the components of the sdl-color.

sdl-cursor

sdl-cursor is a record type that wraps a pointer to a SDL_Cursor struct.

[procedure] (sdl-cursor? x) → boolean

Returns #t if x is a sdl-cursor instance.

sdl-display-mode

sdl-display-mode is a record type that wraps a pointer to a SDL_DisplayMode struct.

[procedure] (sdl-display-mode? x) → boolean

Returns #t if x is a sdl-display-mode instance.

[procedure] (sdl-alloc-display-mode) → sdl-display-mode

Allocate (but do not initialize) a new sdl-display-mode instance.

The instance will have a finalizer set so that the underlying struct's memory will automatically be freed when the record instance is garbage collected. It is not necessary to call sdl-free-display-mode!, although it is safe to do so.

[procedure] (sdl-alloc-display-mode*) → sdl-display-mode
[procedure] (sdl-free-display-mode! display-mode)
[procedure] (sdl-display-mode-format display-mode) → symbol
[setter] (set! (sdl-display-mode-format display-mode) val)
[setter] (sdl-display-mode-format-set! display-mode)
[procedure] (sdl-display-mode-format-raw display-mode) → fixnum
[setter] (set! (sdl-display-mode-format-raw display-mode) val)
[procedure] (sdl-display-mode-w display-mode) → fixnum
[setter] (set! (sdl-display-mode-w display-mode) val)
[setter] (sdl-display-mode-w-set! display-mode)
[procedure] (sdl-display-mode-h display-mode) → fixnum
[setter] (set! (sdl-display-mode-h display-mode) val)
[setter] (sdl-display-mode-h-set! display-mode)
[procedure] (sdl-display-mode-refresh-rate display-mode) → fixnum
[setter] (set! (sdl-display-mode-refresh-rate display-mode) val)
[setter] (sdl-display-mode-refresh-rate-set! display-mode)

sdl-event

sdl-event is a record type that wraps a pointer to a SDL_Event. There are many specific event structs, and the sdl-event record type wraps them all. However, there are variants depending on the event type. Some event types use the same variant as other event types.

Variant Struct Corresponding event types (as symbols)
sdl-controller-axis-event SDL_ControllerAxisEvent 'controller-axis-motion
sdl-controller-button-event SDL_ControllerButtonEvent 'controller-button-down 'controller-button-up
sdl-controller-device-event SDL_ControllerDeviceEvent 'controller-device-added 'controller-device-removed 'controller-device-remapped
sdl-dollar-gesture-event SDL_DollarGestureEvent 'dollar-gesture 'dollar-record
sdl-drop-event SDL_DropEvent 'drop-file
sdl-joy-axis-event SDL_JoyAxisEvent 'joy-axis-motion
sdl-joy-ball-event SDL_JoyBallEvent 'joy-ball-motion
sdl-joy-button-event SDL_JoyButtonEvent 'joy-button-down 'joy-button-up
sdl-joy-device-event SDL_JoyDeviceEvent 'joy-device-added 'joy-device-removed
sdl-joy-hat-event SDL_JoyHatEvent 'joy-hat-motion
sdl-keyboard-event SDL_KeyboardEvent 'key-down 'key-up
sdl-mouse-button-event SDL_MouseButtonEvent 'mouse-button-down 'mouse-button-up
sdl-mouse-motion-event SDL_MouseMotionEvent 'mouse-motion
sdl-mouse-wheel-event SDL_MouseWheelEvent 'mouse-wheel
sdl-multi-gesture-event SDL_MultiGestureEvent 'multi-gesture
sdl-quit-event SDL_QuitEvent 'quit
sdl-sys-wm-event SDL_SysWMEvent 'sys-wm
sdl-text-editing-event SDL_TextEditingEvent 'text-editing
sdl-text-input-event SDL_TextInputEvent 'text-input
sdl-touch-finger-event SDL_TouchFingerEvent 'finger-down 'finger-up 'finger-motion
sdl-user-event SDL_UserEvent 'user
sdl-window-event SDL_WindowEvent 'window
[procedure] (sdl-event? x) → boolean

Returns #t if x is a sdl-event instance (any type).

[procedure] (sdl-alloc-event)

Allocate (but do not initialize) a new sdl-event instance.

The instance will have a finalizer set so that the underlying struct's memory will automatically be freed when the record instance is garbage collected. It is not necessary to call sdl-free-event!, although it is safe to do so.

[procedure] (sdl-alloc-event*)
[procedure] (sdl-free-event! event)
[procedure] (sdl-event-type event) → symbol
[setter] (set! (sdl-event-type event) val)
[setter] (sdl-event-type-set! event)

Get or set the sdl-event's event type as a symbol (see the table above). You can use this procedure with any type of sdl-event.

[procedure] (sdl-event-type-raw event) → fixnum
[setter] (set! (sdl-event-type-raw event) val)
[setter] (sdl-event-type-raw-set! event)

Get or set the sdl-event's event type as a nonnegative integer. You can use this procedure with any type of sdl-event.

[procedure] (sdl-event-timestamp event) → fixnum
[setter] (set! (sdl-event-timestamp event) val)
[setter] (sdl-event-timestamp-set! event)

Get or set the event timestamp, as a nonnegative integer representing the time that the event occurred, in milliseconds since the SDL timer system was initialized. You can use this procedure with any type of sdl-event.

sdl-controller-axis-event

sdl-controller-axis-event is a kind of sdl-event that wraps a pointer to a SDL_ControllerAxisEvent.

[procedure] (sdl-controller-axis-event? x) → boolean
[procedure] (sdl-controller-axis-event-which event) → fixnum
[setter] (set! (sdl-controller-axis-event-which event) val)
[setter] (sdl-controller-axis-event-which-set! event)
[procedure] (sdl-controller-axis-event-axis event) → fixnum
[setter] (set! (sdl-controller-axis-event-axis event) val)
[setter] (sdl-controller-axis-event-axis-set! event)
[procedure] (sdl-controller-axis-event-value event) → fixnum
[setter] (set! (sdl-controller-axis-event-value event) val)
[setter] (sdl-controller-axis-event-value-set! event)
sdl-controller-button-event

sdl-controller-button-event is a kind of sdl-event that wraps a pointer to a SDL_ControllerButtonEvent.

[procedure] (sdl-controller-button-event? x) → boolean
[procedure] (sdl-controller-button-event-which event) → fixnum
[setter] (set! (sdl-controller-button-event-which event) val)
[setter] (sdl-controller-button-event-which-set! event)
[procedure] (sdl-controller-button-event-button event) → fixnum
[setter] (set! (sdl-controller-button-event-button event) val)
[setter] (sdl-controller-button-event-button-set! event)
[procedure] (sdl-controller-button-event-state event) → boolean
[setter] (set! (sdl-controller-button-event-state event) val)
[setter] (sdl-controller-button-event-state-set! event)
sdl-controller-device-event

sdl-controller-device-event is a kind of sdl-event that wraps a pointer to a SDL_ControllerDeviceEvent.

[procedure] (sdl-controller-device-event? x) → boolean
[procedure] (sdl-controller-device-event-which event) → fixnum
[setter] (set! (sdl-controller-device-event-which event) val)
[setter] (sdl-controller-device-event-which-set! event)
sdl-dollar-gesture-event

sdl-dollar-gesture-event is a kind of sdl-event that wraps a pointer to a SDL_DollarGestureEvent.

[procedure] (sdl-dollar-gesture-event? x) → boolean
[procedure] (sdl-dollar-gesture-event-touch-id event) → fixnum
[setter] (set! (sdl-dollar-gesture-event-touch-id event) val)
[setter] (sdl-dollar-gesture-event-touch-id-set! event)
[procedure] (sdl-dollar-gesture-event-gesture-id event) → fixnum
[setter] (set! (sdl-dollar-gesture-event-gesture-id event) val)
[setter] (sdl-dollar-gesture-event-gesture-id-set! event)
[procedure] (sdl-dollar-gesture-event-num-fingers event) → fixnum
[setter] (set! (sdl-dollar-gesture-event-num-fingers event) val)
[setter] (sdl-dollar-gesture-event-num-fingers-set! event)
[procedure] (sdl-dollar-gesture-event-error event) → float
[setter] (set! (sdl-dollar-gesture-event-error event) val)
[setter] (sdl-dollar-gesture-event-error-set! event)
[procedure] (sdl-dollar-gesture-event-x event) → float
[setter] (set! (sdl-dollar-gesture-event-x event) val)
[setter] (sdl-dollar-gesture-event-x-set! event)
[procedure] (sdl-dollar-gesture-event-y event) → float
[setter] (set! (sdl-dollar-gesture-event-y event) val)
[setter] (sdl-dollar-gesture-event-y-set! event)
sdl-drop-event

sdl-drop-event is a kind of sdl-event that wraps a pointer to a SDL_DropEvent.

[procedure] (sdl-drop-event? x) → boolean
[procedure] (sdl-drop-event-file event) → string
[setter] (set! (sdl-drop-event-file event) val)
[setter] (sdl-drop-event-file-set! event)
sdl-joy-axis-event

sdl-joy-axis-event is a kind of sdl-event that wraps a pointer to a SDL_JoyAxisEvent.

[procedure] (sdl-joy-axis-event? x) → boolean
[procedure] (sdl-joy-axis-event-which event) → fixnum
[setter] (set! (sdl-joy-axis-event-which event) val)
[setter] (sdl-joy-axis-event-which-set! event)
[procedure] (sdl-joy-axis-event-axis event) → fixnum
[setter] (set! (sdl-joy-axis-event-axis event) val)
[setter] (sdl-joy-axis-event-axis-set! event)
[procedure] (sdl-joy-axis-event-value event) → fixnum
[setter] (set! (sdl-joy-axis-event-value event) val)
[setter] (sdl-joy-axis-event-value-set! event)
sdl-joy-ball-event

sdl-joy-ball-event is a kind of sdl-event that wraps a pointer to a SDL_JoyBallEvent.

[procedure] (sdl-joy-ball-event? x) → boolean
[procedure] (sdl-joy-ball-event-which event) → fixnum
[setter] (set! (sdl-joy-ball-event-which event) val)
[setter] (sdl-joy-ball-event-which-set! event)
[procedure] (sdl-joy-ball-event-ball event) → fixnum
[setter] (set! (sdl-joy-ball-event-ball event) val)
[setter] (sdl-joy-ball-event-ball-set! event)
[procedure] (sdl-joy-ball-event-xrel event) → fixnum
[setter] (set! (sdl-joy-ball-event-xrel event) val)
[setter] (sdl-joy-ball-event-xrel-set! event)
[procedure] (sdl-joy-ball-event-yrel event) → fixnum
[setter] (set! (sdl-joy-ball-event-yrel event) val)
[setter] (sdl-joy-ball-event-yrel-set! event)
sdl-joy-button-event

sdl-joy-button-event is a kind of sdl-event that wraps a pointer to a SDL_JoyButtonEvent.

[procedure] (sdl-joy-button-event? x) → boolean
[procedure] (sdl-joy-button-event-which event) → fixnum
[setter] (set! (sdl-joy-button-event-which event) val)
[setter] (sdl-joy-button-event-which-set! event)
[procedure] (sdl-joy-button-event-button event) → fixnum
[setter] (set! (sdl-joy-button-event-button event) val)
[setter] (sdl-joy-button-event-button-set! event)
[procedure] (sdl-joy-button-event-state event) → boolean
[setter] (set! (sdl-joy-button-event-state event) val)
[setter] (sdl-joy-button-event-state-set! event)
sdl-joy-device-event

sdl-joy-device-event is a kind of sdl-event that wraps a pointer to a SDL_JoyDeviceEvent.

[procedure] (sdl-joy-device-event? x) → boolean
[procedure] (sdl-joy-device-event-which event) → fixnum
[setter] (set! (sdl-joy-device-event-which event) val)
[setter] (sdl-joy-device-event-which-set! event)
sdl-joy-hat-event

sdl-joy-hat-event is a kind of sdl-event that wraps a pointer to a SDL_JoyHatEvent.

[procedure] (sdl-joy-hat-event? x) → boolean
[procedure] (sdl-joy-hat-event-which event) → fixnum
[setter] (set! (sdl-joy-hat-event-which event) val)
[setter] (sdl-joy-hat-event-which-set! event)
[procedure] (sdl-joy-hat-event-hat event) → fixnum
[setter] (set! (sdl-joy-hat-event-hat event) val)
[setter] (sdl-joy-hat-event-hat-set! event)
[procedure] (sdl-joy-hat-event-value event) → symbol
[setter] (set! (sdl-joy-hat-event-value event) val)
[setter] (sdl-joy-hat-event-value-set! event)
[procedure] (sdl-joy-hat-event-value-raw event) → fixnum
[setter] (set! (sdl-joy-hat-event-value-raw event) val)
[setter] (sdl-joy-hat-event-value-raw-set! event)
sdl-keyboard-event

sdl-keyboard-event is a kind of sdl-event that wraps a pointer to a SDL_KeyboardEvent.

[procedure] (sdl-keyboard-event? x) → boolean
[procedure] (sdl-keyboard-event-window-id event) → fixnum
[setter] (set! (sdl-keyboard-event-window-id event) val)
[setter] (sdl-keyboard-event-window-id-set! event)
[procedure] (sdl-keyboard-event-state event) → boolean
[setter] (set! (sdl-keyboard-event-state event) val)
[setter] (sdl-keyboard-event-state-set! event)
[procedure] (sdl-keyboard-event-repeat event) → fixnum
[setter] (set! (sdl-keyboard-event-repeat event) val)
[setter] (sdl-keyboard-event-repeat-set! event)
[procedure] (sdl-keyboard-event-keysym event) → sdl-keysym
[setter] (set! (sdl-keyboard-event-keysym event) val)
[setter] (sdl-keyboard-event-keysym-set! event)
[procedure] (sdl-keyboard-event-sym event) → symbol
[setter] (set! (sdl-keyboard-event-sym event) val)
[setter] (sdl-keyboard-event-sym-set! event)
[procedure] (sdl-keyboard-event-sym-raw event) → fixnum
[setter] (set! (sdl-keyboard-event-sym-raw event) val)
[setter] (sdl-keyboard-event-sym-raw-set! event)
[procedure] (sdl-keyboard-event-scancode event) → symbol
[setter] (set! (sdl-keyboard-event-scancode event) val)
[setter] (sdl-keyboard-event-scancode-set! event)
[procedure] (sdl-keyboard-event-scancode-raw event) → fixnum
[setter] (set! (sdl-keyboard-event-scancode-raw event) val)
[setter] (sdl-keyboard-event-scancode-raw-set! event)
[procedure] (sdl-keyboard-event-mod event) → list of symbols
[setter] (set! (sdl-keyboard-event-mod event) val)
[setter] (sdl-keyboard-event-mod-set! event)
[procedure] (sdl-keyboard-event-mod-raw event) → fixnum
[setter] (set! (sdl-keyboard-event-mod-raw event) val)
[setter] (sdl-keyboard-event-mod-raw-set! event)
sdl-mouse-button-event

sdl-mouse-button-event is a kind of sdl-event that wraps a pointer to a SDL_MouseButtonEvent.

[procedure] (sdl-mouse-button-event? x) → boolean
[procedure] (sdl-mouse-button-event-window-id event) → fixnum
[setter] (set! (sdl-mouse-button-event-window-id event) val)
[setter] (sdl-mouse-button-event-window-id-set! event)
[procedure] (sdl-mouse-button-event-which event) → fixnum
[setter] (set! (sdl-mouse-button-event-which event) val)
[setter] (sdl-mouse-button-event-which-set! event)
[procedure] (sdl-mouse-button-event-button-raw event) → fixnum
[setter] (set! (sdl-mouse-button-event-button-raw event) val)
[setter] (sdl-mouse-button-event-button-raw-set! event)
[procedure] (sdl-mouse-button-event-button event) → symbol
[setter] (set! (sdl-mouse-button-event-button event) val)
[setter] (sdl-mouse-button-event-button-set! event)
[procedure] (sdl-mouse-button-event-state event) → boolean
[setter] (set! (sdl-mouse-button-event-state event) val)
[setter] (sdl-mouse-button-event-state-set! event)
[procedure] (sdl-mouse-button-event-x event) → fixnum
[setter] (set! (sdl-mouse-button-event-x event) val)
[setter] (sdl-mouse-button-event-x-set! event)
[procedure] (sdl-mouse-button-event-y event) → fixnum
[setter] (set! (sdl-mouse-button-event-y event) val)
[setter] (sdl-mouse-button-event-y-set! event)
sdl-mouse-motion-event

sdl-mouse-motion-event is a kind of sdl-event that wraps a pointer to a SDL_MouseMotionEvent.

[procedure] (sdl-mouse-motion-event? x) → boolean
[procedure] (sdl-mouse-motion-event-window-id event) → fixnum
[setter] (set! (sdl-mouse-motion-event-window-id event) val)
[setter] (sdl-mouse-motion-event-window-id-set! event)
[procedure] (sdl-mouse-motion-event-which event) → fixnum
[setter] (set! (sdl-mouse-motion-event-which event) val)
[setter] (sdl-mouse-motion-event-which-set! event)
[procedure] (sdl-mouse-motion-event-state-raw event) → fixnum
[setter] (set! (sdl-mouse-motion-event-state-raw event) val)
[setter] (sdl-mouse-motion-event-state-raw-set! event)
[procedure] (sdl-mouse-motion-event-state event) → list of symbols
[setter] (set! (sdl-mouse-motion-event-state event) val)
[setter] (sdl-mouse-motion-event-state-set! event)
[procedure] (sdl-mouse-motion-event-x event) → fixnum
[setter] (set! (sdl-mouse-motion-event-x event) val)
[setter] (sdl-mouse-motion-event-x-set! event)
[procedure] (sdl-mouse-motion-event-y event) → fixnum
[setter] (set! (sdl-mouse-motion-event-y event) val)
[setter] (sdl-mouse-motion-event-y-set! event)
[procedure] (sdl-mouse-motion-event-xrel event) → fixnum
[setter] (set! (sdl-mouse-motion-event-xrel event) val)
[setter] (sdl-mouse-motion-event-xrel-set! event)
[procedure] (sdl-mouse-motion-event-yrel event) → fixnum
[setter] (set! (sdl-mouse-motion-event-yrel event) val)
[setter] (sdl-mouse-motion-event-yrel-set! event)
sdl-mouse-wheel-event

sdl-mouse-wheel-event is a kind of sdl-event that wraps a pointer to a SDL_MouseWheelEvent.

[procedure] (sdl-mouse-wheel-event? x) → boolean
[procedure] (sdl-mouse-wheel-event-window-id event) → fixnum
[setter] (set! (sdl-mouse-wheel-event-window-id event) val)
[setter] (sdl-mouse-wheel-event-window-id-set! event)
[procedure] (sdl-mouse-wheel-event-which event) → fixnum
[setter] (set! (sdl-mouse-wheel-event-which event) val)
[setter] (sdl-mouse-wheel-event-which-set! event)
[procedure] (sdl-mouse-wheel-event-x event) → fixnum
[setter] (set! (sdl-mouse-wheel-event-x event) val)
[setter] (sdl-mouse-wheel-event-x-set! event)
[procedure] (sdl-mouse-wheel-event-y event) → fixnum
[setter] (set! (sdl-mouse-wheel-event-y event) val)
[setter] (sdl-mouse-wheel-event-y-set! event)
sdl-multi-gesture-event

sdl-multi-gesture-event is a kind of sdl-event that wraps a pointer to a SDL_MultiGestureEvent.

[procedure] (sdl-multi-gesture-event? x) → boolean
[procedure] (sdl-multi-gesture-event-touch-id event) → fixnum
[setter] (set! (sdl-multi-gesture-event-touch-id event) val)
[setter] (sdl-multi-gesture-event-touch-id-set! event)
[procedure] (sdl-multi-gesture-event-dtheta event) → float
[setter] (set! (sdl-multi-gesture-event-dtheta event) val)
[setter] (sdl-multi-gesture-event-dtheta-set! event)
[procedure] (sdl-multi-gesture-event-ddist event) → float
[setter] (set! (sdl-multi-gesture-event-ddist event) val)
[setter] (sdl-multi-gesture-event-ddist-set! event)
[procedure] (sdl-multi-gesture-event-x event) → float
[setter] (set! (sdl-multi-gesture-event-x event) val)
[setter] (sdl-multi-gesture-event-x-set! event)
[procedure] (sdl-multi-gesture-event-y event) → float
[setter] (set! (sdl-multi-gesture-event-y event) val)
[setter] (sdl-multi-gesture-event-y-set! event)
[procedure] (sdl-multi-gesture-event-num-fingers event) → fixnum
[setter] (set! (sdl-multi-gesture-event-num-fingers event) val)
[setter] (sdl-multi-gesture-event-num-fingers-set! event)
sdl-quit-event

sdl-quit-event is a kind of sdl-event that wraps a pointer to a SDL_QuitEvent.

[procedure] (sdl-quit-event? x) → boolean
sdl-sys-wm-event

sdl-sys-wm-event is a kind of sdl-event that wraps a pointer to a SDL_SysWMEvent.

[procedure] (sdl-sys-wm-event? x) → boolean
[procedure] (sdl-sys-wm-event-msg event) → sdl-sys-wm-msg
[setter] (set! (sdl-sys-wm-event-msg event) val)
[setter] (sdl-sys-wm-event-msg-set! event)
sdl-text-editing-event

sdl-text-editing-event is a kind of sdl-event that wraps a pointer to a SDL_TextEditingEvent.

[procedure] (sdl-text-editing-event? x) → boolean
[procedure] (sdl-text-editing-event-window-id event) → fixnum
[setter] (set! (sdl-text-editing-event-window-id event) val)
[setter] (sdl-text-editing-event-window-id-set! event)
[procedure] (sdl-text-editing-event-text event) → string
[setter] (set! (sdl-text-editing-event-text event) val)
[setter] (sdl-text-editing-event-text-set! event)
[procedure] (sdl-text-editing-event-start event) → fixnum
[setter] (set! (sdl-text-editing-event-start event) val)
[setter] (sdl-text-editing-event-start-set! event)
[procedure] (sdl-text-editing-event-length event) → fixnum
[setter] (set! (sdl-text-editing-event-length event) val)
[setter] (sdl-text-editing-event-length-set! event)
sdl-text-input-event

sdl-text-input-event is a kind of sdl-event that wraps a pointer to a SDL_TextInputEvent.

[procedure] (sdl-text-input-event? x) → boolean
[procedure] (sdl-text-input-event-window-id event) → fixnum
[setter] (set! (sdl-text-input-event-window-id event) val)
[setter] (sdl-text-input-event-window-id-set! event)
[procedure] (sdl-text-input-event-text event) → string
[setter] (set! (sdl-text-input-event-text event) val)
[setter] (sdl-text-input-event-text-set! event)
sdl-touch-finger-event

sdl-touch-finger-event is a kind of sdl-event that wraps a pointer to a SDL_TouchFingerEvent.

[procedure] (sdl-touch-finger-event? x) → boolean
[procedure] (sdl-touch-finger-event-touch-id event) → fixnum
[setter] (set! (sdl-touch-finger-event-touch-id event) val)
[setter] (sdl-touch-finger-event-touch-id-set! event)
[procedure] (sdl-touch-finger-event-finger-id event) → fixnum
[setter] (set! (sdl-touch-finger-event-finger-id event) val)
[setter] (sdl-touch-finger-event-finger-id-set! event)
[procedure] (sdl-touch-finger-event-x event) → float
[setter] (set! (sdl-touch-finger-event-x event) val)
[setter] (sdl-touch-finger-event-x-set! event)
[procedure] (sdl-touch-finger-event-y event) → float
[setter] (set! (sdl-touch-finger-event-y event) val)
[setter] (sdl-touch-finger-event-y-set! event)
[procedure] (sdl-touch-finger-event-dx event) → float
[setter] (set! (sdl-touch-finger-event-dx event) val)
[setter] (sdl-touch-finger-event-dx-set! event)
[procedure] (sdl-touch-finger-event-dy event) → float
[setter] (set! (sdl-touch-finger-event-dy event) val)
[setter] (sdl-touch-finger-event-dy-set! event)
[procedure] (sdl-touch-finger-event-pressure event) → float
[setter] (set! (sdl-touch-finger-event-pressure event) val)
[setter] (sdl-touch-finger-event-pressure-set! event)
sdl-user-event

sdl-user-event is a kind of sdl-event that wraps a pointer to a SDL_UserEvent.

[procedure] (sdl-user-event? x) → boolean
[procedure] (sdl-user-event-window-id event) → fixnum
[setter] (set! (sdl-user-event-window-id event) val)
[setter] (sdl-user-event-window-id-set! event)
[procedure] (sdl-user-event-code event) → fixnum
[setter] (set! (sdl-user-event-code event) val)
[setter] (sdl-user-event-code-set! event)
[procedure] (sdl-user-event-data1 event) → pointer
[setter] (set! (sdl-user-event-data1 event) val)
[setter] (sdl-user-event-data1-set! event)
[procedure] (sdl-user-event-data2 event) → pointer
[setter] (set! (sdl-user-event-data2 event) val)
[setter] (sdl-user-event-data2-set! event)
sdl-window-event

sdl-window-event is a kind of sdl-event that wraps a pointer to a SDL_WindowEvent.

[procedure] (sdl-window-event? x) → boolean
[procedure] (sdl-window-event-window-id event) → fixnum
[setter] (set! (sdl-window-event-window-id event) val)
[setter] (sdl-window-event-window-id-set! event)
[procedure] (sdl-window-event-event-raw event) → fixnum
[setter] (set! (sdl-window-event-event-raw event) val)
[setter] (sdl-window-event-event-raw-set! event)
[procedure] (sdl-window-event-event event) → symbol
[setter] (set! (sdl-window-event-event event) val)
[setter] (sdl-window-event-event-set! event)
[procedure] (sdl-window-event-data1 event) → fixnum
[setter] (set! (sdl-window-event-data1 event) val)
[setter] (sdl-window-event-data1-set! event)
[procedure] (sdl-window-event-data2 event) → fixnum
[setter] (set! (sdl-window-event-data2 event) val)
[setter] (sdl-window-event-data2-set! event)

sdl-finger

sdl-finger is a record type that wraps a pointer to a SDL_Finger struct.

[procedure] (sdl-finger? x) → boolean

Returns #t if x is a sdl-finger instance.

[procedure] (sdl-finger-id finger) → fixnum
[procedure] (sdl-finger-x finger) → float
[procedure] (sdl-finger-y finger) → float
[procedure] (sdl-finger-pressure finger) → float

sdl-joystick

sdl-joystick is a record type that wraps a pointer to a SDL_Joystick struct.

[procedure] (sdl-joystick? x) → boolean

Returns #t if x is a sdl-joystick instance.

sdl-joystick-guid?

sdl-joystick-guid is a record type that wraps a pointer to a SDL_JoystickGUID struct.

[procedure] (sdl-joystick-guid? x) → boolean

Returns #t if x is a sdl-joystick-guid instance.

sdl-keysym

sdl-keysym is a record type that wraps a pointer to a SDL_Keysym struct.

[procedure] (sdl-keysym? x) → boolean

Returns #t if x is a sdl-keysym instance.

[procedure] (sdl-alloc-keysym) → sdl-keysym
[procedure] (sdl-alloc-keysym*) → sdl-keysym
[procedure] (sdl-free-keysym! keysym)
[procedure] (sdl-keysym-scancode keysym) → symbol
[setter] (set! (sdl-keysym-scancode keysym) val)
[setter] (sdl-keysym-scancode-set! keysym)
[procedure] (sdl-keysym-scancode-raw keysym) → fixnum
[setter] (set! (sdl-keysym-scancode-raw keysym) val)
[setter] (sdl-keysym-scancode-raw-set! keysym)
[procedure] (sdl-keysym-sym keysym) → symbol
[setter] (set! (sdl-keysym-sym keysym) val)
[setter] (sdl-keysym-sym-set! keysym)
[procedure] (sdl-keysym-sym-raw keysym) → fixnum
[setter] (set! (sdl-keysym-sym-raw keysym) val)
[setter] (sdl-keysym-sym-raw-set! keysym)
[procedure] (sdl-keysym-mod keysym) → list of symbols
[setter] (set! (sdl-keysym-mod keysym) val)
[setter] (sdl-keysym-mod-set! keysym)
[procedure] (sdl-keysym-mod-raw keysym) → fixnum
[setter] (set! (sdl-keysym-mod-raw keysym) val)
[setter] (sdl-keysym-mod-raw-set! keysym)

sdl-palette

sdl-palette is a record type that wraps a pointer to a SDL_Palette struct.

[procedure] (sdl-palette? x) → boolean

Returns #t if x is a sdl-palette instance.

[procedure] (sdl-alloc-palette)
[procedure] (sdl-alloc-palette*)
[procedure] (sdl-free-palette! palette)
[procedure] (sdl-palette-ncolors palette) → fixnum

sdl-pixel-format

sdl-pixel-format is a record type that wraps a pointer to a SDL_PixelFormat struct.

[procedure] (sdl-pixel-format? x) → boolean

Returns #t if x is a sdl-pixel-format instance.

[procedure] (sdl-alloc-pixel-format) → sdl-pixel-format
[procedure] (sdl-alloc-pixel-format*) → sdl-pixel-format
[procedure] (sdl-free-pixel-format! pixel-format)
[procedure] (sdl-pixel-format-format pixel-format) → symbol
[procedure] (sdl-pixel-format-format-raw pixel-format) → fixnum
[procedure] (sdl-pixel-format-palette pixel-format) → sdl-palette
[setter] (set! (sdl-pixel-format-palette pixel-format) val)
[setter] (sdl-pixel-format-palette-set! pixel-format palette)
[procedure] (sdl-pixel-format-bits-per-pixel pixel-format) → fixnum
[procedure] (sdl-pixel-format-bytes-per-pixel pixel-format) → fixnum
[procedure] (sdl-pixel-format-rmask pixel-format) → fixnum
[procedure] (sdl-pixel-format-gmask pixel-format) → fixnum
[procedure] (sdl-pixel-format-bmask pixel-format) → fixnum
[procedure] (sdl-pixel-format-amask pixel-format) → fixnum

sdl-point

sdl-point is a record type that wraps a pointer to a SDL_Point struct.

[procedure] (sdl-point? x) → boolean

Returns #t if x is a sdl-point instance.

[procedure] (sdl-make-point #!optional x y)

Allocate and initialize a new sdl-point instance. The instance will have a finalizer set so that the underlying struct's memory will automatically be freed when the record instance is garbage collected. It is not necessary to call sdl-free-point!, although it is safe to do so.

x and y are the x and y components of the point. They must be integers in the range -2147483648 to 2147483647 (inclusive). They both default to 0.

[procedure] (sdl-alloc-point) → sdl-point

Allocate (but do not initialize) a new sdl-point instance. You probably want to use sdl-make-point instead.

The instance will have a finalizer set so that the underlying struct's memory will automatically be freed when the record instance is garbage collected. It is not necessary to call sdl-free-point!, although it is safe to do so.

[procedure] (sdl-alloc-point*) → sdl-point

Allocate (but do not initialize) a new sdl-point instance. This is like sdl-alloc-point, except that the instance will not have a finalizer set, so the underlying struct's memory will not be automatically freed when the instance is garbage collected. You must manually call sdl-free-point! on the record instance when you are done with it; otherwise, your program will have a memory leak.

[procedure] (sdl-free-point! point)

Manually free the memory of the given sdl-point instance. The instance's pointer will be set to null (see sdl-struct-null?), so you cannot get or set any attribute of the instance after it has been freed. It is safe to free an instance that has a finalizer. It is safe to free an instance that has already been freed.

[procedure] (sdl-point-x point) → fixnum
[setter] (set! (sdl-point-x point) x)
[setter] (sdl-point-x-set! point x)

Get or set the x component of the sdl-point, as an integer in the range -2147483648 to 2147483647 (inclusive).

[procedure] (sdl-point-y point) → fixnum
[setter] (set! (sdl-point-y point) y)
[setter] (sdl-point-y-set! point y)

Get or set the y component of the sdl-point, as an integer in the range -2147483648 to 2147483647 (inclusive).

[procedure] (sdl-point-set! point #!optional x y) → point

Set multiple components of the sdl-point. If any of the arguments are not #f, that component of the point will be set. Any arguments that are #f will cause no change to that component of the point. Returns point after it is modified.

[procedure] (sdl-point->list point) → list of fixnums

Returns a list (x y) containing the components of the sdl-point.

sdl-rect

sdl-rect is a record type that wraps a pointer to a SDL_Rect struct.

[procedure] (sdl-rect? x) → boolean

Returns #t if x is a sdl-rect instance.

[procedure] (sdl-make-rect #!optional x y w h)

Allocate and initialize a new sdl-rect instance. The instance will have a finalizer set so that the underlying struct's memory will automatically be freed when the record instance is garbage collected. It is not necessary to call sdl-free-rect!, although it is safe to do so.

x, y, w, and h are the components of the rect. They must be integers in the range -2147483648 to 2147483647 (inclusive). They all default to 0.

[procedure] (sdl-alloc-rect)

Allocate (but do not initialize) a new sdl-rect instance. You probably want to use sdl-make-rect instead.

The instance will have a finalizer set so that the underlying struct's memory will automatically be freed when the record instance is garbage collected. It is not necessary to call sdl-free-rect!, although it is safe to do so.

[procedure] (sdl-alloc-rect*)

Allocate (but do not initialize) a new sdl-rect instance. This is like sdl-alloc-rect, except that the instance will not have a finalizer set, so the underlying struct's memory will not be automatically freed when the instance is garbage collected. You must manually call sdl-free-rect! on the record instance when you are done with it; otherwise, your program will have a memory leak.

[procedure] (sdl-free-rect! rect)

Manually free the memory of the given sdl-rect instance. The instance's recter will be set to null (see sdl-struct-null?), so you cannot get or set any attribute of the instance after it has been freed. It is safe to free an instance that has a finalizer. It is safe to free an instance that has already been freed.

[procedure] (sdl-rect-x rect)
[setter] (set! (sdl-rect-x rect) x)
[setter] (sdl-rect-x-set! rect x)

Get or set the x component of the sdl-rect, as an integer in the range -2147483648 to 2147483647 (inclusive).

[procedure] (sdl-rect-y rect)
[setter] (set! (sdl-rect-y rect) y)
[setter] (sdl-rect-y-set! rect y)

Get or set the y component of the sdl-rect, as an integer in the range -2147483648 to 2147483647 (inclusive).

[procedure] (sdl-rect-w rect)
[setter] (set! (sdl-rect-w rect) w)
[setter] (sdl-rect-w-set! rect w)

Get or set the w (width) component of the sdl-rect, as an integer in the range -2147483648 to 2147483647 (inclusive).

[procedure] (sdl-rect-h rect)
[setter] (set! (sdl-rect-h rect) h)
[setter] (sdl-rect-h-set! rect h)

Get or set the h (height) component of the sdl-rect, as an integer in the range -2147483648 to 2147483647 (inclusive).

[procedure] (sdl-rect-set! rect #!optional x y w h)

Set multiple components of the sdl-rect. If any of the arguments are not #f, that component of the rect will be set. Any arguments that are #f will cause no change to that component of the rect. Returns rect after it is modified.

[procedure] (sdl-rect->list rect)

Returns a list (x y w h) containing the components of the sdl-rect.

sdl-rwops

sdl-rwops is a record type that wraps a pointer to a SDL_RWops struct.

[procedure] (sdl-rwops? x) → boolean

Returns #t if x is a sdl-rwops instance.

[procedure] (sdl-rwops-type rwops) → symbol
[procedure] (sdl-rwops-type-raw rwops) → fixnum

sdl-surface

sdl-surface is a record type that wraps a pointer to a SDL_Surface struct.

[procedure] (sdl-surface? x) → boolean

Returns #t if x is a sdl-surface instance.

[procedure] (sdl-free-surface! surface)

See SDL_FreeSurface.

[procedure] (sdl-surface-format surface) → sdl-pixel-format
[procedure] (sdl-surface-w surface) → fixnum
[procedure] (sdl-surface-h surface) → fixnum
[procedure] (sdl-surface-pitch surface) → fixnum
[procedure] (sdl-surface-refcount surface) → fixnum
[setter] (set! (sdl-surface-refcount surface) val)
[setter] (sdl-surface-refcount-set! surface)

sdl-sys-wm-info

sdl-sys-wm-info is a record type that wraps a pointer to a SDL_SysWMinfo struct.

[procedure] (sdl-sys-wm-info? x) → boolean

Returns #t if x is a sdl-sys-wm-info instance.

sdl-sys-wm-msg

sdl-sys-wm-msg is a record type that wraps a pointer to a SDL_SysWMmsg struct.

[procedure] (sdl-sys-wm-msg? x) → boolean

Returns #t if x is a sdl-sys-wm-msg instance.

sdl-texture

sdl-texture is a record type that wraps a pointer to a SDL_Texture struct.

[procedure] (sdl-texture? x) → boolean

Returns #t if x is a sdl-texture instance.

sdl-version

sdl-version is a record type that wraps a pointer to a SDL_version struct.

[procedure] (sdl-version? x) → boolean

Returns #t if x is a sdl-version instance.

[procedure] (sdl-make-version #!optional major minor patch)

Allocate and initialize a new sdl-version instance. The instance will have a finalizer set so that the underlying struct's memory will automatically be freed when the record instance is garbage collected. It is not necessary to call sdl-free-version!, although it is safe to do so.

major, minor, and patch are the components of the version. They must be integers in the range 0 to 255 (inclusive). They all default to 0.

[procedure] (sdl-alloc-version)

Allocate (but do not initialize) a new sdl-version instance. You probably want to use sdl-make-version instead.

The instance will have a finalizer set so that the underlying struct's memory will automatically be freed when the record instance is garbage collected. It is not necessary to call sdl-free-version!, although it is safe to do so.

[procedure] (sdl-alloc-version*)

Allocate (but do not initialize) a new sdl-version instance. This is like sdl-alloc-version, except that the instance will not have a finalizer set, so the underlying struct's memory will not be automatically freed when the instance is garbage collected. You must manually call sdl-free-version! on the record instance when you are done with it; otherwise, your program will have a memory leak.

[procedure] (sdl-free-version! version)

Manually free the memory of the given sdl-version instance. The instance's versioner will be set to null (see sdl-struct-null?), so you cannot get or set any attribute of the instance after it has been freed. It is safe to free an instance that has a finalizer. It is safe to free an instance that has already been freed.

[procedure] (sdl-version-major version)
[setter] (set! (sdl-version-major version) major)
[setter] (sdl-version-major-set! version major)

Get or set the major component of the sdl-version, as an integer in the range 0 to 255 (inclusive).

[procedure] (sdl-version-minor version)
[setter] (set! (sdl-version-minor version) minor)
[setter] (sdl-version-minor-set! version minor)

Get or set the minor component of the sdl-version, as an integer in the range 0 to 255 (inclusive).

[procedure] (sdl-version-patch version)
[setter] (set! (sdl-version-patch version) patch)
[setter] (sdl-version-patch-set! version patch)

Get or set the patch component of the sdl-version, as an integer in the range 0 to 255 (inclusive).

[procedure] (sdl-version-set! version #!optional major minor patch)

Set multiple components of the sdl-version. If any of the arguments are not #f, that component of the version will be set. Any arguments that are #f will cause no change to that component of the version. Returns version after it is modified.

[procedure] (sdl-version->list version)

Returns a list (major minor patch) containing the components of the sdl-version.

sdl-window

sdl-window is a record type that wraps a pointer to a SDL_Window struct.

[procedure] (sdl-window? x) → boolean

Returns #t if x is a sdl-window instance.

Procedures

General / Miscellaneous

[procedure] (sdl-init! flags) → fixnum

See SDL_Init. Returns zero if successful.

[procedure] (sdl-init-subsystem! flags) → fixnum

See SDL_InitSubSystem. Returns zero if successful.

[procedure] (sdl-quit!)

See SDL_Quit.

[procedure] (sdl-quit-subsystem! flags)

See SDL_QuitSubSystem.

[procedure] (sdl-was-init flags) → list of symbols

See SDL_WasInit.

[procedure] (sdl-set-main-ready!)

See SDL_SetMainReady.

[procedure] (sdl-clear-error!)

See SDL_ClearError.

[procedure] (sdl-get-error) → string

See SDL_GetError.

[procedure] (sdl-set-error! message)

See SDL_SetError.

[procedure] (sdl-get-platform) → string

See SDL_GetPlatform.

[procedure] (sdl-disable-screen-saver!)

See SDL_DisableScreenSaver.

[procedure] (sdl-enable-screen-saver!)

See SDL_EnableScreenSaver.

[procedure] (sdl-screen-saver-enabled?) → boolean

See SDL_IsScreenSaverEnabled.

[procedure] (sdl-has-clipboard-text?) → boolean

See SDL_HasClipboardText.

[procedure] (sdl-get-clipboard-text) → string

See SDL_GetClipboardText.

[procedure] (sdl-set-clipboard-text! text) → fixnum

See SDL_SetClipboardText. Returns zero if successful.

[procedure] (sdl-get-version) → sdl-version

See SDL_GetVersion.

Returns a sdl-version instance containing the version number of SDL that the sdl2 egg is currently using. (This may be different than the version it was compiled with.)

[procedure] (sdl-get-compiled-version) → sdl-version

See SDL_VERSION.

Returns a sdl-version instance containing the version number of SDL that the sdl2 egg was compiled with. (This may be different than the version it is currently using.)

[procedure] (sdl-version-at-least? major minor patch) → boolean

See SDL_VERSION_ATLEAST.

Returns #t if the sdl2 egg was compiled with a version of SDL at least as high as specified. E.g. (sdl-version-at-least? 2 0 1) returns #t if the sdl2 egg was compiled with SDL 2.0.1 or higher. Some SDL features are only available after a certain version, so you can use this procedure to check whether the feature is available.

Pixel Format / Palette

[procedure] (sdl-map-rgb pixel-format r g b) → fixnum

See SDL_MapRGB.

[procedure] (sdl-map-rgba pixel-format r g b a) → fixnum

See SDL_MapRGBA.

[procedure] (sdl-get-rgb pixel pixel-format) → [r g b]

See SDL_GetRGB.

Returns multiple values.

[procedure] (sdl-get-rgba pixel pixel-format) → [r g b a]

See SDL_GetRGBA.

Returns multiple values.

[procedure] (sdl-palette-ref palette i) → sdl-color

Return the sdl-color at the given index of the palette.

[setter] (set! (sdl-palette-ref palette i) color)
[setter] (sdl-palette-set! palette i color)

Set the given index of the palette to the given sdl-color.

[procedure] (sdl-palette-colors palette) → vector of sdl-colors

Return a vector of all the colors in the palette.

[setter] (sdl-palette-colors-set! colors-vec #!optional start) -> fixnum

See SDL_SetPaletteColors.

Replace some or all of the colors in the palette.

Returns zero if successful.

Events

[procedure] (sdl-event-state type) → boolean

See SDL_EventState.

Like SDL_EventState with SDL_QUERY

[setter] (set! (sdl-event-state type) state) → boolean
[setter] (sdl-event-state-set! type state) → boolean

See SDL_EventState.

Like SDL_EventState with SDL_ENABLE or SDL_IGNORE

Returns the previous state of this event type.

[procedure] (sdl-flush-event! type)

See SDL_FlushEvent.

Note: Contrary to what its name suggests, this function will flush ALL events matching the given type, not just a single event.

[procedure] (sdl-flush-events! min-type max-type)

See SDL_FlushEvents.

[procedure] (sdl-has-event? type) → boolean

See SDL_HasEvent.

[procedure] (sdl-has-events? min-type max-type) → boolean

See SDL_HasEvents.

[procedure] (sdl-quit-requested?) → boolean

See SDL_QuitRequested.

[procedure] (sdl-peek-events num #!optional min-type max-type) → list of sdl-events

See SDL_PeepEvents.

Like SDL_PeepEvents with SDL_PEEKEVENT

This procedure is similar to sdl-get-events!, except that procedure removes the events from the SDL event queue.

[procedure] (sdl-get-events! num #!optional min-type max-type) → list of sdl-events

See SDL_PeepEvents.

Like SDL_PeepEvents with SDL_GETEVENT

This procedure is similar to sdl-peek-events, except that procedure does not remove the events from the SDL event queue.

[procedure] (sdl-poll-event! #!optional event) → sdl-event

See SDL_PollEvent.

If event is omitted, a new sdl-event is allocated and returned. If event is an existing sdl-event instance, it will be modified and returned. (This allows you to allocate a single event and reuse it many times in your event loop, so that your program does not create as much garbage for the garbage collector.)

[procedure] (sdl-pump-events!)

See SDL_PumpEvents.

[procedure] (sdl-push-event! event) → fixnum

See SDL_PushEvent.

Returns 1 if successful.

[procedure] (sdl-wait-event! #!optional event) →

See SDL_WaitEvent.

If event is omitted, a new sdl-event is allocated and returned. If event is an existing sdl-event instance, it will be modified and returned. (This allows you to allocate a single event and reuse it many times in your event loop, so that your program does not create as much garbage for the garbage collector.)

[procedure] (sdl-wait-event-timeout! timeout #!optional event) →

See SDL_WaitEventTimeout.

If event is omitted, a new sdl-event is allocated and returned. If event is an existing sdl-event instance, it will be modified and returned. (This allows you to allocate a single event and reuse it many times in your event loop, so that your program does not create as much garbage for the garbage collector.)

Please note that the argument order is reversed compared to SDL_WaitEventTimeout. This is to allow the event argument to be optional.

[procedure] (sdl-register-events! numevents) → fixnum

See SDL_RegisterEvents.

[procedure] (sdl-get-num-touch-devices) → fixnum

See SDL_GetNumTouchDevices.

[procedure] (sdl-get-num-touch-fingers touch-id) → fixnum

See SDL_GetNumTouchFingers.

[procedure] (sdl-get-touch-device device-id) → fixnum

See SDL_GetTouchDevice.

[procedure] (sdl-get-touch-finger touch-id index) →

See SDL_GetTouchFinger.

OpenGL integration

[procedure] (sdl-gl-create-context! window) → sdl-gl-context

See SDL_GL_CreateContext.

[procedure] (sdl-gl-delete-context! gl-context)

See SDL_GL_DeleteContext.

[procedure] (sdl-gl-make-current! window gl-context) → fixnum

See SDL_GL_MakeCurrent.

[procedure] (sdl-gl-get-current-window) → sdl-window

See SDL_GL_GetCurrentWindow.

[procedure] (sdl-gl-get-current-context) → sdl-gl-context

See SDL_GL_GetCurrentContext.

[procedure] (sdl-gl-get-attribute attr) → value

See SDL_GL_GetAttribute.

[procedure] (sdl-gl-set-attribute! attr value) → fixnum

See SDL_GL_SetAttribute. Returns zero if successful.

[procedure] (sdl-gl-reset-attributes!)

See SDL_GL_ResetAttributes. Requires SDL 2.0.2 or higher.

[procedure] (sdl-gl-get-drawable-size window) → [w h]

See SDL_GL_GetDrawableSize. Requires SDL 2.0.1 or higher. Returns multiple values.

[procedure] (sdl-gl-swap-window!)

See SDL_GL_SwapWindow.

[procedure] (sdl-gl-get-swap-interval) → fixnum

See SDL_GL_GetSwapInterval.

[procedure] (sdl-gl-set-swap-interval! interval) → fixnum

See SDL_GL_SetSwapInterval. Returns zero if successful

[procedure] (sdl-gl-extension-supported? name-string) → boolean

See SDL_GL_ExtensionSupported.

Joystick

[procedure] (sdl-num-joysticks) → fixnum

See SDL_NumJoysticks.

[procedure] (sdl-joystick-open! index) → sdl-joystick

See SDL_JoystickOpen.

[procedure] (sdl-joystick-close! joystick)

See SDL_JoystickClose.

[procedure] (sdl-joystick-update!)

See SDL_JoystickUpdate.

[procedure] (sdl-joystick-event-state) → boolean

See SDL_JoystickEventState.

Like SDL_JoystickEventState with SDL_QUERY.

[setter] (set! (sdl-joystick-event-state) state) → boolean
[setter] (sdl-joystick-event-state-set! state) → boolean

See SDL_JoystickEventState.

Like SDL_JoystickEventState with SDL_ENABLE or SDL_IGNORE

[procedure] (sdl-joystick-attached? joystick) → boolean

See SDL_JoystickGetAttached.

[procedure] (sdl-joystick-num-axes joystick) → fixnum

See SDL_JoystickNumAxes.

[procedure] (sdl-joystick-num-balls joystick) → fixnum

See SDL_JoystickNumBalls.

[procedure] (sdl-joystick-num-buttons joystick) → fixnum

See SDL_JoystickNumButtons.

[procedure] (sdl-joystick-num-hats joystick) → fixnum

See SDL_JoystickNumHats.

[procedure] (sdl-joystick-get-axis joystick axis-num) → fixnum

See SDL_JoystickGetAxis.

[procedure] (sdl-joystick-get-ball joystick ball-num) → [dx dy]

See SDL_JoystickGetBall.

Returns multiple values.

[procedure] (sdl-joystick-get-button joystick button-num) → boolean

See SDL_JoystickGetButton.

[procedure] (sdl-joystick-get-hat joystick hat-num) → symbol

See SDL_JoystickGetHat.

[procedure] (sdl-joystick-get-hat-raw joystick hat-num) → fixnum

See SDL_JoystickGetHat.

[procedure] (sdl-joystick-instance-id joystick) →

See SDL_JoystickInstanceID.

[procedure] (sdl-joystick-name joystick) → string

See SDL_JoystickName.

[procedure] (sdl-joystick-name-for-index device-index) → string

See SDL_JoystickNameForIndex.

[procedure] (sdl-joystick-get-device-guid device-index) → sdl-joystick-guid

See SDL_JoystickGetDeviceGUID.

[procedure] (sdl-joystick-get-guid joystick) → sdl-joystick-guid

See SDL_JoystickGetGUID.

[procedure] (sdl-joystick-get-guid-from-string str) → sdl-joystick-guid

See SDL_JoystickGetGUIDFromString.

[procedure] (sdl-joystick-get-guid-string guid) → string

See SDL_JoystickGetGUIDString.

Keyboard

[procedure] (sdl-get-key-from-name name-str) → symbol

See SDL_GetKeyFromName.

[procedure] (sdl-get-key-from-name-raw name-str) → fixnum

See SDL_GetKeyFromName.

[procedure] (sdl-get-key-from-scancode scancode) → symbol

See SDL_GetKeyFromScancode.

[procedure] (sdl-get-key-from-scancode-raw scancode) → fixnum

See SDL_GetKeyFromScancode.

[procedure] (sdl-get-key-name key) → string

See SDL_GetKeyName.

[procedure] (sdl-get-scancode-from-name name-str) → symbol

See SDL_GetScancodeFromName.

[procedure] (sdl-get-scancode-from-name-raw name-str) → fixnum

See SDL_GetScancodeFromName.

[procedure] (sdl-get-scancode-from-key key) → symbol

See SDL_GetScancodeFromKey.

[procedure] (sdl-get-scancode-from-key-raw key) → fixnum

See SDL_GetScancodeFromKey.

[procedure] (sdl-get-scancode-name ...) →

See SDL_GetScancodeName.

[procedure] (sdl-get-keyboard-focus) → window

See SDL_GetKeyboardFocus.

[procedure] (sdl-keyboard-scancode-pressed? scancode) → boolean

Returns #t if the specified key is being pressed on the keyboard. scancode can be either a symbol or an integer representing the scancode of a keyboard key.

This procedure queries SDL's internal state, which is connected to the event system. Call sdl-pump-events! to update the keyboard state.

This procedure is based on SDL_GetKeyboardState.

[procedure] (sdl-mod-state) → list of symbols

See SDL_GetModState.

[procedure] (sdl-mod-state-raw) → fixnum

See SDL_GetModState.

[setter] (set! (sdl-mod-state) state)
[setter] (sdl-mod-state-set! state)

See SDL_SetModState.

State can be either a list of symbols or an integer bitfield.

[setter] (sdl-text-input-rect-set! rect)

rect can be an sdl-rect or #f.

See SDL_SetTextInputRect.

[procedure] (sdl-start-text-input!)

See SDL_StartTextInput.

[procedure] (sdl-stop-text-input!)

See SDL_StopTextInput.

[procedure] (sdl-text-input-active?) → boolean

See SDL_IsTextInputActive.

[procedure] (sdl-screen-keyboard-support?) → boolean

See SDL_HasScreenKeyboardSupport.

[procedure] (sdl-screen-keyboard-shown? window) → boolean

See SDL_IsScreenKeyboardShown.

Rect / Point

[procedure] (sdl-rect-empty? rect) → boolean

See SDL_RectEmpty.

[procedure] (sdl-rect=? rect1 rect2) → boolean

See SDL_RectEquals.

[procedure] (sdl-enclose-points points #!optional clip result-rect) → [any-enclosed? result-rect]

See SDL_EnclosePoints.

points must be a list of sdl-points. clip is either a sdl-rect (to ignore points outside the clip rect) or #f (to consider all points). result-rect is either a sdl-rect (which will be modified and returned) or #f (a new sdl-rect will be returned).

This procedure returns multiple values.

any-enclosed?
#t if any points were enclosed, or #f if all points were clipped
result-rect
a sdl-rect instance that encloses all matching points. This is the same rect as result-rect (but modified), if that argument was given. Otherwise this is a newly allocated rect.
[procedure] (sdl-has-intersection? rect1 rect2) → boolean

See SDL_HasIntersection.

[procedure] (sdl-intersect-rect rect1 rect2 #!optional result-rect) → [intersect? result-rect]

See SDL_IntersectRect.

[procedure] (sdl-intersect-rect-and-line rect x1 y1 x2 y2) → [intersect? x1-new y1-new x2-new y2-new]

See SDL_IntersectRectAndLine.

This procedure returns multiple values.

intersect?
#t if the given line intersected with the rect
x1-new
the x value of a point within the rect closest to the first point
y1-new
the y value ...
x2-new
the x value of a point within the rect closest to the second point
y2-new
the y value ...
[procedure] (sdl-union-rect rect1 rect2 #!optional result-rect) → result-rect

See SDL_UnionRect.

RWops

[procedure] (sdl-rw-from-file ...) →

See SDL_RWFromFile.

[procedure] (sdl-rw-from-const-mem pointer) → sdl-rwops

See SDL_RWFromConstMem.

[procedure] (sdl-rw-from-mem pointer) → sdl-rwops

See SDL_RWFromMem.

[procedure] (sdl-rw-from-blob blob) → sdl-rwops

Create a new sdl-rwops that accesses the memory of the given CHICKEN Scheme blob.

WARNING: You must make sure that the blob remains in scope for at least as long as the resulting sdl-rwops is open. If the blob is garbage collected before the sdl-rwops, your program may crash if you try to read or write from the sdl-rwops.

[procedure] (sdl-rw-from-string str) → sdl-rwops

Create a new sdl-rwops that accesses the memory of the given CHICKEN Scheme string.

WARNING: You must make sure that the string remains in scope for at least as long as the resulting sdl-rwops is open. If the string is garbage collected before the sdl-rwops, your program may crash if you try to read or write from the sdl-rwops.

[procedure] (sdl-rw-from-u8vector u8v) →

Create a new sdl-rwops that accesses the memory of the given SRFI-4 u8vector.

WARNING: You must make sure that the u8vector remains in scope for at least as long as the resulting sdl-rwops is open. If the u8vector is garbage collected before the sdl-rwops, your program may crash if you try to read or write from the sdl-rwops.

[procedure] (sdl-rw-close! rwops) → fixnum

See SDL_RWclose.

Close the given sdl-rwops.

Returns zero if successful.

Surface

[procedure] (sdl-make-surface width height depth) → sdl-surface or #f

Create a new surface with the given width, height, and color depth (in bits per pixel). This is a more convenient interface for sdl-create-rgb-surface. The surface's pixel format masks will be chosen automatically based on the requested depth and the current platform's byte order (little endian or big endian). Returns #f if the surface could not be created (e.g. because the color depth is unsupported).

The surface will have a finalizer set so that the underlying struct's memory will automatically be freed when the record instance is garbage collected. It is not necessary to call sdl-free-surface!, although it is safe to do so.

See also sdl-make-surface*, which does not set a finalizer.

[procedure] (sdl-make-surface* width height depth) → sdl-surface or #f

Similar to sdl-make-surface, except that the surface will not have a finalizer set on it. You must call sdl-free-surface! when you are done with the surface.

[procedure] (sdl-create-rgb-surface flags width height depth rmask gmask bmask amask) → sdl-surface

See SDL_CreateRGBSurface.

See also sdl-make-surface for a more convenient interface.

[procedure] (sdl-create-rgb-surface-from pixels width height depth pitch rmask gmask bmask amask) → sdl-surface

See SDL_CreateRGBSurfaceFrom.

[procedure] (sdl-convert-surface surface pixel-format flags) → sdl-surface

See SDL_ConvertSurface.

[procedure] (sdl-load-bmp path-string) → sdl-surface

See SDL_LoadBMP.

The surface will have a finalizer set so that the underlying struct's memory will automatically be freed when the record instance is garbage collected. It is not necessary to call sdl-free-surface!, although it is safe to do so.

[procedure] (sdl-load-bmp* filepath) → sdl-surface

Similar to sdl-load-bmp, except that the surface will not have a finalizer set on it. You must call sdl-free-surface! when you are done with the surface.

[procedure] (sdl-load-bmp-rw rwops) → sdl-surface

See SDL_LoadBMP_RW.

The surface will have a finalizer set so that the underlying struct's memory will automatically be freed when the record instance is garbage collected. It is not necessary to call sdl-free-surface!, although it is safe to do so.

[procedure] (sdl-load-bmp-rw* rwops) → sdl-surface

Similar to sdl-load-bmp-rw, except that the surface will not have a finalizer set on it. You must call sdl-free-surface! when you are done with the surface.

[procedure] (sdl-save-bmp! surface filepath) → fixnum

See SDL_SaveBMP.

Returns zero if successful.

[procedure] (sdl-save-bmp-rw! surface rwops) → fixnum

See SDL_SaveBMP_RW.

Returns zero if successful.

[procedure] (sdl-lock-surface! surface) → fixnum

See SDL_LockSurface.

Returns zero if successful.

[procedure] (sdl-unlock-surface! surface) →

See SDL_UnlockSurface.

[procedure] (sdl-must-lock? surface) → boolean

See SDL_MUSTLOCK.

[procedure] (sdl-blit-surface! src src-rect dest dest-rect) → fixnum

See SDL_BlitSurface.

Returns zero if successful. May modify dest-rect.

[procedure] (sdl-blit-scaled! src src-rect dest dest-rect) → fixnum

See SDL_BlitScaled.

Returns zero if successful. May modify dest-rect.

[procedure] (sdl-lower-blit! src src-rect dest dest-rect) → fixnum

See SDL_LowerBlit.

Returns zero if successful. May modify dest-rect.

[procedure] (sdl-lower-blit-scaled! src src-rect dest dest-rect) → fixnum

See SDL_LowerBlitScaled.

Returns zero if successful. May modify dest-rect.

[procedure] (sdl-fill-rect! surface rect color) → fixnum

See SDL_FillRect.

rect may be a sdl-rect to fill part of the surface, or #f to fill the entire surface.

color may be an sdl-color or a mapped color (an integer, like returned by sdl-map-rgba).

Returns zero if successful.

[procedure] (sdl-fill-rects! surface rects color) → fixnum

See SDL_FillRects.

rects must be a list of sdl-rects.

color may be an sdl-color or a mapped color (an integer, like returned by sdl-map-rgba).

Returns zero if successful.

[procedure] (sdl-surface-ref surface x y) → sdl-color

Returns the color of the specified pixel on the surface, as an sdl-color. Signals an error if x or y is out of bounds.

[procedure] (sdl-surface-ref-raw surface x y) → fixnum

Like sdl-surface-ref, but returns a mapped color (an integer) instead of a sdl-color. You can use sdl-get-rgba to convert the mapped color to color components.

[setter] (set! (sdl-surface-ref surface x y) color)
[setter] (sdl-surface-set! surface x y color)

Set the color of the specified pixel on the surface. Automatically locks and unlocks the surface if needed. color can be either a sdl-color or a mapped color (an integer). Note: This procedure ignores the surface's clip rect (if any).

[procedure] (sdl-surface-clip-rect surface) → sdl-rect

See SDL_GetClipRect.

Returns a copy of the surface's clip rect.

[setter] (set! (sdl-surface-clip-rect surface) rect) → boolean
[setter] (sdl-surface-clip-rect-set! surface rect) → boolean

See SDL_SetClipRect.

Sets the surface's clip rect to a copy of the given rect. Or rect can be #f to disable clipping.

Returns #t if the given rect intersects the surface at all, or #f if the rect is out of bounds / completely clips out the surface.

[procedure] (sdl-surface-color-key surface) → sdl-color or #f

See SDL_GetColorKey.

[procedure] (sdl-surface-color-key-raw surface) → fixnum or #f

Like sdl-surface-color-key, but returns a mapped color (an integer) instead of a sdl-color.

[setter] (set! (sdl-surface-color-key surface) color) → boolean
[setter] (sdl-surface-color-key-set! surface color) → boolean

See SDL_SetColorKey.

color can be a sdl-color, a mapped color (an integer), or #f to disable color keying.

Returns zero if successful.

[procedure] (sdl-surface-alpha-mod ...) →
[setter] (sdl-surface-alpha-mod-set! ...)

See SDL_SetSurfaceAlphaMod.

[procedure] (sdl-surface-blend-mode surface) → symbol

See SDL_GetSurfaceBlendMode.

Returns one of these symbols: 'none, 'blend, 'add, or 'mod.

[setter] (sdl-surface-blend-mode-set! ...)

See SDL_SetSurfaceBlendMode.

mode can be one of these symbols: 'none, 'blend, 'add, or 'mod.

[procedure] (sdl-surface-color-mod surface) → [r g b]

See SDL_GetSurfaceColorMod.

Returns multiple values.

[setter] (set! (sdl-surface-color-mod surface) rgb)
[setter] (sdl-surface-color-mod-set! surface rgb)

See SDL_SetSurfaceColorMod.

rgb can be a list (r g b) of color components, or a sdl-color (in which case the alpha component will be ignored).

[procedure] (sdl-surface-palette surface) → sdl-palette or #f

Returns the surface's palette, or #f if it has no palette. This is the same as doing:

   (sdl-pixel-format-palette
     (sdl-surface-format surface))
[setter] (set! (sdl-surface-palette surface) palette)
[setter] (sdl-surface-palette-set! surface palette)

See SDL_SetSurfacePalette.

[setter] (sdl-surface-rle-set! surface enable)

See SDL_SetSurfaceRLE.

enable is #t to enable RLE acceleration or #f to disable it.

Timer

[procedure] (sdl-delay milliseconds)

See SDL_Delay.

[procedure] (sdl-get-ticks) → fixnum

See SDL_GetTicks.

[procedure] (sdl-get-performance-counter) → fixnum

See SDL_GetPerformanceCounter.

[procedure] (sdl-get-performance-frequency) → fixnum

See SDL_GetPerformanceFrequency.

[procedure] (sdl-ticks-passed? ticks-a ticks-b) → boolean

See SDL_TICKS_PASSED.

Requires SDL 2.0.1 or higher.

Window

[procedure] (sdl-create-window! title x y w h #!optional flags) → sdl-window

See SDL_CreateWindow.

x and y can be integers, the symbol 'centered, or the symbol 'undefined.

flags is a list of zero or more of the following symbols:

[procedure] (sdl-get-window-from-id id) → sdl-window

See SDL_GetWindowFromID.

[procedure] (sdl-destroy-window! window)

See SDL_DestroyWindow.

[procedure] (sdl-update-window-surface! window) → fixnum

See SDL_UpdateWindowSurface.

Returns zero if successful.

[procedure] (sdl-update-window-surface-rects! window rects) →

See SDL_UpdateWindowSurfaceRects.

rects must be a list of sdl-rects.

Returns zero if successful.

[procedure] (sdl-show-window! window)

See SDL_ShowWindow.

[procedure] (sdl-hide-window! window)

See SDL_HideWindow.

[procedure] (sdl-maximize-window! window)

See SDL_MaximizeWindow.

[procedure] (sdl-minimize-window! window)

See SDL_MinimizeWindow.

[procedure] (sdl-raise-window! window)

See SDL_RaiseWindow.

[procedure] (sdl-restore-window! window)

See SDL_RestoreWindow.

[setter] (sdl-window-bordered-set! window bordered)

See SDL_SetWindowBordered.

bordered is #t to enable window decoration or #f to disable window decoration.

(There is currently no getter.)

[procedure] (sdl-window-brightness window) → float

See SDL_GetWindowBrightness.

[setter] (set! (sdl-window-brightness window) brightness) → fixnum
[setter] (sdl-window-brightness-set! window brightness) → fixnum

See SDL_SetWindowBrightness.

Returns zero if successful.

[procedure] (sdl-window-display-index window) → fixnum

See SDL_GetWindowDisplayIndex.

[procedure] (sdl-window-display-mode window) → sdl-display-mode

See SDL_GetWindowDisplayMode.

[setter] (sdl-window-display-mode-set! ...)
[procedure] (sdl-window-flags window) → list of symbols

See SDL_GetWindowFlags.

See sdl-create-window! for a list of the possible flag symbols.

[setter] (sdl-window-fullscreen-set! window mode)

See SDL_SetWindowFullscreen.

mode can be:

#t or 'fullscreen
fullscreen
'fullscreen-desktop
fullscreen desktop
#f
not fullscreen

Returns zero if successful.

[procedure] (sdl-window-grab window) → boolean

See SDL_GetWindowGrab.

[setter] (set! (sdl-window-grab window) grab?
[setter] (sdl-window-grab-set! window grab?)

See SDL_SetWindowGrab.

[setter] (sdl-window-icon-set! window icon-surface)

See SDL_SetWindowIcon.

[procedure] (sdl-window-id window) → fixnum

See SDL_GetWindowID.

[procedure] (sdl-window-maximum-size window) → [width height]

See SDL_GetWindowMaximumSize.

[setter] (set! (sdl-window-maximum-size window) size)
[setter] (sdl-window-maximum-size-set! window size)

size must be a list of integers (width height).

[procedure] (sdl-window-minimum-size window) → [width height]

See SDL_GetWindowMinimumSize.

[setter] (set! (sdl-window-minimum-size window) size)
[setter] (sdl-window-minimum-size-set! window size)

size must be a list of integers (width height).

[procedure] (sdl-window-pixel-format window) → sdl-pixel-format

See SDL_GetWindowPixelFormat.

[procedure] (sdl-window-position window) → [x y]

See SDL_GetWindowPosition.

[setter] (set! (sdl-window-position window) pos)
[setter] (sdl-window-position-set! window pos)

pos must be a list of integers (x y).

[procedure] (sdl-window-size window) → [width height]

See SDL_GetWindowSize.

[setter] (set! (sdl-window-size window) size)
[setter] (sdl-window-size-set! window size)

See SDL_SetWindowSize.

size must be a list of integers (width height).

[procedure] (sdl-window-surface window) → sdl-surface

See SDL_GetWindowSurface.

[procedure] (sdl-window-title window) → string

See SDL_GetWindowTitle.

[setter] (set! (sdl-window-title window) title)
[setter] (sdl-window-title-set! window title)

See SDL_SetWindowTitle.