application of C++ - c++

everybody, I've just finished my course Introduction to Systems Programming, the last part of it was C++, I learned a lot of stuff, but all I used to write was some console programs, I want to begin to write something new on c++ (something with graphic windows or maybe small game) to improve my knowledge, from which point can I start and which books can You recommend, I found a lot materials but I don't want to waste my time for bad books, so need Your advice, thanks in advance

I once read the book "Tricks of the windows game programming gurus"
http://www.amazon.com/Tricks-Windows-Game-Programming-Gurus/dp/0672323699
All though it was the only book i ever read about game programming, I think it's a great book. All the samples are in C++.
It has a lot of mathematical and physics equations that have to do with simple game programming and graphics techniques. It also teaches you to work with DirectX.
I read it a while back (at least a couple of years) so it could be that it's outdated by now...

Related

Beginning physics simulation

I just finished taking an independent study course for CS282 - Computer Physics Simulation. It was the first time it was offered at the college I'm attending. The textbook was "Game Physics Engine Development: How to Build a Robust Commercial-Grade Physics Engine for Your Game" by
Ian Millington. This book is full of grammatical errors and, while a useful reference, is difficult to code from. The source code that is provided with the book is much more complete than the book illustrates and there is a level of difficulty deciphering the code, especially for graphical purposes as there is not even a primer on how to do something on your own with the engine, which in fact is broken or unimplemented in places, or how to use GLUT, which is the graphic utility the book uses and IS NOT DEVELOPED ANYMORE! In fact, most of the references in this book were not from the last decade, which isn't too bad for teaching code that's 15 years old, I suppose. While this text is a great resource for the big picture of physics simulation in a beginner setting, it does not introduce a friendly sandbox for CS students to play in.
This was basically an experiment to find out what works and what doesn't. My professor also included a textbook for using ActionScript with a physics engine, but the text required prior knowledge of how physics engines worked so we dropped it for practicality.
My question is this:
I'm in the process of writing a reflection paper and I'd like to be able to recommend an alternative to these texts that provides an easy way for CS students to jump in and write code and actually be able to see the fruits of their labors, possibly with python. Can anybody recommend a good resource and/or text that would be useful to this end? For those who have taken this course or similar, what have been your experiences?
which is the graphic utility the book uses and IS NOT DEVELOPED ANYMORE!
Wrong. Check FreeGLut project.
Can anybody recommend a good resource and/or text that would be useful to this end? For those who have taken this course or similar, what have been your experiences?
You might want to take a look at Chris Hecker's physics articles. They're old, but they're useful.
it does not introduce a friendly sandbox for CS students to play in.
Friendly sandbox means "nothing to program". TO "play" you could use ready-to-use physics engine (Bullet Physics (comes with source code), or PhysX), but I doubt it would teach how to write decent physics simulation from scratch - it is a big topic, and there's a reason why existing engines were in development for a long time...

Mastering C++ to prepare for my second year: How?

I'm going to my second year of Computer Science at a local University, in which C++ is a large part of the education, but as they only give an introductory course in the first year (basics, pointers, creating a linked list and an implementation of a game like Mastermind), I'd like to program a bit in my free time to crank up my knowledge about the language.
Is there a site that shows little problems or projects to make, to crank up my knowledge? As reading in "The C++ programming language", or saying "I'm going to crank up my knowledge about x" isn't quite as handy to learn from, compared to saying "I'm going to create a mastermind game", which can be extended quite far, and those are the kind of projects that they give in School classes that are excellent to master the language from.
So in short: Are there any sites which offer little problems and projects like this?
Thanks!
A really good resource is http://projecteuler.net/index.php?section=problems, it builds both programming language familiarity and your list of programming algorithms (not to mention keeping your math skills sharp).
However I wouldn't worry too much about it, universities have this weird Java and Matlab fetish, I don't think I had a single C++ class in 4 years. My suggestion to you is to focus on algorithms more than the actual language. All you need for university is recursion and loops, and all languages have those.
in my uni we started with C, then moved to C++ (first year). Then did Java and C++ OO programming (second year). Then did recursive programming (OCaml) and Formal Languages and Compilers course were we extended a mini Pascal language adding pointers, structs and references by writing and interpreter. Was good fun!
Then I did an 2 years MSc in Bioinformatics and lost my skills and failed a few interviews. Now I am back on fit and I am working daily with C++.. hate my collegues when they think that they are clever when speaking about pointers and references.. so stupid! At the very end are just very very basics concepts.
Java programming sometimes is difficult as involves complex design patters and web services interaction. C++ on the other hand is "difficult" for memory allocation etc..
learn Objective-C and use C++ in your Mac/iPhone application instead.. make some money and experience writine iPhone apps during ur free time.. the standford uni videos on iTunes are very easy to follow!

