Appendix A

Glossary

Plain definitions of the terms this book teaches, from A* to working directory. The chapter in parentheses is where each one is taught, and where there are two, the term is met in the first and taught in full in the second, or taught in two parts. A term in bold inside a definition is defined there too.

A* (Ch33) — A pathfinding search that always looks next at the most promising cell: the one whose steps so far, plus a guess at the steps still to go, add up to the least. It finds the shortest path while looking at far fewer cells than a breadth-first search.

Abstract class (Ch22) — A class with at least one pure virtual function, which you can't make an object of. A class derived from it that overrides every pure virtual function is concrete, and can be made.

Accept, edit, or reject (Ch25) — The three choices for every piece of code an AI writes: keep it as it is, change it yourself, or throw it away and try again with a clearer prompt.

Access specifier (Ch18) — The word public, private, or protected, followed by a colon, which says who may use the members below it in a class.

Access violation (Ch10) — A crash that happens when a program tries to use memory that doesn't belong to it, often by following a null or dangling pointer.

Accumulator (Ch17) — A timer that collects each frame's delta time and pays it out in fixed amounts, such as one animation frame every 0.08 seconds, keeping whatever is left over for next time.

Address (Ch1, 10) — The place in memory where a value lives. The address-of operator, an & in front of a variable, gives its address.

Address Sanitizer (Ch24) — A Visual Studio setting that makes a program check its own use of memory while it runs, and stop at the first pointer mistake.

Address-of operator (Ch10) — See Address.

Alpha (Ch1) — A color's fourth number, its opacity: from 0, completely see-through, to 255, completely solid.

Argument (Ch1, 8) — A value handed to a function in a call's parentheses. Inside the function, it becomes the value of the matching parameter.

Array (Ch7, 13) — A numbered list of values of one type, kept side by side in memory under one name, with a size that's fixed when it's made.

std::array (Ch13) — An array with a fixed size that remembers its size, and can check its indexes.

Array of structures (AoS) (Ch29) — Keeping many objects as one list of whole structures, each holding every member of one object, as a std::vector of particles does. Compare Structure of arrays.

Arrow operator (Ch10) — ->, which follows a pointer and takes a member of what it points at, so target->health means (*target).health.

Assignment operator (Ch2) — The = used on a variable that already exists, which puts the value on its right into the variable on its left. In a declaration, the = is initialization instead.

Audio stream (Ch34) — SDL's queue for sound: the game puts samples in whenever it likes, and SDL takes them out as fast as the playback device needs them, converting them if it has to.

auto (Ch2) — A keyword that asks the compiler to work out a variable's type from the value it starts with.

Axis-aligned bounding box (AABB) (Ch5) — A rectangle whose sides line up with the window's edges. Two of them overlap when they overlap across and down at once, which is the collision test behind most of this book's games.

Back buffer (Ch1) — The hidden picture a renderer draws into while the screen shows the last finished one. Presenting swaps them, so the player only ever sees whole frames, and that trick is double buffering.

Base case (Ch8) — The condition in a recursive function that answers directly, without calling itself again, so that the calls come to an end.

Base class (Ch20) — A class that another class inherits from, also called a parent class or a superclass. See Derived class.

Big O notation (Ch13, 15) — A way of saying how the work of an operation grows with the number of elements, n: O(1) stays the same, O(n) grows in step with n, and O(log n) grows very slowly.

Binary space partitioning (BSP) (Ch31) — Building a dungeon by cutting the map in two, then cutting each piece in two, again and again, and putting a room in each of the final pieces, the leaves.

Bit (Ch2) — A single 0 or 1, the smallest thing memory can hold. Eight bits make a byte.

Bitwise or (Ch34) — The single bar, |, which makes a number with every bit that's set in either of two numbers. It combines flags, as in SDL_INIT_VIDEO | SDL_INIT_AUDIO, and isn't the logical ||.

bool (Ch2) — The type that holds only true or false, short for Boolean, after the mathematician George Boole.

Branch prediction (Ch29) — The processor guessing which way an if will go, and carrying on down that path before it knows. A right guess is almost free, and a wrong one throws the work away.

Breadth-first search (Ch33) — A search that looks at every cell one step away, then every cell two steps away, and so on. It always finds the shortest path, but it looks at a great many cells to do it.

break (Ch4, 6) — Leaves a switch, or the loop it's in, at once.

Breakpoint (Ch1) — A marker on a line of code that pauses the program just before the line runs, so that you can look at every variable.

