Cross-platform library for portable low level I/O access

Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. As one of several open source projects supported by now defunct Loki Software it is the most successful library for games and has been used for hundreds of free and almost all commercial games for Linux.

Simple DirectMedia Layer supports the operating systems BeOS, *BSD*, IRIX, Linux, Mac OS, Mac OS X, QNX, Solaris, Windows and has unofficial support for AIX, Atari, Dreamcast, Nintendo DS, OS/2, RISC OS, SymbianOS, Tru64 with older versions also supporting AmigaOS and EPOC.

SDL is written in C, but works with C++ natively, and has bindings to many other languages, including Ada, C#, Eiffel, Erlang, Euphoria, Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, Pike, Pliant, Python, Ruby and Smalltalk.

License: free

Sound:Play in X:Play in Console:Multiplayer:Network Play:3D Acceleration:Source Available:
yesyesnoyesnoyesyes
Suggest an update

Comments

This is used inthe Linux port of Civ3, and it runs great. I am a beta tester, and I love how well Civ3 runs.
Everything I've been looking for! The examples package shows off some incredible stuff, including GIF loading (including keeping track of transparent pixels), WAV loading and playing, and even MOD music file loading and playing!

I've begun re-releasing all of my old kinda-crappy games and giving them some much-needed updates, thanks to SDL.

Sam rules!

The best library I've ever seen! I'm using it myself. Sam rules!
I've only given this thing a cursory glance, but took a good look at the API bits. It doesn't promise more than just the basic canvas to make games easily portable, and I can't say I'm disappointed. It has a nice set of functions for input, video, sound and even threading, which all should come in useful in at least one of several projects I have planned. Compared to ClanLib, this is miles ahead.

All I need now, is a library of less generic graphical functions, which I'll probably start working on ASAP.

Oh, and perhaps I should make some C++ wrappers. Gosh, the project is perfect in my eyes, and I can already find nits to pick :P

(Download! Loki Software did ;)

It's great, it speeds up game development!
This library rocks. Although I did have to do a lot of configuring to get something to compile natively under win32 with egcs. But I'd be dumb not to write a game with SDL.
Excellent API and speed. I've used SDL for a number of projects, it's the best multi platform media development library I've found.
The SDL library is heaven-sent! I was currently writing my own cross-platform code to abstract video, sound, etc. but then came across SDL. It is a very simple, powerful, and complete library for writing games; exactly what I was trying to accomplish. A single .c file compiled and ran cleanly both in Linux and Win32! Sweeeeet! Many kudos to Sam and Loki Software for this very powerful library. I really hope more people pick up on SDL since I am an advocate of other OS's and hardware platforms. The more games for alternative OS's/platforms means that we might actually be able to format c:, and get rid of that dirty window that I really only use for it's game support.
SDL has been support Linux for years or months but it seem no body like it may be some backward incompatibility experience but we all should try to improved it as we all love SDL which is simple programming.
As a Linux game player this library is a must. Go get it and look for games which use it!
SDL is a superb library. I've used it to "retrofit" several of my demos with no hitch - clean, portable, intuitive code and very feature rich.
SDL rocks! I've used for multiple cross-platform projects, and it has worked great! Thanx Sam!
THE linux game lib. if i could i would give it six stars. that how good it is.
adasdasdad
Not exactly an exciting game by itself but all the games that have been made with it are excellent. Anyone thinking of making a crossplatform game need look no further.
Simple and Powerful.
I really love this library.
Why don't game developpers switch to SDL/OpenGL? It would bring peace to the OS world :P. No really, it would be alot easyer to get games working on multiple platforms if gamedeveloppers would use that combination.
They can't say "no" because of performance - they could adjust the source to their needs!
Anyways, my only wish is an official .NET wrapper.
Re: Really great! posted by grumbel on Sep 1 2003 5:34 AM
Sure it would help to get games portable, but OpenGL is still only second-best when it comes to Windows. Direct3D seems to be better supported and have better driver, so its only natural to pick that instead of GL for many companies.
Re: Really great! posted by T-1000 on Sep 1 2003 6:06 AM
mmm tell that to idsoftware, leaders of 3D engines, they program all in openGL, maybe it has "something"
Re: Really great! posted by grumbel on Sep 1 2003 9:28 AM
'id' are the ones with the power to get graphic card manufactors to fix there opengl support, but they are one of the few who have that power.
Re: Really great! posted by anonymous on Mar 3 2004 12:16 AM
I think the NVIDIA-cards are not so bad in OpenGL performance - great gains of ATI-cards against NVIDIA ones in the recent tests were all in D3D-performance. So I think we no-MS-gaming girls and guys should appreciate this. Additionally, NVIDIA provides good and up to date LINUX drivers for their cards - not open source (unfortunately?), but well done.
I'm pretty happy to see, that the new version supports QNX. Now QNX just needs support for 3D acceleration to give me a reason for using it again (not for gaming but for developing *g*). Maybe the times will come...
Awesome useful
Now it is a SDL_Surface! :-)

