Jump to content

  • Log In with Google      Sign In   
  • Create Account

Are there good c++ programming books for beginners?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 ThatGuyOverThere   Members   -  Reputation: 129

Like
0Likes
Like

Posted 01 May 2013 - 08:32 PM

I know the term "good" is subjective, so I figure I'll define it a bit: Good = clear, easy to read and understand with meticulous and detailed examples.

 

I've been wanting to learn to program in c++ for a while but I don't know where to start. I figured reading a few books and writing programs in c++ will help but I don't know what books are helpful to beginners of c++. I've had basic understanding of c, java, and c# from classes, but c++ isn't taught at my college.

 

If anyone was wondering, I do know about variables, functions, methods, object instantiation, loops (not so much as a game loop but I think I can pick up on it quick). Superclasses and subclasses still confuse me a bit but I'm hoping to work on it more over summer (in addition to my motion-capture internship). 

So are there any books that can teach me to program in C++ for video games?



Sponsor:

#2 warnexus   Prime Members   -  Reputation: 1438

Like
0Likes
Like

Posted 01 May 2013 - 09:38 PM

These are programming books are good to understand the concepts easily. Try coding the examples and make sense of what is said.

 

C++ for Dummies by Stephen Davis(covers basic first then advanced)

 

Thinking in C++ by Bruce Eckel. (It starts you off with Object Oriented C++)

 

C++ without Fear by Brian Overland(covers basic first then advanced)

 

You can read any books about data structures and analysis of algorithms in C++ once you got a good handle on the language. It is super useful for games and other programs and will broaden your horizons on what data structures can be built based on what you already learned and what you will need to know. How much time a function takes to execute and how much memory is used to execute that function is also good to know which is where analysis of algorithms skill is good to have.

 

In terms of C++ game programming, I heard C++ itself does not come with a built-in library so you will need to import the library you found online and import into the IDE you are using. 

 

Some libraries I found using a google search are SDL and Allegro. Try these libraries and see if you like it.

 

If you are still learning C++, you should make sure you have a well-rounded understanding of using C++ before attempting game development. Game programming requires a good understanding of the programming fundamentals and graphics programming. The idea applies to other programming languages like Java which I use for game programming which requires the knowledge I mentioned in the previous sentence.

 

I know procedural programming in C++ but very few of the object-oriented stuff. I'm more experienced in Java.

 

However, I can start you off with this example because everyone sees the hello world program when they first learn c++ or any language.

 

#include <iostream>
using namespace std;

int main ()
{
cout << "Hello World!";
return 0;
}

 

Good luck.


Edited by warnexus, 01 May 2013 - 09:59 PM.


#3 ivan.spasov   Crossbones+   -  Reputation: 1760

Like
0Likes
Like

Posted 01 May 2013 - 10:19 PM

Learning the basics of C++ in itself is a hard but very rewarding task. Get around to know the basic synthax of the language and be sure to get a good understanding of the following topics, as they are vital to C++ development, especially in terms of games:

  • Pointers - this is really, really important. In time you yourself will see why.
  • Memory allocation and memory release. This is a must as well.
  • Knowledge of how the algorithms in STL work. Templates can wait in the beginning though. They are a bit of an overkill concept for a beginner.

In terms of tutorials and books, I find these quite useful:

After you get down with the basics, you would need to do research on how you want to go on with the game development side of the language. You can go low level and pick up an OpenGL API and start reading tutorials on that, and from there doing your own thing. Or, you can go with something, that I honestly prefer, and choose an engine to work with. On the engine topic, you can look up Irrlicht or Ogre3D. Going with an engine is good in my mind because you can concentrate more (with C++ that's always just to some degree) on the building of the game, rather then building everything from the ground up. The last thing being an overkill for a beginner, in my mind.

Hope this helps.

 

Good luck.



#4 Matt-D   Crossbones+   -  Reputation: 1453

Like
0Likes
Like

Posted 02 May 2013 - 11:42 AM

Not to repeat myself: http://www.gamedev.net/topic/642074-accelerated-c-or-programming-principles-and-practice-using-c/#entry5055213 :-)

#5 ThatGuyOverThere   Members   -  Reputation: 129

Like
0Likes
Like

Posted 02 May 2013 - 12:01 PM

Well, I want to start learning more general video game programming such as movement, raycasting, input detection, collision detection, etc. I know I'll need to cover the basics so I'll start right away, thanks!



#6 warnexus   Prime Members   -  Reputation: 1438

Like
0Likes
Like

Posted 02 May 2013 - 04:18 PM

Well, I want to start learning more general video game programming such as movement, raycasting, input detection, collision detection, etc. I know I'll need to cover the basics so I'll start right away, thanks!

You need to learn a lot of the basic stuff to perform movement on an object. It involves an understanding of logical, control flow statements, state of the object you are keeping track of, basic math and coordinates on a graphics window to name a few.

 

Input detection is pretty much getting input from the user. It can be listeners listening for mouse or key events generated by the user.

 

Collision detection at the most basic level is testing intersections of bounding shape of the object it is surrounding.


Edited by warnexus, 02 May 2013 - 04:22 PM.


#7 ivan.spasov   Crossbones+   -  Reputation: 1760

Like
0Likes
Like

Posted 02 May 2013 - 09:21 PM

Well, I want to start learning more general video game programming such as movement, raycasting, input detection, collision detection, etc. I know I'll need to cover the basics so I'll start right away, thanks!

The thing with C++ is that it's a very very powerful and complex language.

Before you can do any of the things you talked about, you are going to need a really solid foundation.

Grasping the programming basics with C++ is one thing, actually developing usable code with it is a whole new thing all togather.

You should really take your time to understand concepts along the lines of memory management.

In languages like Java or C# for example, you have that taken care of for you by the garbage collector and other such useful features.

In C++ you just don't get that. You have to manage these things your self.

However, it's all worth it. Good knowledge of C++ can offer you the chance to learn really easy other programming languages, like Java, C#, Objective-C and so on.



#8 Matt-D   Crossbones+   -  Reputation: 1453

Like
0Likes
Like

Posted 05 May 2013 - 07:22 PM

In C++ you just don't get that. You have to manage these things your self.

However, it's all worth it. Good knowledge of C++ can offer you the chance to learn really easy other programming languages, like Java, C#, Objective-C and so on.

 

Slight correction; I'd say: in C++ managing resources is easier, it's RAII most of the time, whether a resource is memory, file, image, network socket, or whatever:

http://www.artificialworlds.net/blog/2013/05/01/goodness-in-programming-languages-part-4-ownership-memory/

 

In some other languages, like the managed ones, you have to be careful to make a special distinction between distinct resource types and their interaction with exceptions, etc. -- e.g., GC only handles memory (so, a half-baked special case at most), for the other resources you have to remember about the Dispose and using patterns, etc.

 

Tricky!

 

It's a good thing C++ has a direct language feature for automatic, unified resource management :-)

 

"So the C++ destructor model is exactly the same as the Dispose and using patterns, except that it is far easier to use and a direct language feature and correct by default, instead of a coding pattern that is off by default and causing correctness or performance problems when it is forgotten."

http://blogs.msdn.com/b/hsutter/archive/2004/07/31/203137.aspx


Edited by Matt-D, 05 May 2013 - 07:23 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS