# Windows-Linux cross platform game [closed]

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?

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.

## closed as too broad by MichaelHouse♦Feb 22 '15 at 17:01

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• You should me more specific. – Quazi Irfan 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. – qreba47jhqb4e3lstrujvvdx 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

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.

• 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: gafferongames.com/networking-for-game-programmers/… 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.