Archive for January 23rd, 2009|Daily archive page

iPhone OpenGL ES Gaming Framework Update

Its taken me a few days to port over some of my XNA stuff to the iPhone SDK, but it looks as if the current framework is starting to take shape. So what do I have so far? Currently the framework’s feature list is as follows;

- Started with a base OpenGL project template. This template was written by Jeff Lamarche of iPhoneDevelopment fame. He also helped write the “Beginning iPhone Development; exporing the iPhone SDK” book (amazon link HERE ) the template can be picked up at Jeff’s blog post located: HERE

- From here, I converted the GLViewController into my screen manager class. This screen manager is heavily inspired by the XNA Development Team ( for use with the XNA Framework for writing C# programs. This screen manager will manage all game screens, updating and displaying their contents, and even filter all user input to the screen that is currently active.

- The GameScreen class structure, where GameScreen is the parent class of any screen I wish to create. Right off the top of my head, in the game I am currently writing my design doc for, I will have several screen classes inheriting from GameScreen, including TitleScreen, MainGame, Paused, and Achievements.

- Several helper classes such as RandomNumber for random number generation and Apple’s Texture2D class which is a life saver for getting textures and text to screen.

Right now, this is the extent of the gaming framework, but eventually I will need to add sound support and various other things. As of my progress? I have been tinkering with things and was able to get touches and game flow working. The following two screenshots demonstrate this, where the first screen shot shows nothing but 3 buttons, and the 2nd screenshot shows what would happen if you clicked inside one of the buttons.

Exciting huh? Well there is much more work to do! I have not posted the code to any of this stuff yet, because it is incomplete. I am not sure if I will be writing any tutorials on the gaming framework, but if there is enough demand than I will.

Being able to get the gaming framework set up will be a great step forward. It means I can take more time working on the actual game, and less time setting up things like the screen manager every time I want to start a new project!

Happy coding everyone! Let me know what you all think should be included in a gaming framework such as this!


Get every new post delivered to your Inbox.