gametutorials.com questions and reviews DirectX tutorials

Just curious to know if anyone has ever used gametutorials.com products for learning directX. I was debating on whether I should buy it or not. I read online that most of his tutorials were written in the source code. It's nice to heavily comment your code but if most of the tutorial is in his code then I don't think that is necessarily the best way to do a tutorial. But anyhow, I am not sure about that, I am just checking for clarification. and checking to see if it would be a good investment.
The problem is that the site is trying to teach you C++ and game programming at the same time. I think trying to do both at the same time is a terrible idea. Game programming is tough, and if you don't know C++ you're just setting yourself up to either fail, or get by with sloppy (and sometimes downright awful) code. So don't do both at the same time: you must learn C++ first, then get into making games. And GameTutorials isn't a resource to help you do that.*
If you don't know C++ yet, do not learn it from any online resource. Books are always a better choice here. I recommend C++ Primer or Accelerated C++. There's a more complete list here.
Both of those costs half as much, and give you a full fleshed-out C++ learning experience. The site I can't speak for, but it doesn't appear to give too fleshed out a tutorial, partly because it keeps mixing it with gaming stuff. You're better off getting tried-and-true books.
If you know C++, then you'd be wasting money on stuff you already know. Get a good Direct3D book. I don't have any modern books on me to recommend, but here's a big list. :) The two (one for DX10, one for DX9) by Luna seem to be good looking, but I don't really know. In any case, a bit more research will tell you what Direct3D book to buy.
*I don't like to speak against things that mean well, but I think the site is really just in a poor position. Teaching C++ and Game Programming shouldn't go hand-in-hand.

