SDL Wrappers for Euphoria version 1.2.6

January 25, 2004

Mark K. Akita - mkakita@earthlink.net


Introduction

This is an update to the SDL wrappers for the Euphoria programming language for SDL version 1.2.6. SDL is short for Simple DirectMedia Layer, a library for programming games and multimedia applications that includes functions for graphics, sounds, controllers (joystick/mouse/keyboard) and CD audio.  The SDL wrapper file makes the SDL library functions accessible form Euphoria, and was converted from a C header file.  I started the SDL/Euphoria project after trying various graphics/game libraries, such as Neil, OpenPTC, Allegro and Exotica.  Most offered improvements over plain vanilla Euphoria and I drew inspiration from those libraries when converting the SDL headers.  I'll continue updating the wrapper as SDL evolves and converting more of the useful ancillary SDL libraries.

SDL was written by Sam Lantinga and is distributed under the GNU Lesser Public License.
The official SDL website http://www.libsdl.org contains more information both general and specific.
 

Programs and Files

The following files are included with this SDL wrapper package:
Readme.txt - this file in plain text form
Readme.html - this file in HTML form
SDL.dll - The SDL dynamic link library
Sdl_Wrap.ew - The Euphoria wrapper include file
Blur.exw - Demonstrate a mouse commands and simulate motion blur.
CD_Test.exw - Play the first track on an audio CD.
Fireworx.exw - A demo program that simulates a pyrotechnic display.
Life_SDL.exw - A Graphic demo program based on John Conway's classic cellular automata.
Plasma1.exw - A colorful graphic demo based on pixel averaging.
Thread2.exw - A  test of the thread functions.
Timer2.exw - A test of the timer functions.
BITMAPS - a folder containing the bitmap images used by the demo programs

Feel free to use the SDL_WRAP file in your own projects.  If you write a game or application program that includes the SDL_WRAP.EW file, make sure to credit me (Mark K. Akita) somewhere in the help, docs or "about" screen.
 

Writing your own SDL programs in Euphoria

You'll need a moderate amount of Euphoria programming knowledge to use the SDL library in your own programs.  You can get a copy of the complete SDL documentation from http://sdldoc.csn.ul.ie/pub/ in PDF or HTML form.  The SDL docs contain descriptions of all the functions and examples in C.  You can also study the included demo programs for specific examples of how to call the various SDL functions from Euphoria.  The demos don't use every available SDL function but should provide a basic framework for creating programs.  SDL programs written in Euphoria are for the Win32 OS rather than DOS and should have an EXW extension.  All of the SDL functions called through SDL_WRAP use a standard Euphoria function call rather than a C_PROC or C_FUNC call.  Euphoria PEEK and POKE functions are used to simulate C structures. Nearly all of the SDL functions included in the wrapper are working.  The notable exception is audio, which I haven't been able to create a functional example for.
 

What else?

Check out the Euphoria archive for the SDL_mixer (music and sound) , SDL_image (load gif, jpg, and other image formats), and Font_SDL (render bitmap fonts) libraries.  The games "Dragon Blast", "Hexy" and "Conquest 2" were also written using SDL.    I'm currently working on Euphoria headers for the SDL_ttf library (render TrueType fonts) and the SDL_gfx library (drawing functions), and an updated version of the SDL/OpenGL demos..

Send comments & feedback to mkakita@earthlink.net