What is the difference between SDL and SDL2?
I see references to both SDL and SDL2. What's the difference between them and which one should I use for a new project?
SDL stands for Simple DirectMedia Layer. It's a popular cross-platform library for developing applications with graphics, sound, input handling, etc.
SDL2 is the latest major version of the library. The original SDL (sometimes referred to as SDL1) is no longer actively developed. SDL2 includes many improvements and new features compared to SDL1, such as:
- Hardware-accelerated 2D rendering
- Support for multiple windows
- Better Unicode support
- Support for multiple audio devices
- Game controller support
- Force feedback support
For any new projects, you should use SDL2 as it represents the current version of the library. SDL1 should only be used for maintaining legacy applications.
When downloading SDL, make sure you get the SDL2 version, not the older SDL1 version. The downloads, documentation, etc. for SDL2 are all clearly marked, e.g. "SDL2-devel-2.x.x-VC.zip".
So in summary - use SDL2 for new projects, as it's the modern, supported version of the excellent SDL library.
Setting up SDL2 in Windows (Visual Studio)
A step-by-step tutorial on configuring SDL2, SDL_image and SDL_ttf in a Visual Studio C++ project on Windows