Bug (Ch1) — A flaw that makes a program do something other than what you meant. Finding and fixing one is debugging.

Byte (Ch2) — Eight bits, the unit that memory is counted in.

Cache (Ch29) — A small, fast memory between the processor and the RAM. The L1 cache is the smallest and quickest, the L2 cache is bigger and slower, and the L3 cache, shared by all the cores, is the biggest.

Cache hit, cache miss (Ch29) — A fetch that finds its data in a cache, and one that has to go further, to a bigger cache or all the way to the RAM.

Cache line (Ch29) — The 64-byte block that memory moves in between the RAM and the caches, so reading one value brings its neighbors along with it.

Call stack (Ch8) — The pile of stack frames, one for each function that has been called and hasn't returned yet. Visual Studio's Call Stack window shows it while a program is paused.

camelCase (Ch2) — Writing a name with its first word in lowercase and each later word starting with a capital, as in playerScore. This book names its variables and functions this way.

Capacity (Ch13) — How many elements a vector has room for before it has to move into a bigger block of memory. Its size is how many it holds.

Capture list (Ch24) — The square brackets at the start of a lambda, which say which of the variables around it the lambda can use, and whether as copies or by reference.

Cast (Ch2, 24) — Converting a value to another type on purpose. C++ has four named casts: static_cast is the everyday one, and dynamic_cast asks, while the program runs, what kind of object a base pointer really points at.

Cell (Ch16, 30) — One square of a grid, such as the Loot Grid's board or Rogue SDL's map, found by its column and its row.

char (Ch2) — The type that holds a single character, such as a letter, a digit, or a punctuation mark.

Circular include (Ch28) — Two headers that each include the other, which leaves the compiler reading one class before the other has been declared. A forward declaration breaks the circle.

Class (Ch18) — A blueprint for objects, bundling data with the functions that work on it, and deciding which parts the rest of the program may touch. Its members are private unless it says otherwise.

CMake (Ch24) — A tool that describes how to build a project once, and makes the build files for Visual Studio, or for other tools on other systems.

Color modulation (Ch11) — Tinting a texture as it's drawn: each pixel's red, green, and blue are multiplied by the numbers given, divided by 255.

Comment (Ch1) — Text in code that the compiler ignores, written for people. A single-line comment runs from // to the end of the line, and a multi-line comment from /* to */.

Comparison operators (Ch4) — ==, !=, <, >, <=, and >=, which compare two values and give a bool.

Compile time (Ch2) — While the compiler is building the program, as opposed to while the program runs.

Compiler (Ch1) — The program that turns source code into machine code, the instructions a processor runs, checking it on the way.

Compiler warning (Ch4) — A message about code that's legal but suspicious. Unlike an error, it doesn't stop the build, but it's always worth reading, and a higher warning level, such as /W4, reports more of them.

Component (Ch28) — A small class that does one of a game object's jobs, such as its input, its physics, or its graphics.

Component pattern (Ch28) — Splitting a game object along the lines of its jobs, so that the object becomes a thin container of components, which different objects can share or swap.

Composition (Ch18) — Building a class from other classes, held as members, which is a has-a relationship: a player has a weapon. Compare Inheritance.

Compound assignment operators (Ch2) — +=, -=, *=, /=, and %=, which do their arithmetic with the value on the right and store the result back in the variable on the left.

Confidence problem (Ch25) — An AI sounds just as sure when it's wrong as when it's right, so its tone tells you nothing about whether it's correct.

const (Ch2, 18) — A promise that a value won't change once it's set. On a member function, it's a promise that the function won't change the object it's called on.

Const pointer, pointer to const (Ch10) — A pointer to const can't change what it points at, but can be pointed somewhere else. A const pointer is stuck pointing at one place, but can change what's there.

Const reference (Ch8) — A reference that can read the original but never change it, the usual way to pass anything bigger than a simple number to a function that only reads it.

Constant (Ch1, 2) — A named value that stays fixed while the program runs, such as WINDOW_W, made with const or constexpr.

constexpr (Ch2) — Like const, but stronger: it promises that the value is known at compile time.

Constructor (Ch18) — A member function that runs by itself whenever an object is made, to get it ready to use. It has its class's name, and no return type at all.

continue (Ch6) — Skips the rest of a loop's body, and carries on with the loop's next pass.

Copy assignment operator (Ch18) — The operator= that copies one existing object over another. The compiler writes one that copies each member in turn.

