Simple Directmedia Layer

Why Trust Techopedia

What Does Simple Directmedia Layer Mean?

Simple directmedia layer (SDL) is a cross-platform multimedia library written in C to provide low level access to keyboard, mouse, audio, joystick and 3D hardware through OpenGL. It is also used by MPEG playback software and many popular games.


Techopedia Explains Simple Directmedia Layer

SDL was first released in 1998 by Sam Lantinga while working for Loki Software. SDL is a thin, cross platform library providing support for 2D pixel operations, sound, file access, event handling and threading. It complements OpenGL enabling the graphical output by providing mouse and keyboard input. All operations in SDL are performed by passing parameters to functions. The library is divided into numerous subsystems, such as the video, audio, CD-ROM, joystick and timer. Besides this basic low level support, there are also a few official libraries providing additional functionalities.

SDL is widely used to write computer games or other multimedia applications running on a variety of operating systems, including:

  • Windows
  • Mac OS X
  • OS 9
  • Linux
  • Google Android
  • AmigaOS
  • Haiku/BeOS
  • Syllable
  • WebOS

It also provides bindings to many other languages, including (a partial listing):

  • C#
  • Ada
  • Eiffel
  • D
  • Euphoria
  • Erlang
  • Haskell
  • Guile
  • Lisp
  • Java
  • ML

Thus, it is a common choice for many multimedia applications. It is also distributed under GNU LGPL version 2 and enables game development for several platforms at the same time, and porting of the game to a new platform within time. While the SDL sound features are modest, the SDL API, which is mainly graphic related, holds around 200 functions and a few structures. It also offers tools for parallel programming such as semaphores, mutex, condition variables and threads.

SDL has the title layer as its wrapper around specific operating system’s functionality providing access to it. The SDL source codes are split into different modules for specific operating systems. On compilation, the right modules are selected for the target system. SDL use a GDI backend for Microsoft Windows, while it makes use of the Xlib to communicate with the Linux and OpenVMS for graphics and events.


Related Terms

Margaret Rouse
Technology Expert
Margaret Rouse
Technology Expert

Margaret is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages.