r/cpp • u/CelesticRose • Apr 23 '16
Just started coding with C++
I just started coding with C++ not too long ago, but I've had alot of experience with other coding languages (Java, Javascript, HTML, Python.) But if I'm aiming to make games with C++ one day (After years and years of practice of course) what do I need to learn? What books do you recommend? What exercises should I practice? As far as I know there's no website to 'teach' the subject (Like CodeAcademy and what not), so what would you recommend to get me started?
1
Upvotes
3
u/[deleted] Apr 25 '16
/u/TheQuantumZero recommended the best libraries but I would add that raw opengl is difficult and not neccessary. I use Horde3d for rendering as it's really simple to use, the code is short and simple so it's easy to modify if there is a need.
Further for GUI stuff libRocket is a good choice if you can get it to work.
Squirrel is a good scripting language for embedding in games.
Also there's this book which is a must read.
Furthermore game development requires writing high-performance code. I would recommend reading up on the following topics:
Noticing that all the languages you listed are dynamically typed, you should get familiar with static typing as well as understanding how it benefits performance. learn about how classes and templates in C++ are implemented
Learn the difference between stack and heap memory, value and reference semantics, and how to use containers and smart pointers, look up RAII and move semantics.
Multi-threading is fairly important, so make sure to learn the basics of threads and atomics (atomics might be a bit more advanced, and unnecessary). OpenMP is very useful in this domain.
Finally, one of the most important things for performance is memory locality, learn to understand the cache and possibly also how to use placement new to take control over memory layout.
I might update this list with some links to resources but you can probably google yourself, I'm at school at the moment so ain't got the time.
Oh and since I didn't see anyone else mention it cppreference.