Lesson 0: Setting Up SDL

The first step is to get the SDL2 development libraries setup on your system, you can download them from the SDL2 downloads page.

C++11 Note

Since C++11 provides a bunch of great new features that I’d like to use you’ll need a compiler that supports the new standard. Any modern compiler is compliant (or close enough for us) these days including gcc, clang and msvc in Visual Studio 2013 and up. With clang and gcc be sure to include the C++11 flag, -std=c++11, or if your compiler is a bit older -std=c++0x. C++11 features are enabled by default in Visual Studio 2012 and up.

Making Sure Everything is Working

Now that you’ve got the libraries setup on your computer we’ll test everything out with a very simple project. I recommend using CMake to build your executables as it can generate make files or project files for almost any platform and IDE and is the build system I’ll be using for the lessons so it’ll be easier to follow along.

Don’t forget to read Postscript 0: Properly Finding Resource Paths before continuing on to lesson 1 to see how to find the location of assets needed by your program.