My last article explained how ExEn works on Silverlight. There is a lot of trickery involved in going from an immediate-mode API to a retained-mode one, so that was quite a long article.

In contrast, ExEn on iOS is a layer on top of OpenGL, which is also an immediate-mode API, so the implementation is pretty straightforward.

OpenGL is also the graphics library for Android and Mac OS X, so when I port ExEn to those platforms (see the ExEn project on RocketHub for details), it will work in much the same way.

One of my goals with ExEn is to make it as cross-platform as possible. Because Silverlight 3 does not support 3D graphics, I have not added 3D support to ExEn on iOS yet – there is only SpriteBatch for 2D graphics. The possibility of implementing 3D graphics for iOS exists, and it actually looks pretty fun to implement. But I’m also hanging out to see what Silverlight 5’s new 3D support is like so I can keep the two platforms matched.

But what if you want to do 3D graphics right away?

Well, if you are comfortable with OpenGL, then it is entirely possible to mix OpenGL code with ExEn on iOS. As an example of this, my line drawing code (which I’m giving to everyone who contributes to ExEn) needs to draw polygons, not sprites, so on iOS it is implemented directly using OpenGL.

So if you’ve got a 3D XNA game that you would like to port to iOS right now, then ExEn is still an excellent choice. ExEn still provides timing, input, device setup, sound, 2D graphics, texture loading, etc – all you would need to rewrite is your renderer.

At the moment ExEn targets OpenGL ES 1.1 on iOS. The reason for this is that it supports all iOS devices. Devices after the iPhone 3GS also support OpenGL ES 2.0 – which has better performance and support for pixel shaders. While I do not want to promise it as part of the current ExEn funding project, adding a 2.0 rendering path is something I am interested in doing.

Update: Almost forgot to mention the iPhone 4’s retina display. ExEn uses the same mechanism that iOS uses: you provide high-resolution versions of your images with “@2x” appended to their file-names, and ExEn handles the rest automatically!

Comments

Aranda Morrison

3:54 pm, Saturday 22 January 2011

“So if you’ve got a 3D XNA game that you would like to port to iOS right now, then ExEn is still an excellent choice”

This sounds great but I thought there was still 60 days of waiting for funding then you’d open source it some unspecified time after that.

I’m interested in contributing on RocketHub, as I can definitely see the need for a high quality unified cross platform XNA. Sorry if I’ve missed the info somewhere in your blogs, but do you have a timeline for going OS?

Aranda Morrison

4:55 pm, Saturday 22 January 2011

Never mind – I found the 3 month timeline on the RocketHub page. Thanks!