Archive for January, 2009

Hello world – IPhone, we have liftoff!

Tuesday, January 13th, 2009


I’ve been up to a whole host of fun things recently.  I guess the most exciting for me was the completion of porting my game engine over to the IPhone simulator.  It took about 3 days, a far amount of which was figuring out how to support multiple platforms on XCode and building some wapper code.   I’ve stepped away from SDL and am using my own wrapper on the IPhone.  So I had to do some Objective-C as well to build the wrapper code.

I think I actually spent longer working on the assert functionality then anything else.  For a nice assert you need some way of throwing up a modal dialog box.  That means you fire the dialog box and wait for it to return, you don’t want to carry on until it’s finished. 

I was all about ready to go forth and kick off a thread for the query and then block for that thread to exit when I found The Bunny’s IPhone Development FAQ. Wonderful resource! I’d already figured some of that out and was spawning my own thread for the main game loop and had figured out the OpenGL buffers and context needed to be created in the application/event handling thread and then passed over to the game thread. However the wonderful information of exposing undocumented private features of the UIAlert class did the trick!

That is something I do like about Objective-C, you can define your public methods in the header file, but private stuff can be hidden away completely. Very nice abstraction and information hiding there!