C++ Framework For SDL?
The Simple DirectMedia Layer, or SDL, is a cross-platform multimedia library for the C language that is commonly used for making games. This is the library which powers Pygame, and most of the things contained in the Pygame screencasts may be easily applied to SDL, and other language bindings for SDL, as a consequence, since Pygame generally follows SDL’s design. However, SDL is considered more low-level than Pygame, since SDL was designed to be a general-purpose library, while Pygame adds things that used often in game programming, such as the Sprite and Group objects. Conversely, Pygame programmers can greatly benefit from the many SDL tutorials and SDL articles that may be found online, as long as you’re familiar with the C language.
SDL is often the first-choice for Linux game development, since a good number of commercial titles have been written for Linux using this library. At the same time, game programmers gain a lot from SDL’s platform independence, which, if your game is coded properly, will allow you to code using one platform, and make your game playable on all other platforms for which SDL is available just by recompiling.
Although it is possible to code a game in directly in SDL using C, a game programmer may want to spend some time developing a C++ framework on top of SDL, coming up with a higher-level interface similar to Pygame (or even more high-level than Pygame) to facilitate the game programming process. Personally, I have tried coding in SDL using C, and have tried to look for such a framework, a C++ library on top of SDL. This search has led me to Pygame
. However, I would be interested to learn about any C++ SDL libraries out there that are freely available for download. I have heard about Ernest Pazera’s Focus on SDL, which devotes a good amount of time developing such a framework, but are there any others? I would love to hear your suggestions
.
License
This work is published under a Creative Commons Attribution 2.5 License.


July 2nd, 2006 at 10:16 am
Hello Chuck. I have also searched for a good SDL-C++ framework because I wanted to focus on C++ at first. Later on, I tried to write one myself. Similar to you I found python (and pygame
and loving it.
I think when I *would* fall back to C++ anytime, I will focus on e.g. Ogre, Irrlicht or something like that. I wouldn’t learn C++ again to make similar games only a bit faster. For now, I simply want to learn how to make good 2d games that work. Will see when I add the third generation and (eventually) fall back to C++.
October 20th, 2006 at 6:30 am
I haven’t replied to people in a very long time, and for this I apologize. Thank you so much to everyone for visiting the site and leaving valuable feedback.
Kai: Yes, I think that Pygame does a great job with 2D. As soon as I saw Pete Shinners’ SolarWolf at http://www.pygame.org/shredwheat/solarwolf/ , I was convinced that Pygame was special. If ever I do decide to jump into 3D, I still hope that I’ll be able to write my code in Python.