Copy constructor (Ch18) — The constructor that makes a new object as a copy of an existing one. The compiler writes one that copies each member in turn.

Dangling pointer (Ch10) — A pointer to memory that has already been given back. Following one can crash the program, or quietly corrupt its data.

Data locality (Ch29) — Laying data out so that the processor can stream through it: kept together, in the order it's used, with the parts that are used together packed tightly.

Debug build (Ch1) — The kind of build Visual Studio makes by default, with extra checks and no optimizing, so that it's easy to investigate. Compare Release build.

Debugging (Ch1) — Finding and fixing bugs, often with a debugger's breakpoints, and stepping through the code a line at a time.

Decay (Ch13) — What happens to an array passed to a function: it turns into a pointer to its first element, and its size is lost on the way.

Declaration (Ch2, 8) — Introducing a name, with its type, to the compiler. A function's declaration, or prototype, gives its name, parameters, and return type, without its body. See Definition.

Default argument (Ch8) — A value given to a parameter in a function's declaration, which is used whenever a call leaves that argument out.

Default constructor (Ch18) — A constructor that takes no arguments. The compiler writes one only for a class that has no constructor of its own.

Default member initializer (Ch11, 34) — A starting value written beside a member where it's declared, as in int health = 100;, which every new object gets unless a constructor gives it another.

= default, = delete (Ch18) — Written after one of a class's special member functions: = default asks the compiler for the version it would have written, and = delete says the function doesn't exist, so using it is an error.

Definition (Ch8) — The whole of something, such as a function with its body, as opposed to a declaration, which only names it. A program can declare a function many times, but define it only once.

Delta time (Ch1) — How long the last frame took. Multiplying each movement by it keeps a game running at the same speed on any computer.

Deque (Ch15) — A double-ended queue, said "deck," which is quick to add to and remove from at both ends.

Dereference (Ch10) — To follow a pointer to the value it points at, with *, the dereference operator.

Derived class (Ch20) — A class that inherits from a base class, also called a child class or a subclass. It has everything its base has, and adds or changes things of its own.

Destination rectangle (Ch11) — The rectangle that says where in the window a texture, or part of one, is drawn. See Source rectangle.

Destructor (Ch10, 18) — A member function that runs by itself when an object is destroyed, to clean up after it. Its name is the class's name after a ~.

Diamond problem (Ch20) — A trap in multiple inheritance: two base classes share a base of their own, so the derived class ends up with two copies of it.

Domain (Ch28) — One area of a game object's work, such as its input, its physics, or its graphics. The Component pattern gives each domain a component of its own.

Double buffering (Ch1) — See Back buffer.

Double free (Ch10) — Giving the same memory back twice, which can crash the program or corrupt its data.

Dynamic binding (Ch22) — Choosing which function to run by an object's real type, while the program runs, which is what virtual asks for. It's also called dynamic dispatch. Compare Static binding.

Dynamic library (DLL) (Ch1) — A file of ready-made code, such as SDL3.dll, that a program loads each time it starts, rather than having the code built in.

Early return (Ch8) — A return near the top of a function that deals with a special case, so that the rest of the function doesn't have to.

Element (Ch13) — One item in an array or a vector, reached by its index.

Encapsulation (Ch18) — Keeping a class's data private, and letting only its own member functions look after it.

Entity-Component-System (ECS) (Ch28) — An engine design in which an entity is just an ID, components are plain data, kept in one array for each kind, and systems each work through one of the arrays.

Enumeration (Ch4, 11) — A type that names a fixed set of choices. An enum class, as in MoleState::Hidden, puts the type's name in front of each value, so the values can't be mixed up with plain numbers or with each other.

Erase-remove idiom (Ch13) — Removing every matching element from a vector in two steps: std::remove moves the ones to keep forward, and erase cuts off what's left. C++20's std::erase and std::erase_if do both at once.

Event (Ch1) — SDL's message about something that has happened, such as a key press, or a click on the window's X. Events wait in a queue until the game reads them.

Exception (Ch13, 24) — C++'s way of reporting an error that a program can't just carry on from. It's thrown with throw, and can be caught in the catch block of a try. If nothing catches it, the program stops.

Factory function (Ch28) — A function that makes an object to a recipe, such as a runner with a particular input and pace, and hands it back.

Fall through (Ch4) — What a case in a switch does when it has no break: it carries on into the next case's code.

Field of view (FOV) (Ch31) — The cells a player can see from where they stand, worked out by checking the line from them to each cell for walls.

