Best Porting Options - Mac (Cocoa/OpenGL) to Windows

dajtxx
Unregistered
 
Post: #31
I ported Oolite from Obj-C/Cocoa to GNUstep/SDL so I could run it on Windows and Linux (me not having a Mac).

Just say no to GNUstep - it is terrible. I had to:
  • Create a main function to get the game running that had to do something with memory pools and get the objects set up like the NIB did on the Mac.
  • Redo all the screen handling code to use SDL rather than Cocoa (obviously you have no choice in this, even going to C++).
  • Convert all plists to ASCII format because GNUstep windows can't handle XML plists. I later made a version that did but then you have to distribute the custom version. We also just added some XML plist parsing code into the game itself because most people wouldn't convert the plists in their add-ons.
  • Debug using NSLog because debugging Obj-C on Windows with gdb is no fun at all - it doesn't handle Obj-C stack traces well either - lots of frames show up as ??
  • Write replacements for the sound classes because GNUstep doesn't handle them as far as I can see.

There is probably more but I've happily forgotten most of the early porting effort.

Trying to get a Mac app running under GNUstep is a world of development pain. So is converting all your code to C++ but at least you can stop suffering once you've done it!

Note, I'm no C++ fan, but for cross-platform purposes with code already written in an OO extension to C, it is probably the best choice.

Regards,
David.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Options for Web Game Development in OS X Nick 4 3,701 Sep 20, 2008 01:13 PM
Last Post: Nick
  Trying to port an OpenGL Windows game anthony 2 3,660 Jan 26, 2007 02:16 PM
Last Post: anthony
  initializing opengl in cocoa FreeKQuency23 6 3,624 Apr 2, 2006 12:10 PM
Last Post: arekkusu
  XCode project build options + makefiles = compiling fun! Lavareef 2 6,184 Nov 10, 2005 04:30 PM
Last Post: dair
  Windows Event Loop -> Cocoa Timers maaaaark 2 3,928 Apr 11, 2005 11:22 AM
Last Post: Red Marble Games