**Handmade Hero Notes** ## [Foreword](articles/preface.md.html). ## [Appendix. Glossary and References](articles/appendix.md.html). # [Day 1](html/day1.html). Setting Up the Windows Build 1. Set up [Visual Studio][msvc]. 2. Configure Command Prompt. 3. Set up a Text Editor ([4coder][]/[vscode][]). 4. Create the First Code File (`win32_handmade.cpp`). 5. `build.bat` philosophy. 6. Intro to debugging in [Visual Studio][msvc] and [RemedyBG][]. # [Day 2](html/day2.html). Opening a Win32 Window 1. Create and Register the WindowClass. 2. Create Main Windows Callback, Start Processing Basic Messages. 3. Create a Window. 4. Start the Message Loop with `GetMessageA`. # [Day 3](html/day3.html). Allocating a Back Buffer 1. Create a Bitmap using `CreateDIBSection`. 2. Output the Bitmap to the Window using `StretchDIBits`. # [Day 4](html/day4.html). Animating the Back Buffer 1. Custom Bitmap Memory Allocation. 3. Render a Gradient to the Bitmap. 4. Animate the Bitmap on Each Frame. 5. RGB Color Packing in Windows. # [Day 5](html/day5.html). Windows Graphics Review 1. Pack the Bitmap-related Globals Into a Struct 2. The Stack 3. Full Program Step-through # [Day 6](html/day6.html). Gamepad and Keyboard Input 1. XInput 2. Direct Library Loading 3. Process Keyboard Messages # [Day 7](html/day7.html). Initializing DirectSound 1. Load Direct Sound 2. Initialize the Buffers 3. Deep Dive: COM, Vtables, Disassembly # [Day 8](html/day8.html). Writing a Square Wave to DirectSound 1. Write to a Circular Buffer 2. Square Wave 3. Play Sound through DirectSound # [Day 9](html/day9.html). Variable-Pitch Sine Wave Output 1. Generate a Sine Wave 2. Debug Sample Writing 3. Link Sound Pitch to User Input # [Day 10](html/day10.html). QueryPerformanceCounter and RDTSC 1. Time the frame using `QueryPerformanceCounter` and `RDTSC` 2. String formatting tools in the C Standard Library 3. Intro to Dimensional Analysis # [Day 11](html/day11.html). The Basics of Platform API Design 1. About Code Architecture 2. Platform Usage Philosophies 3. Start Implementing Game as Service System Style # [Day 12](html/day12.html). Platform-Independent Sound Output 1. Intro to our API Design Approach 2. Start Generating Sounds on the Game Layer 3. Make Use of Sound Generation in the Platform Layer # [Day 13](html/day13.html). Platform-Independent User Input 1. Think of a Possible Input System Usage 2. Make a First Pass on the Input System # [Day 14](html/day14.html). Platform-Independent Game Memory 1. Intro to Memory Management 2. Design and Implementation of Our Approach 3. Assertions # [Day 15](html/day15.html). Platform-Independent Debug File I/O 1. About File I/O in Games 2. Platform Implementation of the Debug I/O 3. Safe Truncation # [Day 16](html/day16.html). Visual Studio Compiler Switches 1. Enable Compiler Warnings 2. Set Other Compiler Switches 3. Try a 32-bit Build # [Day 17](html/day17.html). Unified Keyboard and Gamepad Input 1. Move Keyboard Input to WinMain 2. Finish Gamepad Stick Code 3. Improve Keyboard Input Processing # [Day 18](html/day18.html). Enforcing a Video Frame Rate 1. Define frame rate problem 2. Implement first pass solution 3. Some Cleanup and Refactoring # [Day 19](html/day19.html). Improving Audio Synchronization 1. Visualize the DirectSound Cursors 2. Deep-dive Debugging: Audio Skipping 3. Increase Audio Latency # [Day 20](html/day20.html). Debugging the Audio Sync 1. Deep Dive into Audio Latency Issue 2. Implement Two Audio Paths 3. Introduce GameGetSoundSamples 4. More Debug Work # [Day 21](html/day21.html). Loading Game Code Dynamically 1. Separate Game From Platform 2. Build Game DLL 3. Reload Game DLL at Runtime # [Day 22](html/day22.html). Instantaneous Live Code Editing 1. Variable PDB Name 2. Re-enable Debugger Support 3. Remove Delay Between Reloads # [Day 23](html/day23.html). Looped Live Code Editing 1. Add a Test Player 2. Implement Live Loop 3. Showcase Live Loop Editing # [Day 24](html/day24.html). Win32 Platform Layer Cleanup 1. Various Code Improvements 2. String Building Routines # [Day 25](html/day25.html). Finishing the Win32 Prototyping Layer 1. Capture Mouse Input 2. Improve Replay Handling 3. Clean Up Platform Debug Code # [Day 26](html/day26.html). Introduction to Game Architecture 1. About Software Architecture 2. Game Architecture for Handmade Hero # [Day 27](html/day27.html). Exploration-based Architecture 1. Explore and Lock architecture approach 2. Game Design for Handmade Hero 3. Test Code Cleanup 4. DrawRectangle Function ------------- (##) About the Notes and the Code Blocks You will see many special call outs spread around the page. These are made both to break the text down and to insert some variety into it. Aside from pictures, code, tables and graphs, you will find the following: !!! Note Note This is a note. !!! Warning Warning This is an important thing to note. Read this part very carefully. !!! Tip Tip This is a useful tip. !!! Trivia Trivia This is an interesting fact or some historical trivia. As for the code blocks, these would have the following markings: ~~~~~~~ C++ // This is a comment for C/C++ code chunks This is a line which was already present in the code (introduced earlier) and remains without a change. ~~~~~~~ C++ delete This is a deleted line. ~~~~~~~ C++ add This is a new line. ~~~~~~~ C++ edit This is a previously existing line which was edited. ~~~~~~~ (insert articles/links.md.html here)