Hi!
Some days ago, I've found some time to begin a Raydium port for the iPhone OS.
This add-on, to the files included within the Raydium Mac OS X SDK, requires an installed iPhone SDK from Apple. You should also be able to use another cross-compilation build environment. It supports iPhone OS 2.0 or higher and was tested in the iPhone simulator, on an iPhone 2G, 3G and 4G ... errr no, not yet on 4G.
The initial idea is to create a complete Raydium SDK for the iPhone OS or perhaps to merge with the Mac OS X SDK to an all-round Apple SDK.
The graphics hardware behind the iPhone and iPod Touch is a PowerVR MBX Lite:
- There is no stencil or accumulation buffer.
- There are only two texture units.
- The maximum texture size is 1024×1024 (use power of two only).
- The maximum space for textures and surfaces is 24MB.
- Only 2D textures are supported.
- There is no software rendering fallback.
iPhone 2G debug session wrote:
Raydium: Raydium 3D Game Engine
Raydium: version 0.800
Raydium: command line args: OK
Raydium: chdir to './': OK
Raydium: using '/var/root/.raydium' as home dir
Raydium: Requesting 480x320:32 mode
Raydium: (my)glut: -> pwInit
Raydium: (my)glut: UIApplication
Raydium: (my)glut: UIWindow
Raydium: (my)glut: UIView
Raydium: (my)glut: <- pwInit
Raydium: using PowerVR MBXLite with VGPLite, from Imagination Technologies (version OpenGL ES-CM 1.1 (30.7))
Raydium: Signal Handlers: OK
Raydium: OpenGL extensions: OK
Raydium: Platform "4xfloat" vector size is: 16 byte(s) long
Raydium: OpenGL implementation maximum texture size: 1024x1024
Raydium: OpenGL hardware providing 2 texture unit(s), Raydium deals with 2
Raydium: OpenGL anisotropy max level is 2.00
Raydium: vertex arrays memory: OK
Raydium: path: OK
Raydium: keyboard: OK
Raydium: mouse: OK
Raydium: sound: Buffer creation successfull
Raydium: sound: OK, using 'default device'
Raydium: PHP R3S Scripts: rayphp
Raydium: PHP support: OK
Raydium: atexit functions: OK
Raydium: lights: OK
Raydium: fog: OK
Raydium: Sky: OK
Raydium: objects: OK
Raydium: network: OK
Raydium: timer: detection: 1 iterations: diff: 5 steps (1000000/sec)
Raydium: timecall: method accuracy = 0.5 ms (200000.00 Hz)
Raydium: timecall: Using basic gettimeofday() method
Raydium: timecall: OK (200000 Hz)
Raydium: timecall: softcall 0: 1 Hz (1000000 clocks interval)
Raydium: particle: OK
Raydium: gui: OK
Raydium: video (live): OK
Raydium: shadow: OK
Raydium: HDR: OK
Raydium: shaders: FAILED (GLSL 1.0 not found)
Raydium: webserver: OK
Raydium: Raydium engine reseted to original state
Raydium: timecall: callback 1: 400 Hz (2500 clocks interval)
Raydium: physics: ODE Net: 10 element(s)/packet
Raydium: physics: OK
Raydium: RegAPI: OK
Raydium: Engine is now ready.
-----------------------------------------------------------
Raydium: Tex. num 1 (BOXfront.tga) loaded: 512x512, 3 Bpp (b0 lm0 hdr0 fx0 fy0)
Raydium: Tex. num 2 (BOXback.tga) loaded: 512x512, 3 Bpp (b0 lm0 hdr0 fx0 fy0)
Raydium: Tex. num 3 (BOXleft.tga) loaded: 512x512, 3 Bpp (b0 lm0 hdr0 fx0 fy0)
Raydium: Tex. num 4 (BOXright.tga) loaded: 512x512, 3 Bpp (b0 lm0 hdr0 fx0 fy0)
Raydium: Tex. num 5 (BOXbottom.tga) loaded: 512x512, 3 Bpp (b0 lm0 hdr0 fx0 fy0)
Raydium: Tex. num 6 (BOXtop.tga) loaded: 512x512, 3 Bpp (b0 lm0 hdr0 fx0 fy0)
Raydium: WARNING: timecall's too long
Raydium: (my)glut: -> glutSwapBuffers
Raydium: (my)glut: UIView
Raydium: (my)glut: UIWindow
Raydium: (my)glut: <- glutSwapBuffers
...
But don't expect to much from the current state of the port. The good thing is, that I've figured out all needed dependencies and they are ready to use now. That wasn't a really pleasant job to do, but here's a list of the ARM architecture based appended dependency package: [1]
iPhone OS dependency list wrote:
FreeALUT 1.1.0
http://openal.org/Build options: --disable-shared
Cal3D 0.11.0
http://home.gna.org/cal3d/Build options: --disable-shared --enable-static
cURL 7.16.3
http://curl.haxx.se/Build options: --disable-shared --disable-crypto-auth --without-gnutls --without-ssl --without-zlib --without-libssh2 --disable-ipv6 --disable-manual --disable-telnet --disable-tftp --disable-ldap --disable-file --disable-ftp
GLEW 1.5.0
http://glew.sf.net/Build options: default
iGLU 1.0.0
http://code.google.com/p/iphone-glu/Build options: default
libIntl from GetText 0.17
http://gnu.org/Build options: --disable-shared --disable-java --disable-native-java --disable-csharp --without-emacs
JPEG 6b
http://ijg.org/Build options: --disable-shared
ODE 0.10.0
http://ode.org/Build options: --disable-shared --disable-double-precision --disable-demos
libOgg 1.1.3
http://xiph.org/Build options: --disable-shared
PHP 5.2.6
http://php.net/Build options: --disable-shared --enable-embed=static --with-zlib --enable-ftp --enable-static=zlib --with-curl --disable-simplexml --disable-xmlreader --disable-xmlwriter --enable-soap --without-iconv
libVorbis 1.2.0
http://xiph.org/Build options: --disable-shared --disable-docs --disable-oggtest
All other needed things are included in the iPhone SDK, like e. g. the OpenGL ES framework.
The bad thing is the overall status. When you build and run ManiaDrive for instance, you will get not more as a really heavy sized OGG/Vorbis player for now. Year, you can really hear music from that little Apple devices, no joke!
This means that the Raydium application starts up in fullscreen mode, the screen is rotated to landscape, where the home button is right, the engine will then be started and is ready to use. The problem is, that I've "#ifndef __arm__ #endif" all positions with undefined symbols. All these positions were marked with this message as a comment in the source code: "// Not available in OpenGL ES (...).". Here is a list, which includes the symbols that have to be replaced with OpenGL ES specific functions:
Undefined symbols for OpenGL ES wrote:
glLightModeli
glTexCoord2f
glBegin
glGenLists
glEnd
glPolygonMode
glVertex3f
glCallList
glGetTexLevelParameteriv
glTexGeni
glColor4fv
glEndList
glOrtho
glFogi
glTexGenfv
glNewList
glGetDoublev
There is also one GLU function missing in iGLU for now, which is not supported yet:
Undefined symbol for iGLU wrote:
gluBuild2DMipmaps
I'm posting here at this incomplete state of the port, because I currently haven't much time to get this fully completed. I'm appending files of the current state, so anybody interested is pleased to play with this to get this hopefully done. I'll continue on this, when the time allows me to, for sure!
All modifications on the engine are included in a Raydium patch for Subversion revision 824. [2]
I've also created some helper scripts, which will assist you on building and running the application on your environment. The package also includes a ready to use application template with information and image files. [3]
[1]
Raydium-R824-iPhoneOS-Dependencies-ARM.tar.gz (12MB)
[2]
Raydium-R824-iPhoneOS-Patch.gz (9KB)
[3]
Raydium-R824-iPhoneOS-Additions.tar.gz (56KB)
Best regards,
st