No, really, before SDL, you would see one or two games which looked really polished (XBlast anyone?). Now everyone and her dog can make a 2D game which will look just like a professional title of the 90s (given a good gfx wizard and gimp).

I think that a good game does not need 3D graphics, so I am very happy with the state of the linux game development art, and that happens to be (IMHO) SDL.

Re: Before SDL, there was a big void. posted by anonymous on Feb 29 2004 4:03 PM
Amen to that. 2D games are the best, after the gaming industrie went to 3D I started playing less since all games just started to feal allice...
Re: Before SDL, there was a big void. posted by anonymous on Mar 3 2004 12:11 AM
And by the way - embedding of Open GL is also nicely done - so if you nevertheless want to go for 3D
I'm still suspicious, SDL is just too easy to work with to be in the spirit of unix :D
This is powerful and great! It's easy to use and has a lot of features.
lots of annoying little things fixed w/ this version
SDL have very easy to learn interface, and Its extremely portable. More such a software is needed on Linux.
Really easy to use and powerfull.. and the "multiplatform thing" is wonderful too
Great library !
SDL is a truely awsome 2D API, and with OpenGL, it makes for a great cross platform game programming library. You cannot beat the OpenGL/SDL combination.
So many good games make great use of this (Frozen Bubble, Wesnoth, SuperTux, and many more), this library deserves a great rating.
I use SDL for all my multimedia projects, mostly with OpenGL. I can't survive without SDL! 5 stars!
Of course 5 stars, though if I'm allowed to be unrealistic for a moment a generic OpenGL based 2D API would be better, faster and more useful than the generic 1000 different video drivers 2D API that is SDL. Such a thing would:
1. Ensure that hardware acceleration was used in Linux - by default SDL games use the x11 driver in Linux, which is not accelerated
2. Make it possible to combine alt-tabbing in fullscreen mode with hardware acceleration, which seems a bit difficult with SDL
3. Allow SDL to include an API to do very easy and fast scaling and rotating
4. Allow the drawing of circles, lines and other geometric shapes, which is currently possible with SDL_gfx but SDL_gfx doesn't work with glSDL 5. Allow the possibility of something like an addon SDL_fx library which could include pretty OpenGL fire effects, water effects, etc
Re: Of course 5 stars posted by anonymous on May 17 2006 2:57 PM
There is the glSDL wrapper here that does some of what you describe.

On that page in mentions that there may be a GL backend for SDL in the works too. Lets hope?

