This is yet another touch-screen sample program.  Why did I make this when
there are already a couple out there?  Looking at the other sample code,
I thought the touch screen was harder to use than it is.  It's actually
very easy, which this code hopefully illustrates.

This code is in plain C and uses SDL's mouse routines to talk to the
touch screen -- thus touchscreen code can be tested on a PC with a mouse.
It can be dynamically linked with the official GP2X SDK to produce a small
binary that works on either the F100 or the F200 with GPH firmware. See
build.sh for the required commands.  I have tested the resulting program
on an F100 with firmware 2.0.0 and an F200 with firmware 4.0.0.  On the
F100, the program simply doesn't get mouse events.  Everything else works
as expected.  I have not tested the dynamic executable on Open2x firmware.

You can build the sample program using the Open2x toolchain, and it will
work _if dynamically linked_.  But the Open2x developers do not guarantee
that any dynamic executable built for Open2x will work on GPH firmware,
and there are dynamically linkable libraries included in Open2x that
aren't available on GPH firmware.  I have included an example of dynamic
linking with Open2x in build.sh.  The resulting binary works just as well
on the F200 and F100 as the one build using the official SDK.  But be
careful what libraries you use if you try this in your own projects.

Some developers prefer to statically link their programs to avoid any
problems with library incompatibility.  Unfortunately the version of
SDL in the current stable Open2x libpack (20071903) doesn't support the
touchscreen as used in this example.  I hope that will change at some
point, so build.sh also demonstrates static linking with Open2x.  A binary
built this way will not see mouse events from the touchscreen, though.

If I could claim any copyright on this code, I hereby disclaim it
and place the code in the public domain.  Some of the code is based
on previous touch screen sample code.  The Bitstream Vera Sans font
is included in vera.ttf and is covered by the copyright license in
font_license.txt.

I hope you find this helpful.

Micah Stetson
micah@stetsonnet.org
June 1, 2008
