8.4.4. SDL: Simple DirectMedia Layer

Author(s): Yann LeCun

Lush's interface to the popular SDL library provides access to every function of the SDL API. It also provides a set of higher-level classes to make it easy to write 2D video games and other interactive multimedia applications. The high-level interface provides classes for double-buffered SDL screens, event grabbing, and sprites with pixel-accurate collision detection.

The help text associated with each low-level function is from the corresponding .h header file that comes with SDL. If you installed libSDL1.2-devel with RPM, you may find the API documentation in file:/usr/share/doc/libSDL1.2-devel-1.2.3/index.html Otherwise, the documentation is available at http://www.libsdl.org

The Tutorial section of the Lush manual contains a tutorial on how to write simple video games with Lush and SDL. Tutorial: Writing Games with Lush and SDL. Installing SDL

To make the SDL interface work with Lush, you need:

Those are generally available as RPMs or APTs for most Linux distributions. Otherwise, you can download the latest version from http://www.libsdl.org

By default, Lush looks for the SDL .so libraries in "/usr/lib". It expects to find "libSDL-1.2.so.0" and "libSDL_image-1.2.so.0". If these libraries are installed someplace else on your system, you must edit packages/sdl/sdl-config.lsh. SDL Demos Low-Level Interface to SDL sdl/SDL.lsh sdl/SDL_active.lsh sdl/SDL_audio.lsh sdl/SDL_byteorder.lsh sdl/SDL_cdrom.lsh sdl/SDL_endian.lsh sdl/SDL_error.lsh sdl/SDL_events.lsh sdl/SDL_getenv.lsh sdl/SDL_image.lsh sdl/SDL_joystick.lsh sdl/SDL_keyboard.lsh sdl/SDL_keysym.lsh sdl/SDL_mouse.lsh sdl/SDL_mutex.lsh sdl/SDL_rwops.lsh sdl/SDL_syswm.lsh sdl/SDL_thread.lsh sdl/SDL_timer.lsh sdl/SDL_version.lsh sdl/SDL_video.lsh