:]
Re: Of course 5 stars posted by pawn on May 30 2006 10:26 AM
reading the changelog of sdl 1.2.10, it seems the work is really in progress:
SDL_GL_LoadLibrary() will load the system default OpenGL library if it is passed NULL as a parameter.
Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications.
Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration.
Re: Of course 5 stars posted by straver on Jul 25 2006 6:06 AM
Now If the distros could switch to the new version so you can include these new features. The wait for vsync flag seems really nice.
Re: Of course 5 stars posted by anonymous on Sep 1 2007 3:10 PM
2D in X11 is accelerated (on most graphic drivers).
Re: Of course 5 stars posted by anonymous on Sep 29 2007 2:28 PM
Yes, but not in SDL (unless they changed that since last I checked). Because SDL creates a framebuffer in system RAM, and only copies it to the graphics card when doing SDL_Flip or SDL_UpdateRect, it won't get graphics acceleration. System RAM is not graphics accelerated.
Re: Of course 5 stars posted by anonymous on Sep 29 2007 2:34 PM
Yes, but not in SDL (unless they changed that since last I checked). Because SDL creates a framebuffer in system RAM, and only copies it to the graphics card when doing SDL_Flip or SDL_UpdateRect, it won't get graphics acceleration. System RAM is not graphics accelerated.
What can I say - it's SDL!
Perl version of S the DL, sdl.pm is just like a bad joke. Completely useless (for a not hacker user ;) ). There's almost no documentation for it... I just wait for perl6, parrot and a new sdl module, hoping it will be better. What else can i do, me a noobish perl user...
I've donated to support the library development effort and you should do the same ;) Thanks to SDL, OpenCity is highly portable.
So easy to hack with, I'm embarassed to say I'm programming if using it.
I use it for all my games work. It hits just the right mark between being too high or low level, and portability is a snap. This and the add-on libraries have probably saved me many weeks of coding effort I'd otherwise have to do on my own.
SDL is a good base library for game programming. A lot of great games use it. Still it could be better and sadly the development has slowed somewhat.
Re: good base posted by Lightkey on Jan 11 2008 11:57 PM
Well, rejoyce! SDL 2.0 is under way.
The website says that SDL will allow alternate commercial licencing from 1.3 on. Why is this? It's very disappointing. :(

Also, it would be great to see SDL_Image support saving in all formats as well as loading. I know that Wesnoth would like to be able to save screenshots as PNG. Thanks.
Re: Simple DirectMedia Layer posted by Lorant on Sep 1 2007 7:20 AM
The website says that 1.3 will be available both under LGPL and "a commercial license". So you'll still be able to use the very same license as 1.2. The new license will be for static linking (especially usefull for consoles).

source: http://lists.libsdl.org/htdig.cgi/sdl-libsdl.org/2006-July/056710.html

Re: Simple DirectMedia Layer posted by anonymous on Sep 1 2007 7:46 AM

While I understand the rationale for such a move, I also understand why some fans of software freedom may disappointed. I can see both sides of it.

I'm really glad SDL exists and works well for a lot of graphical software.

Re: Simple DirectMedia Layer posted by anonymous on Sep 1 2007 12:49 PM
and I don't understand why anyone could not like it - that's only "one more option" and more users probably, which is only good for library and thus also for those who choose to use open license... btw... that's same move Ogre3D is to do to be able to make XBox version iirc
Re: Simple DirectMedia Layer posted by MatzeBraun on Sep 2 2007 9:44 PM
an LGPL license is all fans of free software can ask for. There's no problem here. Remember that it's about freedom not about free beer, there are people spending considerable amounts of there time improving SDL. It's good when they have a possibility to get a bit of compensation.
Re: Simple DirectMedia Layer posted by parasti on Sep 2 2007 10:27 PM

I'm not sure if you're making that implication, but just to get this out of the way: you can sell free software. In that sense "commercial licence" is a void statement, because LGPL is itself a commercial licence. But apparently there's sufficient demand for alternative licensing conditions that wouldn't require you to do some or all of the things that the LGPL does, and people are willing to pay for it.

Re: Simple DirectMedia Layer posted by jrodman on Sep 4 2007 6:16 PM

Yes. The GPL (and the LGPL) are about freedom. Commercial licenses are not about freedom. I don't see your point.

I support their efforts to find financial support for SDL development! I do not support this muddying of terms!

Re: Simple DirectMedia Layer posted by froth on Mar 15 2010 12:40 AM
Are you kidding? Proponents of software freedom would be upset over releasing SDL under a less restrictive license? You copyleft people are truly crazy. :)
That & similar conveniences automatically make portable libraries like SDL into winners.

Oh... that & DOSBox. (-:

Re: SuperTux runs on this Win98 archaia posted by DaVince on Jan 7 2008 8:26 PM
It's a portable library, which just makes porting your game easier. It doesn't run Windows binaries - you have to recompile your source code on a different platform to do that. This library just makes that easier because it's supported on several OSes/platforms.

Log in or register to rate this game or post a comment.