Android port progress, multitouch module

Yesterday I finally got a couple of important things working regarding BennuGD on Android:
First of all, the guys working on SDL workarounded what appears to be a bug in Android that caused APK resource loading to fail, so now you can just package your game's resources into the APK and directly load them from there. There's nothing special you have to do from your BennuGD code. Up until now you'd had to use resources found in the user's SD card, which isn't particularly useful...

Another important thing is multitouch support: Yesterday I created a module to support multitouch. It's based in SDL 1.3 so it should work in both iOS & Android (and on desktops too, if you're still using that sort of devices :P), although I have just tested it in Android. It's still quite buggy but it's working. You can see a very simple preview of how it's working (the sample has some background music although I'm not sure it can be heard in the video) below:

The video is pretty crappy, but you get the idea.
Also, touch sensitivity is better than it looks like in the video.

Those are two very important things to have working for a game engine running on Android so I'm quite happy to see them working.

As per the work left regarding the Android port of BennuGD before we can call it a release, the list of things to do goes as follows:
  • Fix image loading: The colormode for PNG loaded images is not working as expected (yet). Not sure about other formats.
  • Handle rotation: The programmer should have a way to control how they want the phone to respond to rotations when their game is working.
  • I believe that right now we don't have a way to know when the app is in second plane->let the programmer know it through mod_wm.
  • Fix set_mode. Right now the video mode is set for you to your device's default resolution and, if you call set_mode again, Bennu crashes.
  • learn where the programmer must keep their persistent data.
  • [Update mod_chipmunk+compile mod_sqlite3 in].
  • Test it!
Get your little green devices ready because BennuGD is coming!

Advance

I just made an interesting commit (if you're into commits, that is) to my branch with changes related to SDL 1.3 support. Main changes are:
  • Finally got rid of the SDL compat layer! (I'm still using it for the mod_key/libkey modules, but I'm not compiling those for the devices).
  • Updated sample bennugd code to include a bouncing PNG.
  • Modes set with scale_resolution and normal seem to redraw the screen fine (although the screen pixel format is not yet correct).
  • Orientation is starting to get set automatically now (there are things to fix yet, though). If width>height, the iOS device will default to a landscape configuration.
  • Other minor changes.
As you might know, in order to use SDL (upon which BennuGD relies) in iOS and Android platforms, you have to use SDL 1.3*, which is the development version of SDL and includes a somewhat major API breakage as compared to SDL 1.2. SDL provides a very buggy 1.2 <-> 1.3 compatibility layer which I just got rid of. Getting rid of it and using the new code allows for better integration with the new platforms and allows us to implement things not possible in SDL 1.2 like multitouch, multi-monitor support, advanced UTF-8 input support....
There are still some bugs I must fix before releasing a new binary, but things are progressing nicely.
When I release the new binary it will most probably also include a new version of mod_chipmunk and maybe a module for handling multitouch that I just began drafting a few days ago.

* Unless you want to use unofficial versions of SDL 1.2, which I don't for different reasons.

Blog Archive