File stream (Ch24) — The standard library's way of writing files, with std::ofstream, and reading them, with std::ifstream, which work just like std::cout and std::cin.

final (Ch22) — Marks a class that can't be inherited from, or a virtual function that can't be overridden any further.

Flag (Ch3) — A bool that records a yes-or-no state, such as running or gameOver.

Floating-point number (Ch2) — A number with a fraction, stored in a float, or, more precisely, in a double.

for loop (Ch6) — A loop with three parts in its parentheses: a start, a condition checked before each pass, and an update made after each pass. See also Range-based for loop.

Forward declaration (Ch28) — A line such as class GlyphCache;, which tells the compiler that a class exists, without its members. That's enough for a header that only refers to the class.

Frame (Ch1) — One trip around the game loop, and the single still picture it draws. A picture in a sprite sheet is a frame too.

Frames per second (FPS) (Ch19) — How many frames a game draws each second, its frame rate. With vsync on, it matches the monitor's refresh rate.

Free function (Ch18) — A function that doesn't belong to any class.

Friend (Ch24) — A function or class that a class names as allowed to see its private members.

Front-loading the constraints (Ch26) — Putting everything an AI needs to know into the first prompt: the versions, the files, the data structures, and the style.

Function (Ch8) — A named block of code that does one job. You write it once, and call it by name whenever you want the job done.

std::function (Ch24) — A type that can hold any function, or lambda, with a given shape of parameters and return type.

Function call operator (Ch33) — operator(), which lets an object be called as if it were a function.

Function overloading (Ch8) — Several functions with the same name but different parameters. The compiler picks one by looking at the arguments.

Function pointer (Ch10) — A pointer to a function, which the function can be called through. Modern C++ mostly uses a lambda for the same jobs.

Game loop (Ch1) — The loop at the heart of every game, which handles events, updates the game, and draws it, many times a second.

Game object (Ch28) — A thing in a game that's made of components, such as a runner.

Getter, setter (Ch18) — A member function that hands back the value of a private member, and one that changes it, able to check the change on the way.

Global variable (Ch8) — A variable made outside every function, which any function in the file can use. A global constant is fine, but a global that changes is trouble.

Glyph (Ch30) — The drawing of one character in a font.

Glyph cache (Ch30) — Rogue SDL's set of textures, one for each printable character, made once from the font, in white, and tinted as each is drawn.

God object (Ch28) — One class that knows everything and does everything, which every growing game tends toward.

Hallucination (Ch25) — An AI inventing something, such as a function that doesn't exist, and presenting it as confidently as the truth.

Has-a (Ch18) — See Composition.

Hash table (Ch15) — A collection, such as std::unordered_map, that turns each key into a number, its hash, which picks one of its buckets, so it can go straight to the right place instead of searching.

Header file (Ch1, 18) — A file, ending in .h, that describes what something looks like, such as SDL's functions or one of your classes, so that other files can include it and use it.

Heap (memory) (Ch10) — The region of memory for things made with new, which stay until they're deleted, however big they are. Compare Stack (memory).

Heap (priority queue) (Ch33) — An arrangement of a vector's elements as a tree, with the biggest, or the smallest, always on top, which is how std::priority_queue works. It's no relation of the memory heap.

Helpful drift (Ch25) — An AI doing more than you asked, such as renaming things or adding features, which can be useful, noisy, or destructive.

Hexadecimal (Ch10) — Base 16, written with the digits 0 to 9 and the letters A to F. Memory addresses are shown in it.

Hitbox (Ch17) — The rectangle a game checks collisions against, often smaller than the picture, so that a near miss looks like one.

Hot and cold data (Ch29) — The members a loop reads every frame, and the ones it rarely touches. Keeping them apart lets the loop stream through less memory.

HUD (Ch11) — Short for heads-up display: the score, the timers, and the other information drawn over a game.

IDE (Ch1) — An integrated development environment: one program, such as Visual Studio, with a code editor, a compiler, and a debugger.

if, else (Ch4) — An if runs code only when its condition is true, and an else after it runs other code when it isn't.

Implicit casting (Ch2) — A conversion that C++ makes by itself, such as a float into an int. That one loses the fraction, so Visual Studio warns about it.

Import library (Ch1) — A .lib file, such as SDL3.lib, that lists what's in a DLL, so that the linker can check each call, and leave a note in the program to load the DLL.

#include (Ch1) — A line that pastes another file, usually a header, into this one before it's compiled.

Include guard (Ch18) — See #pragma once.

