Features in SDL for touchscreen devices
Sergiy Pylypenko <x.pelya.x <at> gmail.com>
2010-10-01 09:10:36 GMT
Hi
When developing Android libSDL port I've added there two features that might be useful
for other ports to mobile platforms (thinking of iPhone mainly):
Resize application to the device screen - i.e. get the app that works only in 320x200 resolution,
and make it stretch video to variety of screen sizes by adding #define when compiling SDL.
My implementation only works with OpenGL ES renderer currently (and I don't think it will be
of any use to platforms other than mobile devices).
On-screen keyboard - basically it will intercept mouse events and send keyboard events instead
when you click on screen area where button should be, plus it will draw overlay buttons inside SDL_Flip().
Each game requires it's own key configuration, so the keyboard is tuned with another set of #defines,
but I consider that better than messing up with the internal game UI and input routines.
The implementation is also works only with OpenGL ES, is not portable and the code needs cleanup,
but that's not hard to do.
An example of that on-screen keyboard can be found on Android Market - check out OpenTyrian or
Ur-Quan Masters game (the graphics may need touch up, and keys sometimes stuck, you may also enjoy
my very first effort by selecting keyboard theme named "Ugly Arrows by pelya").
So, what do you think about porting that features to SDL HG? The majority of games around
uses SDL 1.2, and if you'll develop new game for SDL 1.3 I assume you'll design it touchscreen-friendly
from the very start, so the features will benefit mainly SDL 1.2 branch, but it's kinda frozen.
I'll prepare patches on the request.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org