Handmade Penguin is a companion to Casey Muratori's amazing
Handmade Hero series. As the name suggests, Handmade Penguin chronicles how to follow along if you're
using the Linux operating system. Casey will be spending a few weeks covering porting the game to different
platforms, but for those of us who want to follow on from the beginning, hopefully this will help. Notably,
this is not a tutorial by itself, but more a list of things you need to change to get the game working. It will
therefore probably fizzle off after a couple of weeks when all of the platform-specific code is done.
- Getting Started / Introduction to C (following Into to C on Windows)
- Setting Up the Linux Build (following Setting Up the Windows Build)
- Opening an SDL Window (following Opening a Win32 Window)
- Allocating a Backbuffer (following Allocating a Backbuffer)
- Animating the Backbuffer (following Animating the Backbuffer)
- Graphics Refactoring and Review (following Windows Graphics Review)
- Gamepad and Keyboard Input (following Gamepad and Keyboard Input)
- Initialising SDL Audio (following Initializing DirectSound)
- Playing a Square Wave with SDL (following Writing a Square Wave to DirectSound )
- Variable-Pitch Sine Wave Output (following Variable-Pitch Sine Wave Output )
- SDL_GetPerformanceCounter and RDTSC (following QueryPerformanceCounter and RDTSC)
- Making Graphics Portable (following The Basics of Platform API Design)
- Platform-indpendent Sound Output (following Platform-independent Sound Output)
- Platform-indpendent User Input (following Platform-independent User Input)
- A Trip Down Memory Lane (following Platform-independent Game Memory)
- Platform-independent Debug File I/O (following Platform-independent Debug File I/O)
- Bits and Pieces (following VisualStudio Compiler Switches)
- Unified Keyboard and Gamepad Input (following Unified Keyboard and Gamepad Input)
- Enforcing a Video Frame Rate (following Enforcing a Video Frame Rate)
- Improving Audio Synchronisation (following Improving Audio Synchronization)
This is aimed at people who are comfortable using (and programming) on Linux, as it's neither an intro to Linux tutorial
nor an intro to programming tutorial. Of course, the best way to know if it suits you is to try to follow along with the first few
chapters and see if you understand it and/or like it!
I'll be developing using Kubuntu Linux and using the KDevelop IDE for debugging (with an editor of your choice for the actual coding). I think Casey is probably going to be using Linux Mint which is just as good. You should be able to follow along with most of it on your own Linux distro or IDE with very little
If you have any questions, feel free to email me at firstname.lastname@example.org.
A Note on SDL
A few people have asked why Handmade Penguin is using SDL, whereas Casey is not going to use any non-system libraries.
There are a couple of reasons for this. Firstly, SDL is much easier to use than calling X11 directly: if I were using X11, there's no way I'd be able to write
these without falling behind. Secondly, while doing things from scratch is an excellent learning experience, once you're comfortable with how things work under
the hood, using a library like SDL is really the right way to go: most of the SDL code we use works without modification on other platforms, and all of the nasty
bugs and issues with X11 and the like are already worked out for us. I've done QA for a lot of Linux games, and the ones that used SDL were significantly
less buggy than those that used X11 directly.
Besides, since Casey is going to be doing a Linux port later anyway, it'd be boring to do exactly the same thing twice!
I'm looking forward to sailing on the Cs of adventure with you all!