Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I wish to begin learning game development in C++. I have knowledge in syntax and the console using Visual C++ 2010, however I want to begin programming. My only problem is that I want to be able to support many platforms including Windows, Mac OS, and Linux. As I get better, I also hope I can submit games to XBLIG (or XBLA) and Steam, and even the Google Play Store (But that would take some porting and major redesign of controls).

I have looked into c++ and SDL but I have no idea how to get started. I have Visual C++ 2010 installed and I hope I can still use that as other C++ IDEs are quit outdated. Because I want to stick with Visual C++ and SDL (unless there is a better library than SDL), there is not much room for debate but rather how to create projects to support cross-platform development.

share|improve this question
1  
You're not going to get much more cross-platform than C++ and SDL (or OpenGL if you're feeling adventurous). I'd suggest looking at this question and get to writing a lot of code. –  Mike C Jun 16 '12 at 19:50
    
See the FAQ about questions about how to get started. –  Byte56 Jun 16 '12 at 20:10
    
@Byte56 Please see gamedev.stackexchange.com/questions/18263/… which is a perfectly fine question. Thanks –  Qasim Jun 16 '12 at 21:58
    
If you want to see how you can get started with SDL, you can have a look at FLEE: github.com/marcopennekamp/FLEE I am currently working on it; thus far I have managed to run it on Windows, Linux and Android. I'd also recommend to use a GLES version as the standard OpenGL version, 'cause almost every platform (including mobile) supports GLES. You can also try to use FLEE, but it's not stable yet. Oh, and there are many IDEs for C++, e.g. Eclipse CDT, Netbeans C++, Codeblocks... Use the one that suits you best, but stick to C++ standards not windows standards to have a portable program. –  Marco Jun 16 '12 at 22:09
1  
@Qasim You're right, that one should be closed too. –  Byte56 Jun 16 '12 at 22:09
show 3 more comments

closed as not constructive by Byte56, Patrick Hughes, Nicol Bolas, Josh Petrie, Tetrad Jun 17 '12 at 15:28

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

Begin by not beginning.

Seriously - while there are various libraries and frameworks that can help you, overall true cross-platform programming is bloody difficult. I'd suggest that you're trying to achieve too much too soon. Game programming itself is hard enough and you have enough to be getting on with in learning that on it's own. Wanting to learn true cross-platform programming as well and at the same time is only going to make things even harder for you.

So - focus on learning game programming on a single platform. Learn the concepts, the algorithms, the mathematics, the optimal strategies. The great big dirty secret is that these will all transfer easily to other platforms. By focussing on a single platform you get to learn them without any peripheral stuff to distract you, and then - when you're comfortable with them - start branching out.

share|improve this answer
    
Although this is certainly true, focusing too much on one platform and therefore its features can have bitter side-effects when you want to port the program to another platform. The more you rely on standards of the language (like STL in C++), the better; So even a newbie should always prefer such libraries over platform specific stuff. –  Marco Jun 16 '12 at 23:11
    
I come from Java, I have developed various games for class and in my free time to grasp a good understanding of game mechanics. I just need to get started on the right path –  Qasim Jun 17 '12 at 0:35
add comment

A compiler will often define macros indicating what compiler is being used, what OS is being used, etc...

The following might be useful to you: http://sourceforge.net/apps/mediawiki/predef/index.php?title=Main_Page

One approach is to architect your code in layers, where one of the lowest level layers would be the platform independence layer. Here, you would write code that uses these compiler macros to fulfill some interface. This interface abstracts the platform specific stuff and is used by the higher level layers (or by users) to avoid direct exposure to these kinds of details.

share|improve this answer
add comment

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