Sign up ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

The answers to this cross-platform related question are useful, however I want my (C++) game to run on Windows and Linux (and be packaged for Ubuntu) only. I'm not interested in platforms like mobile or consoles.

Are there any specific tips or suggestions for this case?

Also, if I get the game to work on linux, is it difficult to add support for OSX?

Updating with more information:

It will be a 3D game simulating the motion of spacecraft in the solar system. We will use Ogre3D for the graphics. We're still in the design phase, so there's no code written yet.

share|improve this question

closed as too broad by Byte56 Feb 22 at 17:01

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

You should me more specific. – iamcreasy Sep 6 '11 at 11:16
From my experience, use solid C++ practices avoiding implementation defined behaviour, and build it just for one O/S. Once your ready, you can port it. Obviously using libraries that are cross-platform (GLFW for example) from the start will decrease the amount of work later; but don't let it hinder getting everything else done first. – dcousens Sep 6 '11 at 11:17
Ogre should take care of your cross-platform woes.. or most of them, anyway. Just don't use windows APIs for anything and you should be ok. =) – Jari Komppa Sep 6 '11 at 12:37
Oh well this renders my answer useless, there aren't any competent 3D implementations for JavaScript yet, I think. – jcora Sep 6 '11 at 12:40
Is there any reason the general cross-platform guidelines don't answer your question? – user744 Sep 6 '11 at 17:30

2 Answers 2

up vote 1 down vote accepted

One thing you might want to keep in mind from the start is that if your game relies on floating points physics calculations the behavior on one OS could be different than on the other without some careful considerations. This is not dramatic if your game doesn't rely on perfect synchronization across different platforms such as multiplayer RTS games and will only be apparent in some edge cases but it's still something I consider important to keep in mind ahead of time.

Other than that, using C++, cross-platform specifications (OpenGL if you ever need it, I don't know Ogre3D) and cross-platform librairies (and of course the STL where possible) should pretty much help you make your game platform-agnostic. Just make sure to abstract implementation details (Window management, threading, networking, etc.) during your conception and all you'll need is some solid testing on all platforms.

share|improve this answer
Actually there will be lots of floating point physics calculations, and we want them to be very precise. However we are not planning to include multiplayer. If there is a site or resource that details the differences you talk about, could you please direct me to it? – Marco Giancotti Sep 7 '11 at 10:18
This article:… explains the problems in this situation for multiplayer synchronized lockstep games. Both the article and the comments are very insightful. In your case howerever, synchronization is a non-issue so floating point physics calculations across platforms isn't THAT dramatic. – pwny Sep 7 '11 at 20:44
I'll just write the relevant code and do some tests to see if it's acceptable, then. Thank you for the link and the advice! – Marco Giancotti Sep 7 '11 at 21:04
Good luck, I'd love to hear about the results! – pwny Sep 7 '11 at 21:09
Does this happen between different OSes under the same architecture? I thought FP results are consistent under the same platform. – kaoD Sep 8 '11 at 2:14

I currently work in the GIS industry, and so many of our software libraries (e.g. GDAL) are designed to be cross platform. They cause nothing but headaches

The best way to write applications intended for multiple platforms is to architect them such that platform dependencies are abstracted away completely. Write code that is easy to port, rather than cross-platform. You'll save yourself a lot of headaches and wasted time trying to figure out why you umpteen millionth#ifdef WIN32 doesn't work properly.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.