-3
\$\begingroup\$

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.

\$\endgroup\$
8
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – Mike Cluck
    Commented Jun 16, 2012 at 19:50
  • \$\begingroup\$ See the FAQ about questions about how to get started. \$\endgroup\$
    – House
    Commented Jun 16, 2012 at 20:10
  • \$\begingroup\$ @Byte56 Please see gamedev.stackexchange.com/questions/18263/… which is a perfectly fine question. Thanks \$\endgroup\$
    – Qasim
    Commented Jun 16, 2012 at 21:58
  • \$\begingroup\$ 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. \$\endgroup\$
    – Marco
    Commented Jun 16, 2012 at 22:09
  • 1
    \$\begingroup\$ @Qasim You're right, that one should be closed too. \$\endgroup\$
    – House
    Commented Jun 16, 2012 at 22:09

2 Answers 2

2
\$\begingroup\$

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.

\$\endgroup\$
2
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ 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. \$\endgroup\$
    – Marco
    Commented Jun 16, 2012 at 23:11
  • \$\begingroup\$ 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 \$\endgroup\$
    – Qasim
    Commented Jun 17, 2012 at 0:35

Not the answer you're looking for? Browse other questions tagged .