Increment, decrement (Ch2) — The operator ++ adds one to a variable, and -- takes one away. Written before the name, the prefix form changes the value first; written after it, the postfix form hands over the old value first.

Index (Ch13) — An element's position in an array or a vector, counted from 0, and written in square brackets.

Infinite loop (Ch6) — A loop whose condition never becomes false, so that it never ends.

Inheritance (Ch20) — Making a class from another class, so that it has everything the other has. It models an is-a relationship. Compare Composition.

Initialization (Ch2) — Giving a variable its first value as it's made, as in int lives = 3;.

Interface (Ch22) — A class with no data, only pure virtual functions and a virtual destructor: a list of promises that other classes can keep.

Is-a (Ch20) — The test for inheritance: a chaser is an enemy, so ChaserEnemy can inherit from Enemy.

Iteration (Ch6) — One pass through a loop.

Iterator (Ch13) — A small object that marks a position in a collection, like a smarter pointer. A collection's begin() gives one for the first element, and its end() one for the spot just past the last.

Juice (Ch34) — Sounds, flashes, and other touches that change how a game feels without changing its rules.

Key-value pair (Ch15) — One entry in a map: a key to look up, and the value it leads to.

Keycode (Ch1) — SDL's name for a key by the character it types, such as SDLK_ESCAPE. See Scancode.

Lambda (Ch24) — A small function without a name, written right where it's needed, often to hand to another function.

Linear interpolation (lerp) (Ch11) — Finding the value a fraction of the way from one number to another: a fraction of 0 gives the first number, and 1 gives the second.

Linked list (Ch29) — A list whose elements each live in a block of their own on the heap, called a node, linked by pointers. The standard library's std::list is one.

Linker (Ch1, 18) — The program that joins the compiled pieces of a program, and the libraries it uses, into a finished .exe.

Linter (Ch4) — A checker in Visual Studio's editor that looks for code that's legal but probably wrong, and underlines it.

Literal (Ch2) — A value typed straight into the code, such as 3, 2.5f, or "hello".

Little-endian (Ch34) — Storing a number that takes several bytes with its lowest byte first, as WAV files do, and as Intel and AMD processors do.

Local variable (Ch8) — A variable made inside a function or a block, which disappears when the function or the block ends.

Logical operators (Ch4) — && (and), || (or), and ! (not), which combine bool values into bigger questions.

Macro (Ch10, 24) — A name that the preprocessor swaps for something else, such as a value, before the compiler sees the code. Macros are made with #define.

Magic number (Ch2) — A number in code with nothing to say what it means. A named constant is the cure.

Manhattan distance (Ch31) — How far apart two cells are across, plus how far apart they are down, named after the grid of streets in Manhattan.

Map (Ch15) — A collection of key-value pairs, looked up by key. A std::map keeps its keys in order, in a tree, and a std::unordered_map doesn't: it uses a hash table.

Member (Ch2, 18) — A variable or function that belongs to a struct or a class. A member variable is something an object has, and a member function is something it can do.

Member initializer list (Ch18) — The list after a constructor's colon, which gives members their starting values as they're made.

Memory leak (Ch10) — Memory that was taken with new and never given back. A game that leaks keeps growing until something runs out.

Mixing (Ch34) — Adding the samples of several sounds together, so that they play at once.

Modulo (Ch2) — The % operator, which gives the remainder after dividing, so 10 % 3 is 1.

Mono, stereo (Ch34) — A sound with one list of samples for both speakers, and a sound with a list for each.

Monospaced (Ch30) — A font whose characters are all exactly the same width, as on an old typewriter.

Move (Ch10) — Handing an object's contents over to another object, rather than copying them, with std::move. A unique_ptr can be moved, but never copied.

Multiple inheritance (Ch20) — A class with more than one base class. It's safe for interfaces, and trouble elsewhere. See Diamond problem.

Name hiding (Ch20) — A derived class's function hiding every base-class function of the same name, whatever their parameters.

Namespace (Ch24) — A named group of names, such as std, which keeps them from clashing with names elsewhere. Anything outside every namespace is in the global namespace.

Nesting (Ch4, 6) — Putting one if inside another, or one loop inside another.

new, delete (Ch10) — The keyword new makes something on the heap and hands back a pointer to it, and delete destroys it and gives its memory back.

Normalizing (Ch20) — Turning a direction into one of length one, by dividing its parts by its length, so that it can be multiplied by a speed.

