Didj and Explorer libSDL

libSDL is a popular library for games and other applications. It provides APIs for events (buttons, etc), graphics, sound, and more.

Note: A framebuffer driver is required.

 Build the library 

To build SDL, first download and unpack it:

You'll need a toolchain, for example this one

Now try the following, but replace the "/path/to" lines with paths on your system. You'll want to tell the build system where to install libSDL and where to look for kernel headers

If that succeeds, try building and installing:

You should see libSDL.so in usr/lib in your rootfs directory as well as its header files in "usr/include". When building applications against libSDL, tell the compiler to look for headers and the linker to look for libraries there (ie: CFLAGS="-I/path/to/rootfs/usr/include" and LDFLAGS="-L/path/to/rootfs/usr/lib").

 Set up the device 

Copy the .so files and symlinks to your device. Also edit "/etc/profile" on your device and add some environment variables for SDL:

For Didj:

export SDL_NOMOUSE=1 export SDL_FBDEV="/dev/fb0" export SDL_VIDEODRIVER="fbcon" export SDL_AUDIODRIVER="dsp" export SDL_PATH_DSP="/dev/dsp" export SDL_DEBUG="1" export SDL_FBACCEL="0"

For Explorer, the touchscreen works sort of like a mouse (TODO: add tslib support?), so you could try:

export SDL_MOUSEDEV="/dev/input/event3" export SDL_FBDEV="/dev/fb0" export SDL_VIDEODRIVER="fbcon" export SDL_AUDIODRIVER="dsp" export SDL_PATH_DSP="/dev/dsp" export SDL_DEBUG="1" export SDL_FBACCEL="0"

You'll need to source that on your device:

. /etc/profile

or just reboot. You should now be able to run SDL programs or demos as long as your device is set up with a standard Linux framebuffer and console in place of the LeapFrog-supplied graphics drivers.

TODO

* better audio support? * tslib to make touchscreen usable on Explorer?