Resources for learning C++ for game programming [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am a relatively newbie in C++ and have worked in the game industry for a few months. I am looking to get back into the industry and understand that one needs to be a very good C++ programmer (mainly because of how competitive it is to get into making games). I was wondering if there are any really good websites online that would help with that. Basically I am looking for something that would help me master C++ concepts and help me be a good coder through practicing programming examples.
Scott Meyers' books: "Effective C++", "More Effective C++", and "Effective STL" are absolutely essential for you.
Add to that "Modern C++ Design" by Andrei Alexandrescu.
Someone once said that it takes 10 years to learn C++. Having 14 years of C++ experience and still regularly learning new things, I'd say it's true. I would hesitate to call myself a C++ expert even after my considerable experience. Don't expect to master it overnight... you will go through many phases where you think you get it, then you'll discover a whole new world (for lack of a better term; I believe Richard Dawkins refers to this process as "conciousness raising"). I've come to accept that another one of these epiphanies is always ahead of me, hence why I'm not calling myself an expert.
That said, you must practice practice practice. I'll 2nd (or 3rd, or 4th, whatever we're at now) Gamedev.net. I spent a lot of time there back in the day...
GameDev.net.
In Resources, there is a "For Beginners" section. Read through all of this!
C++ FAQ Lite is good. You can learn a lot from that website and there is also a related book which is also good.
The books by Scott Meyers contain very good specific advice too.
C++ is a great language and I love it. It builds ridiculously fast code. With good use of profilers, profile driven optimizers, intermodule optimizers, const and restrict keywords, MMX/SSE/vector intrinsics and other stuff it can build ludicrously fast code.
You probably have your eye on job listings from the bigger game companies and there is a lot of C++ demand.
That said, it isn't the only way to develop games. I just want to present some alternatives.
Microsoft's .NET stuff works pretty well. Check out their XNA platform.
You can also write awesome games even in Java. There is a Java version of Quake2 that can get 1,000 FPS in some areas on my Core I7 system at home. Most of the heavy work is in the OpenGL and graphics drivers of course.
Tons of people are writing fun games in Flash, which has language performance much worse than Java or .NET.
I totally recommend Brucke Eckel's: Thinking in C++
You can download for FREE at his webpage.
http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html
That should help you master C++, from there, you can start reading code from engines, like Ogre3D, that would be a better learning.
Later, you should check out books from GameDev.net, they are really cool. But in my opinion, the articles found in GameDev are outdated.
www.gamdev.net is an excellent resource for game programming.
I would also recommend the Game Programming Gems Series.
As far as mastering C++ concepts, who better to learn from than the guy who created C++?
He wrote this: C++ Programming Language
One way to get back in and have fun at the same time is to go through Nehe's OpenGL tutorials, or by using higher-level gaming frameworks such as Irrlicht or Ogre3D
You should check out wildmagic at http://www.geometrictools.com/. This is a nice game engine with lots of sample code and related books. I'd highly recommend it as a deep examination of game engines on c++.
I learned C++ (having no previous coding experience) with the following books:
"C++ Without Fear" by Brian Overland
"Sams Teach Yourself C++ in 24 Hours" Fourth Edition
And
"Beginning Game Programming through C++" Second Edition by Jonathan S. Harbour
The first one is very good and ver detailed, if a bit slow to read. The second I use mostly as a reference, the last one is very useful and quick to read, but it uses the phrase "beyond the scope of this book" fairly often.
The C++ Programming Language
by Bjarne Stroustrup.
I use this to this day. It contains succinct descriptions of all the features of the C++ language. When I search on the web for this information, it's flourished beyond clear understanding. Bjarne did a really good job of clearly defining all the principles of the language, and it's a must-have. I haven't read the whole book, but I've read sub-sections.
(Also gave a vote up for Effective C++, Effective STL, and Exceptional C++ (Sutter))
The above are good suggestions for learning C++ and games...
I will give you a recommendation for software if you just want to make games without a lot of programming background...
You could quickly make simple games and then learn the C++ and other languages it really takes to make serious games...
Software:
Gamemaker
http://www.yoyogames.com/make
The Games Factory 2
http://www.clickteam.com/eng/tgf2.php
Books
Picture Yourself Creating Video Games, 1st Edition
Awesome Game Creation: No Programming Required, 3rd Edition
Make Amazing Games in Minutes, 1st Edition
Good luck to you...
I'd recommend starting with the basics:
The C programming language, by Kernigan and Ritchie.
With this book you'll be closer to C's internals than with others. Then you can go with C++ books.

Is the PS3's Cell architecture the wrong platform to be learning game programming?

