Basics
======

     (use-modules (sdl2))

 -- Procedure: sdl-init [SUBSYSTEMS]
     Initialize the SDL library.  This must be called before using any other SDL procedure.

     SUBSYSTEMS is an optional list of symbols that specifies the subsystems to initialize.  All subsystems are initialized by default. The possible flags are timer, audio, video, haptic, game-controller, and events.

 -- Procedure: sdl-quit
     Quit all activated SDL subsystems.  This procedure should be called upon all exit conditions.

 -- Procedure: sdl-version
     Return a three element list containing the major, minor, and patch version of the linked SDL library.

 -- Procedure: sdl-ticks
     Return the number of milliseconds since the SDL library was initialized.

Window Management
=================

     (use-modules (sdl2 video))

Windows
-------

 -- Procedure: make-window [#:title "Guile SDL2 Window"]
     [#:position (#f #f)]
     [#:size (640 480)]
     [#:maximize? #f]
     [#:minimize? #f]
     [#:opengl? #f]
     [#:border? #t]
     [#:fullscreen? #f]
     [#:fullscreen-desktop? #f]
     [#:grab-input? #f]
     [#:high-dpi? #f]
     Create a new window named TITLE with dimensions SIZE located at POSITION on the display.  POSITION and SIZE are two-element lists in the form (x y), where each coordinate is measured in pixels.  In the case of POSITION, a coordinate may use the special symbol CENTER to indicate that the window should be centered on that axis, or #f to indicate that it does not matter where the window is located on that axis.

 -- Procedure: close-window! window
     Close WINDOW.

 -- Procedure: call-with-window window proc
     Call PROC with WINDOW, an SDL window object, and close it when PROC returns or otherwise exits.

 -- Procedure: window-title window
     Return the title for WINDOW.

 -- Procedure: window-size window
     Return the dimensions of WINDOW.

 -- Procedure: window-position window
     Return the position of WINDOW on the display.

 -- Procedure: window-id window
     Return the numeric ID of WINDOW.

 -- Procedure: id->window id
     Return the window corresponding to ID, a positive integer, or #f if there is no such window.

 -- Procedure: hide-window! window
     Hide WINDOW.

 -- Procedure: show-window! window
     Show WINDOW and focus on it.

 -- Procedure: maximize-window! window
     Make WINDOW as large as possible.

 -- Procedure: minimize-window! window
     Shrink WINDOW to an iconic representation.

 -- Procedure: raise-window! window
     Raise WINDOW above all other windows and set input focus.

 -- Procedure: restore-window! window
     Restore the size and position of a minimized or maximized WINDOW.

 -- Procedure: set-window-border! window border?
     When BORDER?, draw the usual border around WINDOW, otherwise remove the border.

 -- Procedure: set-window-title! window title
     Set the title of WINDOW to the string TITLE.

 -- Procedure: set-window-position! window position
     Set the position of WINDOW to POSITION, a two-element list of (x,y) coordinates measured in pixels.

 -- Procedure: set-window-size! window size
     Set the dimensions of WINDOW to SIZE, a two-element list of (width,height) coordinates measured in pixels.

 -- Procedure: set-window-fullscreen! window fullscreen? [#:desktop?]
     Toggle fullscreen mode on/off for WINDOW.  If FULLSCREEN?, fullscreen mode is activated, otherwise it is deactivated.  If FULLSCREEN? and DESKTOP?, a special "fake" fullscreen mode is used that takes the size of the desktop.

OpenGL
------

 -- Procedure: make-gl-context window
     Create an OpenGL context for WINDOW.

 -- Procedure: delete-gl-context! context
     Delete CONTEXT, an OpenGL context object.

 -- Procedure: call-with-gl-context window proc
     Call PROC with a new OpenGL context created for WINDOW, and close the context when PROC returns or otherwise exits.

 -- Procedure: swap-gl-window window
     Update WINDOW with OpenGL rendering.

 -- Procedure: set-gl-attribute! attr value
     Set the OpenGL attribute represented by the symbol ATTR to VALUE.  Possible values for ATTR are:

       * red-size

       * green-size

       * blue-size

       * alpha-size

       * buffer-size

       * double-buffer

       * depth-size

       * stencil-size

       * accum-red-size

       * accum-green-size

       * accum-blue-size

       * stereo

       * multisample-buffers

       * multisample-samples

       * retained-backing

       * context-major-version

       * context-minor-version

       * context-egl

       * context-flags

       * context-profile-mask

       * share-with-current-context

       * framebuffer-srgb-capable

 -- Procedure: set-gl-swap-interval! interval
     Set the framebuffer swap interval for the current OpenGL context to the type indicated by the symbol INTERVAL.  Possible values of INTERVAL are:

       * immediate, for immediate updates

       * vsync, for updates synchronized with the screen's vertical retrace

       * late-swap-tear, for late swap tearing

     Late swap tearing works the same as vsync, but if the vertical retrace has been missed for a given frame, buffers are swapped immediately, which might be less jarring for the user during occasional framerate drops.

Input
=====

Keyboard
--------

     (use-modules (sdl2 input keyboard))

 -- Procedure: key-pressed? key
     Return #t if KEY is currently being pressed.

 -- Procedure: key-released? key
     Return #t is KEY is not currently being pressed.

Mouse
-----

     (use-modules (sdl2 input mouse))

 -- Procedure: mouse-x
     Return the x coordinate of the mouse cursor.

 -- Procedure: mouse-y
     Return the y coordinate of the mouse cursor.

 -- Procedure: mouse-button-pressed? button
     Return #t if BUTTON is currently being pressed.

 -- Procedure: mouse-button-released? button
     Return #t if BUTTON is not currently being pressed.

Joysticks
---------

     (use-modules (sdl2 input joystick))

 -- Procedure: num-joysticks
     Return the current number of connected joystick devices.

 -- Procedure: open-joystick device-index
     Return a joystick object for the physical joystick device associated with DEVICE-INDEX.

 -- Procedure: close-joystick joystick
     Close JOYSTICK.

 -- Procedure: joystick-instance-id joystick
     Return the instance id of JOYSTICK.

 -- Procedure: joystick-power-level joystick
     Return the symbolic battery power level for JOYSTICK, either unknown, empty, low, medium, full, or wired.

 -- Procedure: joystick-num-axes joystick
     Return the number of axes for JOYSTICK.

 -- Procedure: joystick-num-balls joystick
     Return the number of balls for JOYSTICK.

 -- Procedure: joystick-num-buttons joystick
     Return the number of buttons for JOYSTICK.

 -- Procedure: joystick-num-hats joystick
     Return the number of hats for JOYSTICK.

Game Controllers
----------------

     (use-modules (sdl2 input game-controller))

 -- Procedure: load-game-controller-mappings! file
     Load game controller mapping from FILE and return the number of mappings added this way.

     See https://raw.github.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt for a community maintained controller mapping file.

 -- Procedure: open-game-controller joystick-index
     Return a game controller object for the physical joystick device associated with the JOYSTICK-INDEX.

 -- Procedure: close-game-controller controller
     Close CONTROLLER.

 -- Procedure: game-controller? controller
     Close CONTROLLER.

 -- Procedure: game-controller-attached? controller
     Return #t if CONTROLLER is currently in use.

 -- Procedure: game-controller-joystick controller
     Return the underlying joystick object associated with CONTROLLER.

 -- Procedure: game-controller-name controller
     Return the human readable name for CONTROLLER.

 -- Procedure: game-controller-axis controller axis
     Return a number in the range [-32768, 32767] representing the current state of AXIS on CONTROLLER.

     AXIS may be one of the following symbols:

       * left-x

       * left-y

       * right-x

       * right-y

       * trigger-left

       * trigger-right

 -- Procedure: game-controller-button-pressed? controller button
     Return #t if BUTTON is pressed on CONTROLLER.

     BUTTON may be one of the following symbols:

       * a

       * b

       * x

       * y

       * back

       * guide

       * start

       * left-stick

       * right-stick

       * left-shoulder

       * right-shoulder

       * dpad-up

       * dpad-down

       * dpad-left

       * dpad-right

 -- Procedure: game-controller-index? joystick-index
     Return #t if JOYSTICK-INDEX is a valid game controller index.

Events
======

     (use-modules (sdl2 events))

 -- Procedure: make-quit-event timestamp

 -- Procedure: quit-event? e
     Return #t if E is a quit event.

 -- Procedure: quit-event-timestamp e

 -- Procedure: make-window-event timestamp window-id type vector

 -- Procedure: window-event? e
     Return #t if E is a window event.

 -- Procedure: window-shown-event? e
     Return #t if E is a window shown event.

 -- Procedure: window-hidden-event? e
     Return #t if E is a window hidden event.

 -- Procedure: window-exposed-event? e
     Return #t if E is a window exposed event.

 -- Procedure: window-moved-event? e
     Return #t if E is a window moved event.

 -- Procedure: window-resized-event? e
     Return #t if E is a window resized event.

 -- Procedure: window-size-changed-event? e
     Return #t if E is a window size changed event.

 -- Procedure: window-minimized-event? e
     Return #t if E is a window minimized event.

 -- Procedure: window-maximized-event? e
     Return #t if E is a window maximized event.

 -- Procedure: window-restored-event? e
     Return #t if E is a window restored event.

 -- Procedure: window-enter-event? e
     Return #t if E is a window enter event.

 -- Procedure: window-leave-event? e
     Return #t if E is a window leave event.

 -- Procedure: window-focus-gained-event? e
     Return #t if E is a window focus gained event.

 -- Procedure: window-focus-lost-event? e
     Return #t if E is a window focus lost event.

 -- Procedure: window-closed-event? e
     Return #t if E is a window closed event.

 -- Procedure: window-event-timestamp e

 -- Procedure: window-event-window-id e

 -- Procedure: window-event-type e

 -- Procedure: window-event-vector e

 -- Procedure: make-keyboard-event timestamp
     window-id
     pressed?
     repeat?
     key
     scancode
     modifiers

 -- Procedure: keyboard-event? e
     Return #t if E is a keyboard event.

 -- Procedure: keyboard-down-event? e
     Return #t if E is a key press event.

 -- Procedure: keyboard-up-event? e
     Return #t if E is a key release event.

 -- Procedure: keyboard-event-timestamp e

 -- Procedure: keyboard-event-window-id e

 -- Procedure: keyboard-event-pressed? e

 -- Procedure: keyboard-event-repeat? e

 -- Procedure: keyboard-event-key e

 -- Procedure: keyboard-event-scancode e

 -- Procedure: keyboard-event-modifiers e

 -- Procedure: make-text-input-event timestamp window-id text

 -- Procedure: text-input-event? e
     Return #t if E is a text input event.

 -- Procedure: text-input-event-timestamp e

 -- Procedure: text-input-event-window-id e

 -- Procedure: text-input-event-text e

 -- Procedure: make-mouse-button-event timestamp
     window-id
     which
     button
     pressed?
     clicks
     x
     y

 -- Procedure: mouse-button-event? e
     Return #t if E is a mouse button event.

 -- Procedure: mouse-button-down-event? e
     Return #t if E is a mouse button down event.

 -- Procedure: mouse-button-up-event? e
     Return #t if E is a mouse button up event.

 -- Procedure: mouse-button-event-timestamp e

 -- Procedure: mouse-button-event-window-id e

 -- Procedure: mouse-button-event-which e

 -- Procedure: mouse-button-event-button e

 -- Procedure: mouse-button-event-pressed? e

 -- Procedure: mouse-button-event-clicks e

 -- Procedure: mouse-button-event-x e

 -- Procedure: mouse-button-event-y e

 -- Procedure: make-mouse-motion-event timestamp
     window-id
     which
     buttons
     x
     y
     x-rel
     y-rel

 -- Procedure: mouse-motion-event? e
     Return #t if E is a mouse motion event.

 -- Procedure: mouse-motion-event-timestamp e

 -- Procedure: mouse-motion-event-window-id e

 -- Procedure: mouse-motion-event-which e

 -- Procedure: mouse-motion-event-buttons e

 -- Procedure: mouse-motion-event-x e

 -- Procedure: mouse-motion-event-y e

 -- Procedure: mouse-motion-event-x-rel e

 -- Procedure: mouse-motion-event-y-rel e

 -- Procedure: make-joystick-axis-event timestamp which axis value

 -- Procedure: joystick-axis-event? e
     Return #t if E is a joystick axis event.

 -- Procedure: joystick-axis-event-timestamp e

 -- Procedure: joystick-axis-event-which e

 -- Procedure: joystick-axis-event-button e

 -- Procedure: joystick-axis-event-pressed? e

 -- Procedure: make-joystick-ball-event timestamp
     which
     ball
     x-rel
     y-rel

 -- Procedure: joystick-ball-event? e
     Return #t if E is a joystick ball event.

 -- Procedure: joystick-ball-event-timestamp e

 -- Procedure: joystick-ball-event-which e

 -- Procedure: joystick-ball-event-ball e

 -- Procedure: joystick-ball-event-x-rel e

 -- Procedure: joystick-ball-event-y-rel e

 -- Procedure: make-joystick-hat-event timestamp which hat value

 -- Procedure: joystick-hat-event? e
     Return #t if E is a joystick hat event.

 -- Procedure: joystick-hat-event-timestamp e

 -- Procedure: joystick-hat-event-which e

 -- Procedure: joystick-hat-event-hat e

 -- Procedure: joystick-hat-event-value e

 -- Procedure: make-joystick-device-event timestamp which action

 -- Procedure: joystick-device-event? e
     Return #t if E is a joystick device event.

 -- Procedure: joystick-device-event-timestamp e

 -- Procedure: joystick-device-event-which e

 -- Procedure: joystick-device-event-action e

 -- Procedure: make-controller-axis-event timestamp which axis value

 -- Procedure: controller-axis-event? e
     Return #t if E is a game controller axis event.

 -- Procedure: controller-axis-event-timestamp e

 -- Procedure: controller-axis-event-which e

 -- Procedure: controller-axis-event-axis e

 -- Procedure: controller-axis-event-value e

 -- Procedure: make-controller-button-event timestamp
     which
     button
     pressed?

 -- Procedure: controller-button-event? e
     Return #t if EVENT is a game controller button event.

 -- Procedure: controller-button-down-event? e

 -- Procedure: controller-button-up-event? e

 -- Procedure: controller-button-event-timestamp e

 -- Procedure: controller-button-event-which e

 -- Procedure: controller-button-event-button e

 -- Procedure: controller-button-event-pressed? e

 -- Procedure: make-controller-device-event timestamp which action

 -- Procedure: controller-device-event? e
     Return #t if EVENT is a game controller device event.

 -- Procedure: controller-added-event? e
     Return #t if EVENT is a game controller device event with the 'added' action.

 -- Procedure: controller-removed-event? e
     Return #t if EVENT is a game controller device event with the 'removed' action.

 -- Procedure: controller-remapped-event? e
     Return #t if EVENT is a game controller device event with the 'remapped' action.

 -- Procedure: controller-device-event-timestamp e

 -- Procedure: controller-device-event-which e

 -- Procedure: controller-device-event-action e

 -- Procedure: poll-event

Rects
=====

     (use-modules (sdl2 rect))

 -- Procedure: make-rect X Y WIDTH HEIGHT
     Return a new rectangle whose upper-left corner is at (X, Y) and is WIDTH pixels wide and HEIGHT pixels high.

 -- Procedure: rect-x RECT
     Return the X coordinate of RECT.

 -- Procedure: rect-y RECT
     Return the Y coordinate of RECT.

 -- Procedure: rect-width RECT
     Return the width of RECT.

 -- Procedure: rect-height RECT
     Return the height of RECT.

Surfaces
========

     (use-modules (sdl2 surface))

 -- Procedure: color? c
     Return #t if C is a color.

 -- Procedure: color-r c

 -- Procedure: color-g c

 -- Procedure: color-b c

 -- Procedure: color-a c

 -- Procedure: palette? p
     Return #t if P is a palette.

 -- Procedure: palette-length palette
     Return the number of colors in PALETTE.

 -- Procedure: palette-colors palette
     Return the colors in PALETTE.

 -- Procedure: pixel-format? pf
     Return #t if PF is a pixel format.

 -- Procedure: pixel-format-name pf
     Return the symbolic name of the pixel format PF.

 -- Procedure: pixel-format-palette pf
     Return the palette for the pixel format PF.

 -- Procedure: pixel-format-bits-per-pixel pf
     Return the number of bits per pixel for the pixel format PF.

 -- Procedure: pixel-format-bytes-per-pixel pf
     Return the number of bytes per pixel for the pixel format PF.

 -- Procedure: pixel-format-red-mask pf
     Return the bitmask for the red component of a pixel in the pixel format PF.

 -- Procedure: pixel-format-green-mask pf
     Return the bitmask for the green component of a pixel in the pixel format PF.

 -- Procedure: pixel-format-blue-mask pf
     Return the bitmask for the blue component of a pixel in the pixel format PF.

 -- Procedure: pixel-format-alpha-mask pf
     Return the bitmask for the alpha component of a pixel in the pixel format PF.

 -- Procedure: make-rgb-surface width height depth
     Create a new SDL surface with the dimensions WIDTH and HEIGHT and DEPTH bits per pixel.

 -- Procedure: bytevector->surface bv width height depth pitch
     Convert BV, a bytevector of pixel data with dimensions WIDTHxHEIGHT, to an SDL surface.  Each pixel is DEPTH bits in size, and each row of pixels is PITCH bytes in size.

 -- Procedure: delete-surface! surface
     Free the memory used by SURFACE.

 -- Procedure: call-with-surface surface proc
     Call PROC, passing it SURFACE and deleting SURFACE upon exit of PROC.

 -- Procedure: load-bmp file
     Create a new surface from the bitmap data in FILE.

 -- Procedure: surface-width surface
     Return the width of SURFACE in pixels.

 -- Procedure: surface-height surface
     Return the height of SURFACE in pixels.

 -- Procedure: surface-pitch surface
     Return the length of a row of pixels in SURFACE in bytes.

 -- Procedure: surface-pixels surface
     Return a bytevector containing the raw pixel data in SURFACE.

 -- Procedure: surface-pixel-format surface
     Return the pixel format for SURFACE.

 -- Procedure: convert-surface-format surface format
     Convert the pixels in SURFACE to FORMAT, a symbol representing a specific pixel format, and return a new surface object.

     Valid format types are:

       * index1lsb

       * index1msb

       * index4lsb

       * index4msb

       * index8

       * rgb332

       * rgb444

       * rgb555

       * bgr555

       * argb4444

       * rgba4444

       * abgr4444

       * bgra4444

       * argb1555

       * rgba5551

       * abgr1555

       * bgra5551

       * rgb565

       * bgr565

       * rgb24

       * bgr24

       * rgb888

       * rgbx8888

       * bgr888

       * bgrx8888

       * argb8888

       * rgba8888

       * abgr8888

       * bgra8888

       * argb2101010

       * yv12

       * iyuv

       * yuy2

       * uyvy

       * yvyu

 -- Procedure: blit-surface SRC SRC-RECT DST DST-RECT
     Blit the rectangle SRC-RECT from the surface SRC to DST-RECT of the surface DST.

 -- Procedure: blit-scaled SRC SRC-RECT DST DST-RECT
     Blit the rectangle SRC-RECT from the surface SRC to DST-RECT of the surface DST, scaling the source to fit the destination.

 -- Procedure: fill-rect DST RECT COLOR
     Fill RECT with COLOR, a 32-bit color encoded as an integer value, in the surface DST.

Rendering
=========

     (use-modules (sdl2 render))

 -- Procedure: make-renderer window
     [#:optional flags='(accelerated vsync)]
     Return a new renderer for WINDOW created with the options specified in FLAGS, a list of symbols.  The valid symbols that may appear in FLAGS are:

       * software, to use a software renderer fallback

       * accelerated, to use hardware acceleration

       * vsync, to synchronize rendering with the monitor's refresh rate

       * texture, for render to texture support

 -- Procedure: renderer? r
     Return #t if R is a renderer.

 -- Procedure: delete-renderer! renderer
     Delete the rendering context RENDERER.

 -- Procedure: call-with-renderer renderer proc
     Call PROC, passing it RENDERER and closing RENDERER upon exit of PROC.

 -- Procedure: clear-renderer renderer
     Clear the rendering target RENDERER with the current drawing color.

 -- Procedure: present-renderer renderer
     Display RENDERER.

 -- Procedure: render-copy renderer
     texture
     [#:angle 0]
     [#:srcrect]
     [#:dstrect]
     [#:center]
     Copy TEXTURE to the rendering target of RENDERER.

 -- Procedure: render-draw-line renderer x1 y1 x2 y2
     Draw a line from (X1, Y1) to (X2, Y2) on the current rendering target of RENDERER.

 -- Procedure: render-draw-point renderer x y
     Draw a point at (X, Y) on the current rendering target of RENDERER.

 -- Procedure: surface->texture renderer surface
     Convert SURFACE to a texture suitable for RENDERER.

Images
======

     (use-modules (sdl2 image))

 -- Procedure: image-init
     Initialize dynamically loaded image libraries.

 -- Procedure: image-quit
     Clean up dynamically loaded image libraries.

 -- Procedure: load-image file
     Load the image in FILE and return an SDL surface.

 -- Procedure: save-png surface file
     Save SURFACE to FILE as a PNG formatted image.

Sound
=====

     (use-modules (sdl2 mixer))

 -- Scheme Variable: %default-frequency

 -- Scheme Variable: %default-format

 -- Scheme Variable: %default-chunk-size

 -- Procedure: mixer-init [#:optional formats='(flac mod modplug mp3 ogg fluidsynth)]
     Initialize mixer library with support for FORMATS, a list of symbols representing audio file formats.  Possible formats are:

       * flac

       * mod

       * modplug

       * mp3

       * ogg

       * fluidsynth

 -- Procedure: mixer-quit
     Shutdown mixer library.

 -- Procedure: open-audio [#:frequency=%default-frequency]
     [#:format=%default-format]
     [#:stereo?=#t]
     [#:chunk-size=%default-chunk-size]
     Initialize the mixer API.  FREQUENCY specificies the sample rate in hertz.  When STEREO? is #t, two output channels are used, otherwise mono output is used instead.  CHUNK-SIZE specifies the number of bytes used per output sample.  FORMAT is a symbol that specifies the output sample format.  Possible values are:

       * u8

       * s8

       * u16lsb

       * s16lsb

       * u16msb

       * s16msb

       * u16

       * s16

       * s32lsb

       * s32msb

       * s32

       * f32lsb

       * f32msb

       * f32

 -- Procedure: close-audio
     Shut down the mixer API.

 -- Procedure: chunk? c
     Return #t if C is a chunk.

 -- Procedure: load-chunk file
     Load the audio data in FILE and return an audio chunk.

 -- Procedure: delete-chunk! chunk
     Free the memory used for CHUNK.

 -- Procedure: set-chunk-volume! chunk volume
     Set the loudness of CHUNK to VOLUME, an integer in the range [0,128].  Return the previous chunk volume setting.

 -- Procedure: play-chunk! chunk
     [#:loops=0]
     [#:channel]
     Play CHUNK on CHANNEL, an integer channel identifier or #f to use the first unreserved audio channel.  CHUNK will play LOOPS + 1 times.  Return the channel identifier that CHUNK is played on.

 -- Procedure: set-channel-volume! channel volume
     Set the loudness of CHANNEL, an integer channel identifier or #f for all channels, to VOLUME, an integer in the range [0,128].  Return the previous volume of CHANNEL, or the average of all channels if CHANNEL is #f.

 -- Procedure: pause-channel! channel
     Pause playback on CHANNEL, an integer channel identifier, or #f to pause all channels.

 -- Procedure: resume-channel! channel
     Resume playback on CHANNEL, an integer channel identifier, or #f to resume all channels.

 -- Procedure: stop-channel! channel
     Halt playback on CHANNEL, an integer channel identifier, or #f to halt all channels.

 -- Procedure: channel-playing? channel
     Return #t if CHANNEL is playing.

 -- Procedure: playing-channels-count
     Return the number of channels currently playing.

 -- Procedure: channel-paused? channel
     Return #t if CHANNEL is paused.

 -- Procedure: paused-channels-count
     Return the number of channels that are paused.

 -- Procedure: music? m
     Return #t if M is music.

 -- Procedure: load-music file
     Load music from FILE.

 -- Procedure: delete-music! music
     Delete the memory used for MUSIC.

 -- Procedure: play-music! music [#:optional loops=1]
     Play MUSIC, repeated LOOPS times.  LOOPS may be #f, in which case the music loops indefinitely.

 -- Procedure: set-music-volume! volume
     Set music loudness to VOLUME, an integer in the range [0,128].  Return the previous volume.

 -- Procedure: music-volume
     Return the music volume.

 -- Procedure: pause-music!
     Puase the music.

 -- Procedure: resume-music!
     Resume music playback.

 -- Procedure: rewind-music!
     Start music playback from the beginning.  Rewinding is only supported for MOD, OGG, MP3, and native MIDI music.

 -- Procedure: stop-music!
     Halt music playback.

 -- Procedure: music-playing?
     Return #t if music is currently playing.

 -- Procedure: music-paused?
     Return #t if music is currently paused.

Fonts
=====

     (use-modules (sdl2 ttf))

 -- Procedure: ttf-init
     Initialize the TTF system.

 -- Procedure: ttf-quit
     Shut down and clean up the TTF system.

 -- Procedure: load-font file point-size
     Load TTF font from FILE and return a new font object whose glyph size is POINT-SIZE.

 -- Procedure: delete-font! font
     Delete the memory allocated for FONT.

 -- Procedure: font-height font
     Return the maximum height of FONT.

 -- Procedure: render-font-solid font text color
     Render TEXT, a UTF-8 encoded string, using FONT and COLOR, the foreground color, and return a surface containing the results.

 -- Procedure: render-font-blended font text color
     Render TEXT, a UTF-8 encoded string, using FONT and COLOR, the foreground color, and return a high-quality alpha-blended surface containing the results.