Monday, November 20, 2006

New screenshot of irrlicht symbian port


Time to release a new screenshot and a video clip. Now the scene becomes more interesting. It's a Quake3 map with two animated faeries. This roughly corresponds the Collision example included in the irrlicht engine. In addition, the user can navigate in the small castle scene.

The video clip you can download here.

(Note: currently in the mirrlicht subversion depot on google code, I use a different animated figure, a monkey. The reason is: under the default setting of the emulator, the RAM is 32M. After loading the quake3 map, the faerie model can't be loaded due to memory constraint. If you want to load the faerie model, you have to adjust the emulator's setting. I've tested 48M. It works fine.)

Tuesday, November 14, 2006

Porting irrlicht to Symbian platform.


Recently, I'm trying to port a popular open-source graphics engine irrlicht onto mobile platforms. The first target is nokia's S60. Some preliminary results have been achieved. Have a look! (Screen shot, Video clip).

Latest source code can be download here with a subversion client tool. The trunk contains the ported code and synced with revision 301(13.11.2006) of the sourceforge svn depot of irrlicht. A sync branch under "branches" serves as a bridge for merging with the irrlicht depot. In the directory "source/irrlicht", there are two symbian projects generated by CarbideVS. The first one is mirrlicht(the directory name is Symbian), which contains irrlicht compiled as a dll and a helloworld example exe. It currently doesn't work (simply crashes the emulator) since I haven't figured out how to use dlls on Symbian platform. The second one is symbirrlicht. It's compiled as a monolithic exe consisting of the ported irrlicht source code and the hello world sample code. The screenshot and videos are generated by this project.

Since no STL is used in irrlicht and the software structure also lends itself to easy extending, the porting goes rather smoothly. I've spent only several days before getting the first results (including fighting with Symbian dev platform coz I'm a newbie of it) .

The following outlines some important points for the porting.

1.COpenGLDriver.cpp

This is key component for the porting to work. Because OpenGL ES 1.1 doesn't support glBegin/glEnd, glVertex commands, I have to replace some 2D rendering code with glDrawElements. Some other unsupported features like glPushAttrib/glPopAttrib, Texcoord generation needs workarounds or completely disable.

2.COpenGLTexture.cpp

Reversed color formt like A1R5B5G5 is not supported by OpenGL ES, so we have to convert the image data to normal order.

3.In image and 3D model loading code, the compiler directives for byte alignment needs to be adapted for Symbian. (All of them actually are the same, maybe later this could be refactored to a common place to facilitate porting to other systems.)

4.Add a new irrDevice -- irrDeviceSymbian.
The cursorcontrol and event handling has been completely disabled.