Null pointer (Ch1, 10) — A pointer to nothing. C++ writes it as nullptr, and it counts as false.

Object (Ch2, 18) — A value made from a class or a struct, with data of its own and member functions you reach with a dot. It's also called an instance of its class.

Object file (Ch18) — What the compiler makes from one translation unit, such as main.obj, which the linker joins with the others.

Object pool (Ch9) — A fixed set of objects, such as lasers, used over and over, each marked active or not, so that nothing has to be made or destroyed while the game runs.

Object-oriented programming (OOP) (Ch18) — Organizing a program around its things, each an object that holds its own data, does its own jobs, and decides who may touch its insides.

Observer (Ch23) — A raw pointer that uses an object something else owns, and never deletes it.

Off-by-one error (Ch6) — A loop that runs one time too many, or one too few, often from a <= where a < was meant.

Operator overloading (Ch24) — Writing what an operator, such as + or <<, means for a type of your own.

std::optional (Ch36) — A type that holds a value or nothing, and says which, as Rogue SDL's weapon slot does.

override (Ch22) — Written after a virtual function in a derived class, it asks the compiler to check that the function really does override one in the base.

Painter's algorithm (Ch11) — Drawing the back first and the front last, so that nearer things cover farther ones.

std::pair, std::tuple (Ch15) — A value that holds two others, as its first and second, and one that holds any number of others.

Parallax (Ch17) — Scrolling layers of scenery at different speeds, the farthest slowest, so that a flat screen looks deep.

Parameter (Ch8) — A variable in a function's parentheses, which gets its value from the matching argument in each call.

Pass by reference, pass by value (Ch8) — Handing a function the caller's own variable, through a reference, or a copy of its value, which the function can change without touching the original.

Path (Ch33) — A list of cells to step through, each one next to the one before, from one place to another.

Plausible nonsense (Ch25) — Code from an AI that compiles, looks reasonable, and is subtly wrong.

Playback device (Ch34) — Whatever plays the sound, such as speakers or headphones. SDL can open the one the rest of the computer is using, the default device.

Pointer (Ch1, 10) — A variable that holds an address: where something is, rather than the thing itself.

Polymorphism (Ch22) — One line of code that does the right thing for each kind of object it meets, through virtual functions. The word is Greek for "many shapes."

#pragma once (Ch18) — A line at the top of a header that stops it from being pasted into the same file twice. The older way is an include guard, made from #ifndef, #define, and #endif.

Prefetching (Ch29) — The processor fetching memory ahead of a program that's reading it steadily, before the program asks.

Preprocessor (Ch24) — The step before compiling that deals with every line starting with #, such as #include.

Priority queue (Ch15, 33) — A queue that always hands out its biggest item first, or, with std::greater, its smallest.

Private, public, protected (Ch18, 20) — Who may use a member: only the class's own member functions, any code at all, or the class and the classes derived from it.

Profiler (Ch29) — A tool that shows where a program spends its time, such as Visual Studio's Performance Profiler.

Project, solution (Ch1) — In Visual Studio, a project is one program's files and the settings for building them, and a solution holds one or more projects.

Prompt (Ch2, 25) — What you type to an AI. A good one gives the context, says what you want, and in what shape, lists the rules, and asks for the approach before the code.

Pure virtual function (Ch22) — A virtual function with = 0 on the end and no body, which every concrete derived class has to override.

Pushdown automaton (Ch35) — A state machine that keeps its states on a stack: the one on top is in charge, and closing it hands control back to the one below.

Queue (Ch15) — A collection that hands things out in the order they went in: first in, first out, or FIFO.

Radian (Ch12) — The unit that C++'s math functions measure angles in. A full turn is 2π radians, about 6.28.

RAII (Ch18) — Resource Acquisition Is Initialization: tying a resource to an object, whose constructor gets it and whose destructor gives it back, so that the cleanup can't be forgotten.

Range-based for loop (Ch6) — A for loop that visits every element of a collection in turn, as in for (int score : scores).

Recursion (Ch8) — A function calling itself on a smaller version of its problem, until it reaches its base case. Such a function is recursive.

Refactoring (Ch8) — Rearranging code into a better shape without changing what it does.

Reference (Ch8) — A second name for an existing variable. It must refer to something, and it can never be made to refer to anything else.

Reference cycle (Ch10) — Two objects held by std::shared_ptrs to each other, so that neither count can reach zero, and both leak. A std::weak_ptr breaks the cycle.

Registry (Ch17) — One place where everything of a kind is kept, and found by name, such as the Runner's map of textures.

