Hi to all!I started learning C++ 2 days ago and I would like to have a book about C++ basics and game programing of my own.Can someone who has experience with such books recommend a book that will teach me C++ and will gradually introduce me to game programing?
There are tons of books out there that teach game programming through C++, however there are only a hand full of books that do so at the beginner level. Most C++ books that have exercises at the end of each chapter typically have a hand full of games for practice, tic tac toe, blackjack, etc... I think this is a good place to start. If you're looking for straight C++ only in relation to game programming, learn through programming small games and game components, then you can try Beginning C++ Game Programming... can't remember which edition... the newest one. The problem with these types of books is they lack an enormous amount of C++ material. They don't teach you how to think in C++ or approach a problem correctly... just write code and hope it compiles. This is setting you up for complete failure in the long run.
One book I do recommend is How to Program C++ 6th edition (there are others out there)... a bit expensive but it provides not only C++, but UML and Object Oriented Programming from the first chapter, as well as an introduction to the boost libraries and most importantly an intro to Ogre3d graphics API. Since you're new to C++ and game programming, I'll provide a quick outline of the things you need to read up on. You can't expect to learn them all now, but these should be your goals if you really want to make at least a hobbyist game over the next 2 years :):
1. C++ and the Standard Library - You need to know everything and understand the many data structures available.
2. Graphics API - I recomment SDL to start with for 2d gaphics once you have made your way through the C++ language. The 3d APIs out there which are considerably difficult to learn are OpenGL, Direct3d, and Ogre3d.
3. Scripting Language - Python or LUA.
There is of course much more to game programming than this, but this is a good place to start. Whatever approach you take, I always recommend to everyone interested in game programming to not focus so much on creating a huge game... it's not going to happen. The way I learned was to emulate game components from my favorite games. For example, create a text based item inventory program similar to your favorite game. You can't create a decent game without understanding how the components should work together.
So in order not to be set up for failure in the future I should ignore such books,right?And start with the book you recommended - "How to Program C++ 6th edition"?The fact that it's 6th edition doesn't meen it won't cover the basics right?What about "Thinking in C++"?Now I understand that you have to get the correct impression of C++ in order to program successfully :),so I'll aim at that first and then will try to swim deeper :).Thanks Return - I'll start with that book.If anyone else has a better suggestion please write a comment it will help me in my choice - after all
How to Program C++ 6th Edition starts with the complete basics and works you up to advanced topics. Throughout the book, you will work on an ATM case study where you learn object oriented design via C++ and UML as well as best practices and common pitfalls. There are also quite a few other books out there which no doubt the forum will recommend, I just found this one the most interesting.
Thanks Return!Be sure I'll check that book!I still accept any other suggestions before making the final choice - if you agree with return you can support his advice so that I can see that this is definetely a good book!