Chapter 8

Input Systems

This chapter takes an in-depth look at a wide variety of input devices for games, including the keyboard, mouse, and controller. It explores how to integrate these devices into a cohesive system that all actors and components in the game can interact with for their input needs.

Input Devices

Without input, games would be a static form of entertainment, much like film or television. The fact that a game responds to the keyboard, mouse, controller, or another input device is what enables interactivity. You query these input devices for their current state during the “process input” phase of the game loop, and this affects the game world during the “update game world” phase of the game loop.

Some input devices yield only ...

Get Game Programming in C++: Creating 3D Games, First Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.