Relative path (Ch11) — A file path that doesn't start with a drive letter, such as assets/grass.png, measured from the program's working directory.

Release build (Ch24, 29) — A build with the optimizer on and the debug checks off, the way a game ships, and the only kind worth timing.

Renderer (Ch1) — The part of SDL that draws in a window.

Return type, return value (Ch8) — The type a function hands back, written before its name, with void for nothing, and the value it hands back with return.

Rising edge (Ch9) — The moment a key goes from up to down, found by comparing its state in this frame with its state in the last.

Roguelike (Ch30) — A game in the tradition of Rogue, from around 1980: a turn-based dungeon crawler whose dungeons are new every time, and where a death means starting again.

Rule of three, rule of zero (Ch18) — A class that needs a destructor of its own almost certainly needs its copying dealt with too. Better still, build it from members that clean up after themselves, and write none of the three.

Sample (Ch34) — One number in a sound: where the speaker should be at one moment. The book's sounds have 44,100 samples a second.

Sandbox (Ch2) — This book's plain console project, with no SDL in it, for trying out the examples in the theory chapters.

Save scumming (Ch33) — Reloading a saved game after every mistake.

Scancode (Ch1) — SDL's name for a key by its position on the keyboard, such as SDL_SCANCODE_W, which stays the same on every layout. See Keycode.

Scope (Ch2) — The part of the code where a name exists and can be used, usually from where it's declared to the end of its braces.

Scope resolution operator (Ch18) — ::, which says what a name belongs to, as in std::cout or Player::takeDamage.

SDL (Ch1) — Simple DirectMedia Layer, a free, open-source library that gives a program a window, drawing, input, and sound, on many systems. This book uses SDL 3, with its add-ons SDL_image, for pictures, and SDL_ttf, for fonts.

Seed (Ch24) — The number a sequence of random-looking numbers starts from. The same seed always gives the same sequence.

Set (Ch15) — A collection that holds each value at most once, and answers whether a value is in it.

Shallow copy, deep copy (Ch18) — Copying a pointer member, so that both objects share what it points at, and copying what it points at, so that each object has its own.

Short-circuit evaluation (Ch4) — && and || stopping as soon as they know the answer, so that ptr != nullptr && ptr->health > 0 never follows a null pointer.

Signed, unsigned (Ch2) — A type that can hold negative numbers, and one that spends all of its values on zero and up.

Singleton (Ch18) — A class that allows only one object of itself, which the whole program reaches through a static member function.

Size (Ch13) — How many elements a collection holds. See Capacity.

Skill atrophy (Ch25) — Your own programming fading from disuse when you stop writing code and only prompt an AI.

Slicing (Ch20) — Copying a derived object into a variable of its base class, which keeps only the base part.

Smart pointer (Ch10) — An object that holds a pointer and deletes what it points at by itself: std::unique_ptr for a single owner, and std::shared_ptr for several, with std::weak_ptr to look without owning.

Source file (Ch18) — A .cpp file, which holds code for the compiler, such as a class's member functions.

Source rectangle (Ch11) — The rectangle that says which part of a texture to draw. See Destination rectangle.

Sparse, dense (Ch16) — Storing only the cells that hold something, as a map does, or every cell, as a grid does.

Specialization (Ch33) — A version of a template written for one type alone, such as std::hash<Point>.

Sprite sheet (Ch17) — Several pictures of a character in one image, such as the runner's six frames, played one after another to animate it.

Stack (collection) (Ch15) — A collection where the last thing in is the first thing out, or LIFO, like a pile of plates.

Stack (memory) (Ch10) — The fast region of memory that holds each function's local variables, in its stack frame, given back by itself when the function returns. Compare Heap (memory).

Stack frame (Ch8) — The memory for one call's parameters and local variables. See Call stack.

Stack overflow (Ch8) — Running out of stack, usually from recursion that never reaches its base case.

Stack unwinding (Ch24) — As an exception leaves one function after another, each function's local objects are destroyed, so their destructors clean up.

Standard library (Ch2) — The ready-made tools that come with every C++ compiler, from std::cout to std::vector, all in the namespace std.

State machine (Ch11, 35) — Something that is in exactly one of a set of named states at a time, where the state decides what it does, such as a mole that's hidden, rising, or up.

State pattern (Ch35) — Giving each state of a state machine a class of its own, with virtual functions for what the states do differently.

Static binding (Ch20) — Choosing which function to call from the type the compiler can see, which is what C++ does unless a function is virtual.

