Here's a screenie of my little GDI+ (System.Drawing) based game engine ported to the Mac using MonoDevelop. The sandbox "game" instance is just some bouncing balls that collide against the walls, the rectangular blocks, and each other, with fairly realistic physics, emitting dual-light draw drop-shadows, etc. In Windows, DirectSound is also used to create stereo "bump" sound effects that make the bumping balls feel a little more realistic.
Wow, this only took about ten minutes, from "I wonder if .." to "wow, look at that, it's working!" My steps:
- Add my home Subversion server as a SCM repostitory in MonoDevelop
- Check out my game engine (called "Level1Engine") to ~/Documents/dev/Level1Engine
- Watch MonoDevelop puke on the absolute UNC path of one of the project references
- Manually add the missing .csproj file to the solution
- MonoDevelop exits unexpectedly
- Reopen MonoDevelop, reopen solution
- Create a new project with the same name/directory as the broken project
- Remove the generated sample .cs file
- Add the existing .cs files to the project, in-place
- Comment out the DirectSound references from the game engine class library. (Sadly, that means there's no sound yet.)
- Let 'er rip
Overall, this blog post took me about twice as long as porting my app!
The result is not flawless, though. Rendering performance is about 1/3 what it is in GDI+ (in Windows), and apparently the 2D matrix transformations (which I had to touch for the drop shadows) are a little buggy in Mono because that text on the top left, which is rendered with System.Drawing, jiggles around erratically by about two pixels.