I have an opportunity to attend Sony licensed training classes to learn about programming with the PS3's cell architecture.
However I only have a rudimentary knowledge of C++ and was wondering if the PS3 is a bit of an overkill for a starter aspiring game dev like me.
And also what is the best resources to get me to a decent level in C++ graphics programming in about 2 months time?
I bet it will be fun and whatever you learn in the course will help you become a better programmer.
Finally a question about my day job.... :)
A lot of what you learn about PS3 will be applicable to other architectures, as parallel programming is starting to look like the future. A lot of the parallel techniques used on PS3 are directly applicable on Xbox 360. I suspect a lot of the future game consoles will be going in the same direction, and we'll all need to start thinking about parallelization a lot more than we may currently.
That said, if you have only a rudimentary knowledge of C++, a lot of the material may be over your head. It depends on what you want to get out of the session I suppose. Are you looking for an intro to PS3, or were you hoping to be able to start making games in PS3 Linux the day after the conference?
Assuming you can afford it, the info will be interesting and probably helpful. I wouldn't pass up an opportunity like this unless you feel the cost outweighs the benefits. (I'm assuming there's a cost, I don't really know.)
Game programming resources are all over the net. If you want to do a crash course in C++ I'd pick up C++ Primer by Lippman et al. If you want a crash course in graphics then Real Time Rendering is the best starting place, along with a good book on math like Eric Lengyel's Mathematics for 3D Game Programming. Dig through some OpenGL or D3D tutorials as well; even if neither is commonly used on PS3 the principles are the same as any API.
The problem isn't so much that a PS3 is overkill, it's that the Cell processor is notoriously difficult to program to it's potential. The highly parallelized architecture is potentially quite powerful, but it's not easy to actually get that performance.
I think it's a great architecture to prepare for the future (multi-core programming). However, for most practical purposes you are actually better off learning windows-based game development since startup costs with consoles are much higher. For example, it would be much easier to start coding for DirectX.
So yes, in some ways you're seeking trouble. If you do decide to go with the PS3, make sure to check out the MIT PS3 course.
No not at all, it's just going to be harder if your use .NET as your primary language. If you want to use .NET I would recommend C#/XNA for the XBOX 360.
Edit:
Here is a great link to get you started: http://www.cag.csail.mit.edu/ps3/
I think if you have the opportunity to attend vs doing nothing at all you should definitely go for it. The payoff from learning something from someone that knows more than you is a gift that a lot do not have. The fact that it's from a licensed trainer makes it all the more worthwhile.
He's specifically talking about LEARNING C++ while learning the PS3 architecture, libraries, special tricks, etc. I would not suggest doing that. You need to be strong in your C++ kung fu to code well on the PS3 and you will make a huge fool of yourself if you show up and don't even know the language.
Worst off you will be wasting professional developer's time. They could actually use the info but you'll be eating up time with newbie questions you should already know.
I'm not trying to be mean; I wouldn't go either because I don't know C++ very well. Just try to be considerate of the other people that payed to go there.
I've been teaching myself Cell processor programming (in C) for the last couple of months. It is definitely not the best place to start, since successfully programming the Cell requires mastering a lot of skills: C/C++, pthreads, libspe, the various types of communication on the cell (DMA, Mailboxes, Signals, Interrupts, Atomic I/O). To make this harder, the documentation for the Cell can be cryptic, hard to find, and wrong. If you use a more common platform (XNA, pyGame, SDL), there will be a much larger community of users. That is not to say that there isn't any community of users for the Cell, just that it is smaller. And even though there are other environments where one might find multi-processor programming, it can be difficult to translate techniques for these environments to the cell, due to its unique architecture. Also, using a standard PS3 with linux won't allow you to access the graphics hardware.
But it's not all bad. Learning the PS3/Cell will teach you a lot about programming close to the machine. You really don't have any choice, as there are not very many abstractions available to the programmer. Each SPU on the Cell has 256KB of local memory and if you need more than that, then you will need to figure out some sort of scheme to issue the correct DMA requests to bring the right values into memory at the right time and (hopefully) keep the SPU busy doing something while that DMA request is in flight. Learning the Cell
So, maybe not the best platform for learning, but given that you have the opportunity to take classes from Sony, this sounds like a good opportunity.
In any case, if you are interested, the book from Scarpino is a great reference, and has a couple of chapters about game programming on the cell with the OGRE engine, which might also be interesting to you.
Although I have no experience developing applications on the 360 or the PS3, I have done a lot of research into the various merits of the two platforms. I have used C++ for a long time now, and even though I've built several MFC and BeOS applications with it, I've build a number of UNIX server applications with it, and still the console game environment is significantly different.
The PS3's Cell chip is really quite a beast to tame, as others have said here, and takes a Carmack-level of talent to properly utilize. That being said, there's nothing wrong with attending a course if it's free, especially if you get to meet people that have developed games before and could give you some advice.
If you want to develop games for a console, the best bet for someone with only a rudimentary knowledge of C++ is to use the C#-based XNA kit for the Xbox 360. If you're familiar with the way C++ works, C# isn't that hard to pick up. In fact, I'd argue it's a much smaller learning curve than to make the jump to multi-core, multi-thread Cell-based programming. If you've never developed kernel-level applications before, you should steer clear of that sort of thing until you're ready. Two months is not enough time.
There are a number of points that make the XNA platform very compelling for aspiring console developers, not the least of which is the relative safety of C# vs. C++, and the fact that XNA games can be sold through the Microsoft marketplace.
I don't know of many PS3 games that have been developed single-handedly, but there are a few examples on the 360 such as Braid that are pretty much solo efforts. The XNA examples are also quite interesting and educational.