Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm starting a project with friends which would preferably reach both audiences of windows and linux. The only problem is that none of us have any experience of linux porting or linux coding any way. Thus, I'm asking for information here if it'd be possible to use the same code for both platforms. If it's some choices we had to make while coding it to be for both platforms.

Our preferred coding language is C++, but if enough support is gained towards another one, a switch is possible. We haven't chosen a graphics nor a game engine yet because of this fact. With the minimum effort we'd like this to be as close as possible to a "uniplatform" game. :)

share|improve this question
2  
It's worth noting that the Linux games market is virtually nonexistent, and practically nobody codes games for Linux. –  DeadMG Feb 17 '13 at 11:59
14  
@DeadMG: Steam for Linux appears to be popular enough... –  Martijn Pieters Feb 17 '13 at 12:24
1  
I know you prefer C++ but Java would allow you to run your game in both Windows and Linux with very little to no changes. I know that Java is not very popular for game development but it can be done and solves your platform issue. –  DFord Feb 17 '13 at 14:14
6  
@DeadMG I don't think that's worth noting, the question is "is it possible" not "should I do it". –  Brian Marshall Feb 17 '13 at 14:49
3  
I personally believe that Linux is a platform that needs more attention when publishing games. This is entertainment that should be available to as many people as possible. Also, I prefer free over commercial. –  BFlorry Feb 17 '13 at 15:38

4 Answers 4

up vote 6 down vote accepted

Yes, it is.

All you need is an abstraction layer to take care of the ugly details.

Since you like C++, you should look at SFML. SDL is also pretty popular, but it's more C-ish.

Note that code is just a portion of what it takes to make a game. Packaging (Installers, etc.) will also take effort and that part will be harder to abstract away.

share|improve this answer

For doing C++ cross platform programming, Qt is currently one of the best choices you have. Qt is a general framework, not particular for games programming, but in most games you will meet the same kind of requirements as in other desktop applications. There may be some additional requirements (for example, for joystick support), which won't be solved by Qt, so perhaps you will needs the libs suggested by @luiscubal, too.

See some example games done in Qt here: http://qt-apps.org/index.php?xcontentmode=4250

share|improve this answer

Yes it's possible. A number of upcoming cross-platform games (including specifically Project Eternity and Dreamfall Chapters) use Unity3D, which is a cross-platform framework that supports Linux.

If you just want something free and easy, use LÖVE

share|improve this answer

Javascript, canvas, and the browser are some of the most cross-platform technologies. That way, you'll get android and iPad support as well.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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