Package sdl.test

Demos and unit tests that illustrate the use of JSDL.


Class Summary
Config returns resource directory holding images, sounds, etc..
TestAlpha Demo of alpha blending with JSDL.
TestAnim Demo of sprites with JSDL.
TestAnim2 TestAnim with AlphaBlending
TestAudio Plays different sounds based on Keyboard events.
TestBlit Shows basic bit blitting
TestColorKeys Shows effects of setting color key
TestConvertSurface Shows converting one surface to another.
TestCool Demo of Sprites and MP3 audio playback.
TestEvent Prints out mouse and keyboard input events on the current SDL surface.
TestFillRect Demo of native Surface.fillRect(...) method.
TestImage Shows we can load an image.
TestKeyboard Monitors keyboard events
TestMpegAudio Demonstrates playing of an MP3 file using SMPEG for SDL
TestMpegVideo Demonstrates playing of an MP3 file using SMPEG for SDL
TestSimple Verify basic video surface stuff works.
TestUserEvent Shows custom user defined SDLUserEvent in action.
TestVideo Demo of creating a surface and setting the video mode.
TestVideo2 Demo of direct pixel access to create a small window with a gradient color fill.
TestVideo3 Demo of direct pixel access to draw 5 vertical lines on the screen.

Package sdl.test Description

Demos and unit tests that illustrate the use of JSDL.

copy of local README file in $JSDL_BASE/sdl/test

Unit Tests

This directory contains a set of unit tests that verify the functionality
of the existing api.  These tests also serve as simple demos illustrating
the use of the JSDL api.

There is a quick and dirty script to run these at the bottom of this file.


make sure all the necessary JSDL libraries/classes have been built.
(cd $JSDL_BASE; ant)

Then you can modify /test each example in place. 

javac  -classpath .:$JSDL_BASE

Each example needs to be run relative to the package root "sdl.test"
The JSDL shared library must be in the "java.library.path".

cd ../..
java  -Djava.library.path=$JSDL_BASE:/usr/lib -classpath .:$JSDL_BASE/build sdl.test.${1}

SEE the bottom of this document for a quick and dirty test script.

Dependencies - sounds and images

Some of these examples load image or sound files.  Assuming $JSDL_BASE
is set to the directory where the jsdl sources were extracted,

$JSDL_BASE/sdl/test  - These java examples (
$JSDL_BASE/C 	     - The sound and image files used by the java examples

Since some of the sound and image paths have been  hardcoded,  it will be 
necessary to update some of these examples to your current directory
structure. This will be obvious when you get "FileNotFoundException"

Assuming you are too lazy to install ant on your system, 
here's a basic shell script to  compile and run each example from this 
directory.  To run, simply 
1. copy this to 
2. chmod +x
3. do "./ TestXXX" where TestXXX is one of the examples
(do not add ".java", ./ wont work)

### cut here ####

javac  -classpath .:$JSDL_BASE ${1}.java
cd ../..
java  -Djava.library.path=$JSDL_BASE:/usr/lib -classpath .:$JSDL_BASE/build sdl.test.${1}