Handmade Hero
Modified 2024-07-11
0000 - Intro to C on Windows
0001 - Setting up the Windows Build
Setting the environment - 19:45
- install the C/C++ tools for Windows
- setup the
cl, by loadingvcvarsall.bat x64
0002 - Opening a Win32 Window
0003 - Allocating a Backbuffer
Different meanings of static - 17:00
Context dependent:
- add to a function
makes it invisible outside the file
- add to a variable in a function
persisting a value, between scope recreation
- add to variable outside a function
global variables
Good practice to give semantic meaning:
#define internal static#define local_persist static#define global_variable static
0004 - Animating the Backbuffer
Pixels in Little Endian Memory - 1:19:49
| Code (theory) | RR GG BB xx |
| Memory (little endian) | xx BB GG RR |
| Memory (Microsoft's preference) | xx RR GG BB |
| Code (actual) | BB GG RR xx |
0005 - Windows Graphics Review
0006 - Gamepad and Keyboard Input
Dynamically Loading Libraries - 31:50
- prevents the game from crashing if user doesn't have XInput installed
- essentially we load the library in a similar fashion as Windows, but during execution of the program
- use a dummy function with macros
Load the xinput1_4.dll via LoadLibrary and retrieve the address to the function we want to use from
that library by calling GetProcAddress. (essentially this is exactly what Windows anyways).
Keyboard Input - 46:55
0007 - Initializing Sound
Why are there two buffers to initialize the audio in Windows? - 1:27:56
The Windows code is complex due to legacy, while the SDL version felt reasonable. A lot of the annoyances doesn't apply here.
Metadata
- Creator(s)
Casey Muratori
Dennis Present
I'm interested in understanding how game engines and games work from scratch.