Learning C++ by Building Games: Fundamentals, Second Edition book cover
✓ Free to read online

Learning C++ by Building Games: Fundamentals (2nd Edition)

The math your game engine hides — built by hand in modern C++, and free to read online.

35 Chapters 36 Demos C++
Read the whole book free →

Prefer it on your shelf or your Kindle? Get the ebook & paperback on Amazon →

The math your game engine hides

Open any game engine and you'll find a Vector3, a Physics.Raycast, a rotation matrix — tools you can lean on for years without ever knowing what they do. This book is where you find out. Starting from an empty window, you write the vectors, the dot and cross products, the collision tests, the physics, the pathfinding, and — by the final chapters — every pixel of a small software 3D renderer, all from scratch, in modern C++. SDL 3 opens a window and draws a triangle; everything of substance is your own code, shown and explained line by line.

Free to read, start to finish

The complete second edition is free to read online, right here — all thirty-five chapters, no sign-up, no paywall. Start reading →

It is, on purpose, not a "build one big game" book — and that's the point. Instead of a sprawling project you can lose the thread in, every idea gets its own tiny interactive demo you run and poke at with the mouse, so the concept you're learning stays front and centre. You watch a dot correctly chase your cursor, a fast bullet finally stop punching through a thin wall, a textured cube spin without warping. The demos stay small; the understanding doesn't. When you'd like it offline and on your shelf, it's on Amazon as a Kindle ebook and paperback.

What you'll build

Every demo's complete, ready-to-run project is on GitHub, one folder per demo, with SDL bundled so each opens and runs as it comes.

Who it's for

Intermediate C++ programmers who are comfortable with classes, references, and std::vector. You need no prior game-math background — the one feature beginners often haven't met, operator overloading, is taught the moment it's first needed. Newer than that? The companion Learning C++ by Building Games starts you from zero and builds the games this book goes underneath.

Read it free, right now. The whole second edition is online here — all thirty-five chapters, from a single point on the screen to a textured 3D scene, free. Read free →