So why use SDL? What is so good about it?
Here is a partial list of the most important (from our point of view) features:
- SDL is simple -although it provides only the most basic 2D graphics capabilites it is more than we need to get going. And because it is doesn't have everything and the kitchen sink, one does not need to learn a hugely complicated system before one can get going. In just a few lines of code, one has a program running with SDL.
- SDL programming is like C programming not Win32 programming - one uses a standard C program layout and SDL manages all the negotiation with the operating system for you.
- SDL is 32 bit - thus it is future proof to a degree.
- SDL is FAST - real computer games and ports of games (some very well known) were written using SDL. If it is fast enough to implement real world games, it will be fast enough for us. It takes advantage of accelerated graphics hardware where possible. This is something very few graphics libraries are capable of.
- SDL is portable - it can be used just as easily on a Linux system as a Windows-na system, etc. Once you have written your program using SDL in Windows-na, you can change it to work in Linux or various other operating systems with a minimum of fuss. It will also work with most graphics cards transparently without you having to change your code.
- SDL is extensible - OpenGL just plugs right into SDL, so if you decide you want to add some 3D graphics, you can just go right ahead, in the simplest possible way.
- SDL is more than just a graphics system - it provides a complete multimedia solution. You can capture keyboard and joystick input, have access to the sound subsystem, etc, etc. In that sense it is similar to DirectX, but it is much simpler to use.
In the next lesson, we'll go step-by-step through setting up SDL to work with Pelles C and how to write a minimal SDL program.