Jump to content
  • Advertisement
Sign in to follow this  
MikeSomers

Need help filling gaps in my C++ knowledge

This topic is 2719 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been learning C++ on and off for awhile now and have tinkered with making basic programs, but everytime I read tutorials on creating a 2D engine I get confused and overwhelmed and can't get beyond making a basic engine. The main reason for this is I've learned C++ in pieces so a lot of parts of code I read in tutorials I understand completely while others I don't and have to go look up. While looking up something I don't understand I then run into something else I don't understand since I approached it out of context.

Obviously this is the worst approach to learning something as complex C++. What I'm looking for is book(s) or a series of tutorials that teach C++ from the very beginning that covers the language and then moves up to game programming and creating a basic 2D engine. Preferably with SDL since I've used that the most. Yes I'm willing to do Hello World for the umpteenth time. Does anyone have a good source or list of sources I can follow from beginning to end to get started with 2D game programming?

Share this post


Link to post
Share on other sites
Advertisement
Here is one book that takes the approach you want : http://www.amazon.com/Beginning-Through-Game-Programming-Third/dp/1435457420/ref=sr_1_5?ie=UTF8&qid=1294899528&sr=8-5

I do have a tip though, start with a book series that teaches you C++ then graduate to the next building block of getting a C++ Games book.

Possibly like the Deitel & Deitel are newbie C++ friendly http://www.amazon.com/How-Program-7th-Paul-Deitel/dp/0136117260/ref=sr_1_6?ie=UTF8&qid=1294899528&sr=8-6

Or if you got a little bit of programming experience http://www.amazon.com/Accelerated-C-Practical-Programming-Example/dp/020170353X/ref=sr_1_12?ie=UTF8&qid=1294899528&sr=8-12

then once you graduated from the C++ books go for more games orientated stuff like :
http://www.amazon.com/C-Game-Programmers-Development/dp/1584504528/ref=sr_1_3?s=books&ie=UTF8&qid=1294899658&sr=1-3
or
http://www.amazon.com/Game-Coding-Complete-Third-McShaffry/dp/1584506806/ref=sr_1_4?s=books&ie=UTF8&qid=1294899658&sr=1-4

Share this post


Link to post
Share on other sites
Hi.
As you probably know each individual learn in a little different way.
You should check out if a near library has some C++ books, as well as checking out some different online tutorials.
I know good tutorials are hard to find, but I learned alot from examine code as well as breaking it apart, trying everything out for myself.
A good way to start is to take one thing at a time, and a tip is to not read half the tutorial then stop when you think you got it, read it to the end, and comments too.
Here are the very basics (all from variables to filestreaming) CPlusPlus tuts.
Also, working on 2d you need to chose an API that you like.
I would reccomend DirectX or OpenGL.
Some code is really hard to remember, but when you use it a few times, it gets stuck =)
I just made a blog about game making, it's not very resourced atm, but I will post tutorials and my projects afterwards.
If you are interested, visit: World of Zaerdna
Good luck making games!

Share this post


Link to post
Share on other sites
I've always found general C++ books more helpful than the game-specific ones.
The general books are just as applicable to games as to anything else,
and in my opinion they yield better and quicker game programming results.

For a good introduction to programming and C++, I've heard good things about C++ Primer Plus.
I don't know this personally, as I was introduced to programming through a different language.

If you're serious about making C++ games, at some point you will want Stroustrup's The C++ Programming Language.
It's the best, most comprehensive C++ coverage out there, but it's not really written for people who are new to programming.
Stroustrup recently released a C++ book for beginners, but I haven't looked into it yet.

Also: make sure you've considered other programming languages. It's good for you.

Share this post


Link to post
Share on other sites
(recycling the standard list, and adding additional comments)

[color="#1C2837"]The standard list of C++ books to read are:

# "Accelerated C++" Andrew Koenig and Barabara Moo
# "The C++ Standard Library" Nicolai Josuttis
# "Effective C++" Scott Meyers
# "More Effective C++" Scott Meyers
# "Effective STL" Scott Meyers
# "Exceptional C++" Herb Sutter
# "More Exceptional C++" Herb Sutter


[color="#1C2837"]Stroustrup's "The C++ Programming Language" is good, but I would put it just past the end of the list. A decade ago it was on the list, but times have changed. The book does a good job of explaining motivation of the language, but describes pre-standard c++. The "special edition" version had many changes to help it mirror the language, but good portions of it were out of date at printing time. A good book certainly, but I don't recommend it for people wanting to learn today's C++.

[color="#1C2837"]
The first, Accelerated C++, will cover the fundamentals of the language. It does a much better job than most of the online tutorials, and is more complete than any of them. It has been the highest recommended introductory C++ book since it came out. It starts with "Hello, World!" and quickly covers every major language part you routinely used in the professional world.

The second book is an 800+ page in-depth study of how to use the standard library. It is probably the most correct of all c++ programming books. It would only be second behind the language standard itself, which is correct by definition. I believe the book has complete coverage of every function in the standard library when it was released. The author (who was on the language standards committee at the time) used the book's source code to verify the correctness of all the major c++ implementations. If an example doesn't compile or doesn't run perfectly on your system, it means there's a bug in your compiler. If you aren't very comfortable with the standard library yet, you will be amazed at what it can do. If you are comfortable with the standard library you will be amazed at how much you didn't know. If you know the standard library, you will be reminded at how you can simplify your code. Read as much as possible until your brain goes numb, then crack it open every few months and re-read a chapter. It is an excellent reference.

The Effective and Exceptional series both cover important information and edge cases in the language, presenting it in bite-size items that are easy to digest. They tend to hop around between topics but you can learn a lot no matter what your current skill level is.


[color="#1C2837"]Note that each of the authors are very prominent people in the language standard. The books are very solid, you can compile and run the examples on any current c++ compiler, unlike many other books that have countless bugs. The information is technically accurate, contrasted with books that describe a language similar-to-yet-completely-different-from standard c++. Almost all of them are before TR1, so the very latest round of improvements the language aren't covered.

Share this post


Link to post
Share on other sites
Going off frob's list, I recommend:

# Effective C++
# Thinking in C++
# C++ for Game Programmers
# Game Coding Complete

The first three overlap in some areas but that helps reinforce the key areas from different directions which is handy. Game Coding Complete is a walk through making a basic framework/engine. It is based on DirectX but helps understand the context of other engines/libraries you use better.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!