Tips on porting?

I’m going to be developing on Linux with SDL. Last time around, lots of people wanted me to port my game to OSX and especially Windows. I’ll be coding in C/C++. Anyone have any tips or guides on how to A) write portable code and B) on porting portable code to those platforms?

Comments

Sos
16. Aug 2010 · 17:23 UTC
Get yourself MinGW cross compiler and wine, that shoudl do well enough. If you’re hardware-powerful, you can go VM as well. Linux GCC is a bully compared to MinGW, so porting to Windows is a piece of cake compared to opposite. Also, I’m Macless, so no tip from me there.
jakkarth
16. Aug 2010 · 20:22 UTC
MinGW appears to be exactly what I need for windows. My test application works on my windows box, my windows vm on ubuntu, and on ubuntu under wine. Now if I could just find something for OSX…
16. Aug 2010 · 20:44 UTC
There’s a book by Brian Hook called Write Portable Code which has some good tips.
stqn
17. Aug 2010 · 11:25 UTC
Well, if you use SDL and nothing more (besides libc…), you should have a hard time making your code *non*-portable ;). As long as you stick to x86 you don’t even have to care about byte order…