I want to learn C++ for game development. Does anyone know a good way to learn this?

It can be with books, tutorials, anything. I would also like to know what is a good engine to start with?

thanks you :)

  • \$\begingroup\$ gamedev.stackexchange.com/questions/41/… \$\endgroup\$ – Tetrad Jan 8 '12 at 19:13
  • \$\begingroup\$ Also, "Your questions should be reasonably scoped. If you can imagine an entire book that answers your question, you’re asking too much." gamedev.stackexchange.com/faq#dontask \$\endgroup\$ – Tetrad Jan 8 '12 at 19:14
  • \$\begingroup\$ @Tetrad Perhaps my interpretation of his question was too optmistic, but it seemed reasonable to me. I.e. good resources on how to learn a specific programming language and within the scope of game development. At least that's what I had in mind when I answered. The duplicate you linked is much broader than that. \$\endgroup\$ – David Gouveia Jan 8 '12 at 19:29

If you understand programming and just want to learn C++ then i'd recommend Thinking in C++ by Bruce Eckel, it'll teach you everything that you want to know about modern C++ in an easy to understand fashion with the emphasis on Object Oriented programming from the beginning, which is essential for creating even small games like Tetris. This book is availible for free on the author's site. However if you don't know anything about programming, then this book won't help you.

After you understand C++ there are still alot of books that'll expand your knowledge.

C++ For Game Programmers by Noel Llopis comes to mind. This books covers alot of core knowledge that any programmer will need like using inheritance, but does it in the context of games. It has alot of problem solving, information about what's under the hood, performance issues associated with using language's features and how to deal with them. Noel has his own blog, you can follow it here.

Effective C++ and More Effective C++ by Scott Meyers, two advanced books. They're more of a guidance to becomming a better programmer than an organized repository. Read them after you're comfortable with C++.

As for engines, SFML comes to mind, it's very easy to use IF you know the language.

| improve this answer | |
  • \$\begingroup\$ Is this the C++ For Game Programmers you were talking about? Strange that the author seems to have changed for the second edition. It's listed as Mike Dickheiser now. \$\endgroup\$ – David Gouveia Jan 8 '12 at 18:31
  • \$\begingroup\$ IIRC the way 2nd edition worked for this book is that the 2nd author just added his own part, it wasn't like a rewrite. Don't quote me on it though. \$\endgroup\$ – dreta Jan 8 '12 at 18:36
  • \$\begingroup\$ Must remember to read the Foreword later. I have the 2nd edition and liked it a lot, but it's not here at the moment. \$\endgroup\$ – David Gouveia Jan 8 '12 at 18:38

I want to learn C++ for game development

So you're interested in learning the language? Then one of these two books might be a good place to start depending on your current level.

Beginner Level (Never used C++ / Never programmed a game)

enter image description here

Beginning C++ Through Game Programming

Simple introduction to both C++ and making games. Starts from zero and introduces language features in the context of simple games. A warning though, all examples are text based and focused on the game logic, so there are no graphics covered in the book.

Intermediate Level (Knows C++ / Doesn't know how to use it efficiently for games)

enter image description here

C++ For Game Programmers

This one is excellent if you already know the basics of the language, but don't know the tricks and best practices of how to apply it to game programming. Once again, it's all about increasing your proficiency with the language, not a tutorial of how to make a game.

Other References

The books above are both centered around game development. But it's also possible to learn the language first, and only then start thinking about how to apply it to games. In that case my recommendations change into the following two books, respectively for the beginner and intermediate programmer:

  • Accelerated C++ - Probably the best introduction to the language I've read. Teaches C++ from the ground up using practical examples and introducing you to C++ features since the start (most books start teaching C++ as if it were C).
  • Effective C++ - The single most useful C++ book I've ever read. Teaches all about the tricks and pitfalls of the language, which you have to know, but most other books don't cover. This includes the two sequels written by the same author (More Effective C++ and Effective STL).
| improve this answer | |
  • \$\begingroup\$ @Stijn No problem. And my personal advice is to take things slowly. Learn how to program before trying to learn how to program games. It will pay off in the end. Too often I see people who obviously don't know how to program trying to make a game just by hacking together every tutorial they can find, and then they get completely stuck in things as elementary as making one variable accessible in another part of the game. \$\endgroup\$ – David Gouveia Jan 8 '12 at 17:00
  • \$\begingroup\$ Gouvela i downloaded Beginning C++ through game programming and i think i will learn allot of it, again thank you so much bro \$\endgroup\$ – Stijn Jan 8 '12 at 17:08
  • \$\begingroup\$ Any reason for the downvote? \$\endgroup\$ – David Gouveia Jan 8 '12 at 18:23

game development is not really bound to any programming language. There are certain techniques that you need to learn, wether that is in c++ or any other language is irrelevant.

Back to the point, I'm learning c++ myself right now and these tutorials are incredibly helpful for understanding the basics.


| improve this answer | |

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