LinuxDevCenter.com

oreilly.comSafari Books Online.Conferences.

We've expanded our Linux news coverage and improved our search! Search for all things Linux across O'Reilly!

Search
Search Tips

advertisement

Print Subscribe to Linux Subscribe to Newsletters
Linux & Unix > Excerpts >

SDL: The DirectX Alternative

by Howard Wen
09/21/2001

There's a good chance that the next Linux game you play, especially if it's a commercially sold title, was made using Simple DirectMedia Layer.

SDL, for short, is a multimedia library API which provides low-level access to a system's video framebuffer, sound output, and input devices including keyboard, mouse, and joystick. It's used in emulators and MPEG viewers to handle the graphics and sounds of these programs, but SDL has mostly become known as an essential toolkit for Linux game development. The Linux port of Civilization: Call to Power used SDL.

In its most basic capabilities, SDL is similar to Microsoft's DirectX API. The big difference is that, besides being open source, SDL supports multiple operating systems. Other than Linux, SDL is available as BeOS, MacOS, Solaris, FreeBSD, IRIX, and, yes, even Windows 32-bit versions. Additionally, the API has bindings to other languages, a few of which are Perl, PHP, and Python.

Written in C (and also working natively with C++), the latest version, SDL 1.2, is available under the GNU Lesser General Public License version 2 or later.

This alternative to Microsoft's well-known and oft-used DirectX comes courtesy of Sam Lantinga, 27, who presently works as a software engineer for Blizzard Entertainment (the makers of Diablo) in Irvine, California. He first made a name for himself in the games industry as one of the prominent players in the Linux gaming development community. His last job was as a lead programmer for Loki Software, renowned for its quality Linux translations of Windows and Macintosh games. (The last projects that he worked on while at Loki were Tribes 2 and Kohan.) Lantinga got his start in Linux game programming while in college when he ported a Macintosh game called Maelstrom to Linux.

Comment on this articleDo you have any projects underway or completed that use SDL? Also, any general thoughts?
Post your comments

The genesis for the SDL library came about while he worked on the Windows port of a Macintosh emulator called Executor. He figured that the code he created for the emulator's graphics, sound, and game controller interfaces could be extracted and used separately across other platforms. "I thought it would be handy to write a library to encapsulate this functionality so that other people could use it," he says.

Lantinga started work on what would become SDL in the summer of 1997 and made the first public release of it, Version 0.3, in October of that year.

Pages: 1, 2, 3

Next Pagearrow




Tagged Articles

Be the first to post this article to del.icio.us

Recommended for You

Sponsored Resources

  • Inside Lightroom
Advertisement

Sponsored by:

Sign up today to receive special discounts,
product alerts, and news from O'Reilly.
Privacy Policy >
View Sample Newsletter >
  • Youtube
  • http://www.youtube.com/OreillyMedia
  • Twitter
  • Subscribe
  • View All RSS Feeds >
O'Reilly Media

800-889-8969 or 707-827-7019
Monday-Friday 7:30am-5pm PT
©2011, O'Reilly Media, Inc.
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
  • About O'Reilly
  • Academic Solutions
  • Contacts
  • Customer Service
  • Careers
  • Press Room
  • Privacy Policy
  • Terms of Service
  • Writing for O'Reilly
  • Community
  • Authors
  • Forums
  • Membership
  • Newsletters
  • RSS Feeds
  • User Groups
  • More O'Reilly Sites
  • igniteshow.com
  • makerfaire.com
  • makezine.com
  • craftzine.com
  • labs.oreilly.com
  • Partner Sites
  • PayPal Developer Zone
  • O'Reilly Insights on Forbes.com