Work in Progress: Bringing T-Engine 4 to iOS and Android
Posted: Wed Apr 11, 2012 10:59 pm
Hello all! In what little spare time I have these days I'm investigating what it will take to bring TE4 to mobile platforms, specifically tablets (although a phone works in a pinch
). I'm making this post to condense my findings on the topic and share with anyone else who may be interested.
iOS
I've rebuilt all the engine's dependent libraries (SDL-1.3+, sdl_ttf, sdl_mixer, sdl_image, THEIR dependencies, etc) from source, mostly from the latest releases with darkgod's additions foward ported as needed. Important note: top-of-trunk SDL contains new mobile-specific functionality for both graphics and the touch interface that will have a place in new T-Engine code.
While most of the libraries build "out-of-the-box" using Xcode 4.3.1 but you'll need to download a GLu replacement for OpenGL ES at least: http://code.google.com/p/glues/.
Apple won't allow LuaJit to run under iOS, but either the interpreted version or the standard Lua engine should work fine. I'm using the standard implementation because I figure it is more likely to work
Here are the final linking issues I've hit during the engine build:
- The latest versions of PhysFS (not the one included with the t-engine source) contains iOS support, but some custom work from the engine had to be ported in due to the newer version missing those symbols required by the engine.
- OpenGL ES also does not provide the following functions.. but, here are the fixes!
glOrtho: http://stackoverflow.com/questions/7131 ... z-values-f
glClearDepth: http://stackoverflow.com/questions/4704 ... ng-problem
glPush/PopAttrib: http://stackoverflow.com/questions/4657 ... -opengl-es
- Many symbols exported in SDL_compat.h are missing. Issues in the compatibility layer aren't unexpected, but I haven't had time to look into these:
SDL_WM_ToggleFullScreen
SDL_SetAlpha
SDL_ListModes
SDL_SetGamma
SDL_WM_SetCaption
SDL_EnableRepeatKey
I've also been able to package the engine's requisite file structure and I don't think there will be any issues there. Adding additional TE4 modules (ie InfiniteRoad) once the app is installed on a device would require the device to be jailbroken (!). Save games are large, yes, but iPads start at 16GB... plus there's always iCloud
Android
I haven't really started on this side of things, but the process is similar to iOS. Use the Android NDK to build everything. It provides a mechanism for native-only applications, so a Java wrapper isn't a strict requirement. The OpenGL ES and SDL issues apply to Android as well as iOS. I haven't looked at Android support in PhysFS yet.
Happy hunting!

iOS
I've rebuilt all the engine's dependent libraries (SDL-1.3+, sdl_ttf, sdl_mixer, sdl_image, THEIR dependencies, etc) from source, mostly from the latest releases with darkgod's additions foward ported as needed. Important note: top-of-trunk SDL contains new mobile-specific functionality for both graphics and the touch interface that will have a place in new T-Engine code.
While most of the libraries build "out-of-the-box" using Xcode 4.3.1 but you'll need to download a GLu replacement for OpenGL ES at least: http://code.google.com/p/glues/.
Apple won't allow LuaJit to run under iOS, but either the interpreted version or the standard Lua engine should work fine. I'm using the standard implementation because I figure it is more likely to work

Here are the final linking issues I've hit during the engine build:
- The latest versions of PhysFS (not the one included with the t-engine source) contains iOS support, but some custom work from the engine had to be ported in due to the newer version missing those symbols required by the engine.
- OpenGL ES also does not provide the following functions.. but, here are the fixes!
glOrtho: http://stackoverflow.com/questions/7131 ... z-values-f
glClearDepth: http://stackoverflow.com/questions/4704 ... ng-problem
glPush/PopAttrib: http://stackoverflow.com/questions/4657 ... -opengl-es
- Many symbols exported in SDL_compat.h are missing. Issues in the compatibility layer aren't unexpected, but I haven't had time to look into these:
SDL_WM_ToggleFullScreen
SDL_SetAlpha
SDL_ListModes
SDL_SetGamma
SDL_WM_SetCaption
SDL_EnableRepeatKey
I've also been able to package the engine's requisite file structure and I don't think there will be any issues there. Adding additional TE4 modules (ie InfiniteRoad) once the app is installed on a device would require the device to be jailbroken (!). Save games are large, yes, but iPads start at 16GB... plus there's always iCloud

Android
I haven't really started on this side of things, but the process is similar to iOS. Use the Android NDK to build everything. It provides a mechanism for native-only applications, so a Java wrapper isn't a strict requirement. The OpenGL ES and SDL issues apply to Android as well as iOS. I haven't looked at Android support in PhysFS yet.
Happy hunting!
