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!