Static member (Ch18) — A member that belongs to the class itself, shared by every object, rather than one for each object. A static member function has no this.

static_assert (Ch33) — A check made while the program builds, which stops the build with a message if its condition is false.

static_cast (Ch2) — The everyday named cast, which converts a value to another type, and says so, as in static_cast<int>(position).

std::string (Ch2) — The standard library's type for text, which knows its own length, and can be joined to other text with +.

Structure (struct) (Ch2) — A type that bundles several variables, its members, into one named unit. Its members are public unless it says otherwise.

Structure of arrays (SoA) (Ch29) — Keeping one array for each member of many objects, rather than one array of whole objects. Compare Array of structures.

Structured binding (Ch15) — Naming the parts of a pair or a struct in one go, as in auto [name, score] = entry;.

Surface (Ch11) — An SDL picture whose pixels sit in ordinary memory, where the program can reach them. Compare Texture.

Swap and pop (Ch13) — Removing an element from a vector quickly, when the order doesn't matter: swap it with the last element, and pop the last one off.

switch (Ch4) — Picks the code to run from a list of case values, for whole numbers, characters, and enumerations.

Template (Ch10, 24) — Code with a type left blank, which is filled in where it's used, as in std::vector<int>. Chapter 24 writes function templates and class templates of its own.

Ternary operator (Ch4) — ? :, which picks one of two values from a condition, in a single line.

Texture (Ch11) — An SDL picture kept on the graphics card, where the renderer can draw it fast. Compare Surface.

this (Ch18) — Inside a member function, a pointer to the object the function was called on.

Thread (Ch24) — A separate path through a program that can run at the same time as the others, on another core.

Translation unit (Ch18) — One source file together with everything it includes, which is what the compiler works on at a time.

Tree (Ch15) — A way of keeping entries in order, where each has up to two below it, a smaller key on the left and a bigger on the right, so a lookup rules out about half of what's left at each step.

Truth table (Ch4) — A table of every combination of values going into a logical operator, and the answer for each.

Turn (Ch30) — One move in a turn-based game: the player acts, then every monster does, and nothing moves in between.

Type (Ch2) — What kind of value a variable holds, such as int or float, which decides what it can store and what can be done with it.

Type alias (Ch16) — A new name for an existing type, made with using, as in using Cell = std::pair<int, int>;.

Undefined behavior (Ch7) — Code that breaks C++'s rules in a way the compiler doesn't catch, such as reading past the end of an array, after which anything at all can happen.

Union (Ch2) — A close cousin of the struct, whose members all share the same memory, as SDL's events do.

Unnamed namespace (Ch31) — A namespace with no name, whose contents can only be used in their own file.

UPPER_SNAKE_CASE (Ch2) — All capitals, with underscores between the words, the tradition for constants, as in WINDOW_W.

Use after free (Ch10) — Using memory after it has been deleted, through a dangling pointer.

Using declaration (Ch20) — A line such as using Enemy::takeDamage;, which brings a base class's name into a derived class, undoing name hiding.

Value-initialized (Ch13) — Given its type's zero, as each new element of std::vector<int> tenItems(10) is.

Variable (Ch1, 2) — A named value that can change, with a type that says what it can hold.

std::vector (Ch13) — The standard library's dynamic array: its elements sit side by side on the heap, and it grows and shrinks as the program runs.

Velocity (Ch3) — A speed with a direction, split into an x part and a y part, whose signs say which way.

Vibe coding (Ch25) — Building a program by describing it to an AI, running what it writes, and steering it with more descriptions, rather than writing the code yourself.

virtual (Ch22) — Makes a function choose its version by the object's real type, while the program runs. See Dynamic binding.

Virtual destructor (Ch22) — A base class's destructor marked virtual, so that deleting a derived object through a base pointer destroys all of it. Any class with a virtual function needs one.

Vsync (Ch1) — Short for vertical sync: waiting for the monitor's next refresh before showing each frame, so the picture never tears.

vtable, vptr (Ch22) — The table of a class's virtual functions, one for each class, and the hidden pointer to it in each object, which is how a virtual call finds its function.

WAV file (Ch34) — A sound file that holds a short header, saying how its samples are stored, and then the samples themselves, uncompressed.

while, do-while (Ch6) — A loop that checks its condition before each pass, and one that checks after each pass, so that it always runs at least once.

Working directory (Ch1) — The folder a program treats as "here," where relative paths such as assets/ are measured from.