Developing on Mac and Basalt running on the IPhone
|
It’s been around two weeks since my last post. Basically because I’ve been busy porting my engine Basalt to IPhone/IPad. So it all started with my wish to port Vizati to the IPhone, since the game is already running on PC, Xbox360 and Windows Phone 7 one can only wish for an easy and quick port since pretty much all base code is done. As you know for developing on the IPhone you require an actual Mac, I know there’s virtualization but my 5 year old PC can’t take it, believe me I tried. So I bought myself a mini mac which are much cheaper that IMac and macbooks, around $499 or so, and another extra $30 for a mini-Dvi to VGA adapter for my 1080p Samsung. Let me tell you, that bastard is silent, I mean I can’t listen to anything, powering off my desktop PC and I have this relaxing environment to work in, it’s great for coding during the night when everyone is asleep. I can only hear my keyboard strokes and my cat snoring. Now, moving on to the development part, on MacOS your IDE is XCode. It’s no Visual Studio but it gets the job done. Has some strange shortcuts but I’ve found a neat shortcut pdf. Next was my struggle for testing available engines and frameworks and learning how much of Objective-C do you have to know and can I run C++ on it? I tested some engines: I research a little on those well know tools such as Unity3D, ITorque, etc but those kind of editor aren’t really my thing. At one point I convinced myself that the way to go would be learning Objective-C since most tutorials for IPhone are written using it, it’s Iphone OS native language and everyone recommends learning it, but after a few hours watching the amount of square brackets that things has on it I decided another way. I ported my C# engine Basalt to C++, literally making .h and .cpp files. I hooked up my main animation and draw pump to some Objective-C classes (don’t forget to use .mm if you are mixing Objective-C with C++) and everything started working. The next bit was implementing the SpriteBatch class and make it draw in OpenGL, took me around two days to have the Matrices working, correct texture mapping to quads, Alpha Blend and Additive. The idea is that by the time I port an XNA game to C++ I can still use SpriteBatches, Texture2D etc. After these two weeks of development here’s what’s working:
Here’s a video showing what I have so far: Next in my list is Input, Script, music and then porting the whole game to C++, which I think will work nicely once the whole engine base is done. PS: Monkey Island 2 Special Edition is awesome…. |




Pingback: Another milestone reached, first App sent to Apple Store | David Amador
Hey, great article!!! but if you came from XNA (PC, XBOX a WP7) why learning objective C++ for iphone port? Did you take a look to the ExEn project? it’s XNA for iPhone, Android and Silverlight!
Currently ExEn is an implementation of a subset of the Microsoft XNA Framework API that runs on iPhone and Silverlight. It is based on XnaTouch and SilverSprite – but most of the important bits have been rewritten – most importantly the rendering, audio, input and timing systems.
Here is what is currently supported:
Everything needed to make a 2D game
SpriteBatch for high performance sprite graphics and text rendering
Music and SoundEffect for audio
Mouse input on all platforms
Keyboard on Silverlight
The Game and GameComponent system
The ContentManager class for supported types
The Maths types and various miscellanea
Take a look at http://rockethub.com/projects/752-exen-xna-for-iphone-android-and-silverlight
Thanks! greatings from Argentina!
HERNAN
Actually my port for iPhone is 98% C++, only around 2% Objective-C for some function hooks.
At the time I tried MonoTouch and similar stuff, I was disappointed with performance and compatibility. It took me awhile to port the engine but I think it was worth it