Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Simple DirectMedia Layer
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Free software multimedia library}} {{Use dmy dates|date=July 2019}} {{Infobox software | name = Simple DirectMedia Layer | logo = Simple DirectMedia Layer, Logo.svg | caption = SDL logo | author = [[Sam Lantinga]] | developer = SDL Community | released = {{Start date and age|1998}} | latest release version = {{wikidata|property|preferred|references|edit|Q727439|P348|P548=Q2804309}} | latest release date = {{nowrap|{{wikidata|qualifier|preferred|single|Q727439|P348|P548=Q2804309|P577}}}}<!-- 3.2.4 on 7 Feb 2025, but do we want to track last digit? https://github.com/libsdl-org/SDL/releases/tag/release-3.2.4 --><br />2.32.0 / 8 February 2025<!-- https://github.com/libsdl-org/SDL/releases/tag/release-2.32.0 Allow destroying a window and its renderer in either order Added cursor-shape-v1 protocol support on Wayland Fixed full immersive mode in Android 9 and higher [SDL 3 seems to support only (11?) or Android 15, so older to 9 supported with SDL 2.] .. Fixed byte order detection on Solaris --> | operating system = Version 3 supports same (current) platforms <!-- and still Haiku and RISC OS listed for SDL 3, rightly or wrongly, but e.g. Amiga is absent, and Google Stadia and Nokia N-Gage are dropped. --> as {{nowrap|version 2}}, such as 32- and 64-bit Windows 10+<!-- has Win10 specific code, for e.g. Direct3D. Unclear if older is still support, then with less functionality, at least I still see in SDL3 source code (even SDL_PLATFORM_HAIKU, supposedly dropped, and SDL_PLATFORM_AIX, not bitrotted?) additionally: /* Windows 2000/XP and later, deprecated as of Windows 10 (still available), available in Wine (tested 6.0.3) */ result = SHGetFolderPathW(NULL, type, NULL, SHGFP_TYPE_CURRENT, path); I also see requirements upped to Android 15 SDK 35 in SDL 3, from 34, though I still see in source code Android 11 (may stil be supported?): if (Build.VERSION.SDK_INT >= 30 /* Android 11 (R) */ && Build.VERSION.SDK_INT < 35 /* Android 15 */) { SDLActivity.onNativeInsetsChanged(0, 0, 0, 0); } --> and 64-bit macOS 10.7+ <small>(support dropped for outdated e.g. Windows Phone/UWP<ref>{{Cite web |title=winrt: Removed WinRT/Windows Phone/UWP support. by icculus · Pull Request #10731 · libsdl-org/SDL |url=https://github.com/libsdl-org/SDL/pull/10731 |access-date=2025-02-09 |website=GitHub |language=en}}</ref>).</small><ref>{{Cite web |title=SDL/docs/README-platforms.md at main · libsdl-org/SDL |url=https://github.com/libsdl-org/SDL/blob/main/docs/README-platforms.md |access-date=2025-02-09 |website=GitHub |language=en}}</ref><br /> Support for version 2: [[Linux as gaming platform#APIs|Linux]] (e.g. [[SteamOS]]), Windows, {{nobr|macOS 10.4+}}, {{nobr|iOS 3.1.3+}}, {{nobr|tvOS}},<ref>{{cite web|url=https://twitter.com/icculus/status/776606847373545472?lang=en|date=September 15, 2016|title=Oh look, we'll have official tvOS support in SDL 2.0.5, for people that want their SDL-based games on Apple TV!}}</ref> {{nobr|Android 2.3.3+}}, {{nobr|FreeBSD 8.4+}}, [[Nintendo Switch]], [[PlayStation 2]], Haiku, [[RISC OS]] 3.5+,<ref>{{Cite web |title=SDL/docs/README-riscos.md at 9d83c0a65d969a902c91f4f94fd5a904c0828a33 · libsdl-org/SDL |url=https://github.com/libsdl-org/SDL/blob/9d83c0a65d969a902c91f4f94fd5a904c0828a33/docs/README-riscos.md |access-date=2024-03-17 |website=GitHub |language=en}}</ref> [[MorphOS]] 0.4+<ref>{{cite web|title=Great galaga style true color game for MorphOS (uses SDL) |url=https://aminet.net/package/game/shoot/gammapatrolmos}}</ref><ref>{{cite web |title=SDL 2.30.7 Libraries |url=https://www.morphos-storage.net/?id=2227083 |access-date=2024-11-06}}</ref><br> Additionally before v2.0.0: e.g. [[AmigaOS]] and [[MorphOS]], and consoles (PlayStation, Xbox, Wii, etc), Nintendo DS | platform = [[IA-32]] (x86), [[x86-64]], [[PowerPC]], [[AArch64]] | programming language = [[C (programming language)|C]] | genre = [[application programming interface|API]] | license = [[zlib License]]<br> Before 2.0.0:<br>[[GNU Lesser General Public License|GNU LGPL]]<ref name="license">{{cite web |url=https://www.libsdl.org/license.php |title=SDL license |access-date=3 March 2014}}</ref> | website = {{URL|https://www.libsdl.org}} }} '''Simple DirectMedia Layer''' ('''SDL''') is a [[cross-platform]] [[software development]] [[library (computing)|library]] designed to provide a [[hardware abstraction layer]] for computer [[multimedia]] [[computer hardware|hardware components]]. Software developers can use it to write high-performance [[personal computer game|computer games]] and other multimedia applications that can run on many [[operating system]]s such as [[AmigaOS]], [[Android (operating system)|Android]]<!-- surprisingly even with a joystick, also on iOS, see in code: SDL_JOYSTICK_ANDROID SDL_JOYSTICK_IOS_H -->, [[iOS]], [[Linux]], [[MorphOS]], [[macOS]], and [[Microsoft Windows|Windows]].<ref name="platforms">{{cite web|url=https://wiki.libsdl.org/Installation |title=a list of the platforms SDL supports |publisher=Libsdl.org |access-date=9 April 2016 |archive-url=https://web.archive.org/web/20160401091424/http://wiki.libsdl.org/Installation |archive-date=2016-04-01}}</ref> SDL manages [[video display|video]], [[computer speakers|audio]], [[input device]]s, [[thread (computing)|threads]], [[shared object]] loading, [[computer networking|networking]] and timers.<ref>{{cite web|url=https://www.libsdl.org |title=SDL official website |publisher=Libsdl.org |access-date=19 March 2010}}</ref> For 3D graphics, it can handle an [[OpenGL]], [[Vulkan]],<ref name="vulkan">{{Cite web|url=https://wiki.libsdl.org/CategoryVulkan|title=CategoryVulkan - SDL Wiki'|website=wiki.libsdl.org|access-date=2025-02-09}}</ref> [[Metal (API)|Metal]], or [[Direct3D#Direct3D 11|Direct3D11]] (older Direct3D version 9 is also supported) context. A common misconception is that SDL is a [[game engine]]<!-- contradicted in main text (I meant to comment out since I was even unsure by now). https://github.com/libsdl-org/SDL/blob/main/docs/README-main-functions.md explains how function main is substituted (e.g. for WinMain reasons), and it seems to describe framework behavior, but doesn't use that term and even if it does, then it seems optional to do so. At least it does provide callback behavior, that and an event loop seems always needed in games: or a [[software framework]] (Apple [[.framework]] bundle is though supported)-->. However, the library is suited to building games directly, or is usable indirectly by engines built on top of it. The library is internally written in [[C (programming language)|C]] and possibly, depending on the target platform, [[C++]] or [[Objective-C]], and provides the [[application programming interface]] in C, with bindings to other languages available.<ref name="sdl2bindings">{{cite web |url=https://www.libsdl.org/languages.php |title=SDL Language Bindings |website=libsdl.org |publisher=Simple DirectMedia Layer |access-date=13 August 2014}}</ref> It is [[free and open-source software]] subject to the requirements of the [[zlib License]] since version 2.0, and with prior versions subject to the [[GNU Lesser General Public License]].<ref name="license" /> Under the zlib License, SDL 2.0 is freely available for [[static linking]] in [[closed-source]] projects, unlike SDL 1.2,<ref>{{cite web |title=Licensing the Simple DirectMedia Layer library |url=https://www.libsdl.org/license.php |access-date=30 January 2012}}</ref> although it is possible for the user to override the statically linked library with one provided by them.<ref>{{Cite web |title=SDL/docs/README-dynapi.md at main · libsdl-org/SDL |url=https://github.com/libsdl-org/SDL/blob/main/docs/README-dynapi.md |access-date=2024-06-25 |website=GitHub |language=en}}</ref> SDL 2.0, released in 2013, was a major departure from previous versions, offering more opportunity for 3D hardware acceleration, but breaking backwards-compatibility; a wrapper library made to translate 1.2 calls to 2.0 was later made available.<ref>{{Citation |title=libsdl-org/sdl12-compat |date=2024-06-01 |url=https://github.com/libsdl-org/sdl12-compat |access-date=2024-06-25 |publisher=Simple Directmedia Layer}}</ref> SDL is extensively used in the industry in both large and small projects. By 2010, over 700 games, 180 applications, and 120 demos had been posted on the library website.<ref>{{Cite web|date=2010-06-29|title=Simple DirectMedia Layer|url=https://www.libsdl.org/games.php?order=name&category=-1&completed=0&os=-1&match_name=&perpage=-1|access-date=2021-08-07|archive-url=https://web.archive.org/web/20100629004347/http://www.libsdl.org/games.php?order=name&category=-1&completed=0&os=-1&match_name=&perpage=-1|archive-date=29 June 2010}}</ref> SDL supports [[Emscripten]] (i.e. programs that run on a web page). SDL 3 was released, as a stable version, in January 2025. It has a migration guide, and Coccinelle tool support to help migrate to the new major version. SDL 3 has a new way to control the entry point of your program,<ref>{{Cite web |title=SDL3/README/main-functions |url=https://wiki.libsdl.org/SDL3/README/main-functions#the-main-entry-point-in-sdl3 |access-date=2025-02-09 |website=wiki.libsdl.org}}</ref> and you can optionally control execution in a non-framework way. == History == [[Sam Lantinga]] created the library, first releasing it in early 1998, while working for [[Loki Entertainment|Loki Software]]. He got the idea while porting a Windows application to Macintosh. He then used SDL to port ''[[Doom (1993 video game)|Doom]]'' to [[BeOS]] (see [[Doom source port]]s).<ref>{{cite web|archive-url=https://web.archive.org/web/20030511174315/http://www-106.ibm.com/developerworks/library/l-making-linux-fun/|url=http://www-106.ibm.com/developerworks/library/l-making-linux-fun/|title=SDL: Making Linux fun|first=Sam|last=Lantinga|author-link=Sam Lantinga|date=1999-09-01|access-date=2023-12-15|archive-date=11 May 2003|website=[[IBM]]|url-status=live}}</ref> Around the time of its creation, SDL was regarded as a simple alternative to DirectX.<ref>{{cite web |title=Articles relating to SDL |url=https://www.libsdl.org/articles.php |website=Simple DirectMedia Layer |access-date=22 January 2025 |archive-url=https://web.archive.org/web/20031009043921/http://www.libsdl.org/articles.php |archive-date=9 Oct 2003 |url-status=dead}} Search with the keywords "alternative", "simple" or "DirectX" in the page.</ref> Several other free libraries were developed to work alongside SDL, such as [[SMPEG]] and {{Clarification needed span|[[OpenAL]]|date=January 2025|reason=alternative implementation of OpenAL?}}. He also founded Galaxy Gameworks in 2008 to help commercially support SDL, although the company plans are currently on hold due to time constraints.<ref>{{cite web |title=Exploring the Galaxy | url=http://slouken.blogspot.com/2011/04/exploring-galaxy.html | date=6 April 2011| access-date=30 January 2012}}</ref> Soon after putting Galaxy Gameworks on hold, Lantinga announced that SDL 1.3 (which would then later become SDL 2.0) would be licensed under the [[zlib License]].<ref name=SDL1.3zLib>[http://forums.libsdl.org/viewtopic.php?t=7148 SDL 1.3 to be zLib Licensed], SDL Mailing List, 7 April 2011</ref> Lantinga announced SDL 2.0 on 14 July 2012, at the same time announcing that he was joining [[Valve Corporation|Valve]], the first version of which was announced the same day he joined the company.<ref>{{cite web | url=https://www.phoronix.com/scan.php?page=news_item&px=MTE0MDU | title=SDL 2.0 Is Coming Very Soon With New Features | access-date=17 August 2012}}</ref> Lantinga announced the stable release of SDL 2.0.0 on 13 August 2013.<ref name=Announcing-SDL2.0.0>[http://forums.libsdl.org/viewtopic.php?p=38569&sid=9efbea827cdebd71ee430cda823bcdc7#38569 Announcing SDL 2.0.0], SDL Mailing List, 13 August 2013</ref> SDL 2.0 is a major update to the SDL 1.2 [[codebase]] with a different, not [[backward compatibility|backwards-compatible]]<ref>[https://wiki.libsdl.org/moin.cgi/MigrationGuide#Backward-compatibility MigrationGuide - SDL Wiki']. Wiki.libsdl.org (21 November 2013). Retrieved on 2013-12-08.</ref> [[API]]. It replaces several parts of the 1.2 API with more general support for multiple input and output options. Some feature additions include multiple window support, hardware-accelerated 2D graphics, and better [[Unicode]] support.<ref>{{cite web |url=https://wiki.libsdl.org/moin.cgi/Roadmap |title=SDL 1.3 Roadmap|date=14 June 2011 |access-date=25 July 2011}}</ref> Support for [[Mir (software)|Mir]] and [[Wayland (display server protocol)|Wayland]] was added in SDL 2.0.2<ref>{{cite web|url=http://www.omgubuntu.co.uk/2014/02/mir-sdl-support |title=Some of Linux's Most Popular Games Will Run Natively On Mir |first=Joey-Elijah |last=Sneddon |date=5 February 2014 |access-date=19 March 2014}}</ref> and enabled by default in SDL 2.0.4.<ref>{{cite web|url=https://hg.libsdl.org/SDL/file/release-2.0.4/WhatsNew.txt#l65|title=SDL 2.0.4 Changelog|first=Sam|last=Lantinga|date=2 January 2016|access-date=6 January 2016|archive-date=4 March 2016|archive-url=https://web.archive.org/web/20160304094856/https://hg.libsdl.org/SDL/file/release-2.0.4/WhatsNew.txt#l65|url-status=dead}}</ref> Version 2.0.4 also provided better support for Android.<ref>{{Cite web|url=https://wiki.libsdl.org/SDL_SysWMinfo|title = SDL_SysWMinfo}}</ref> In 2024, the stable preview of SDL 3.1.3 was released (and in January 2025 3.2.0 was released as stable). It makes the API more consistent and allows access to more parts of the device, along with other features.<ref>{{cite web |title=SDL 3.1.3 Stable ABI Preview Release |url=https://www.phoronix.com/news/SDL-3.1.3-Released |website=Phoronix |access-date=13 November 2024}}</ref> == Software architecture == SDL is a [[wrapper library|wrapper]] around the operating-system-specific functions that the game needs to access. The only purpose of SDL is to provide a common framework for accessing these functions for multiple operating systems (cross-platform).<ref>{{cite web |url=https://wiki.libsdl.org/Introduction |title=Introduction to SDL|access-date=3 March 2014}}</ref> SDL provides support for 2D pixel operations, sound, file access, event handling, timing and threading. It is often used to complement [[OpenGL]] by setting up the graphical output and providing mouse and keyboard input, since OpenGL comprises only rendering. A game using the Simple DirectMedia Layer will ''not'' automatically run on every operating system; further adaptations must be applied. These are reduced to a minimum, since SDL also contains a few abstraction APIs for frequent functions offered by an operating system. The syntax of SDL is function-based: all operations done in SDL are done by passing parameters to [[subroutine]]s (functions). Special structures are also used to store the specific information SDL needs to handle. SDL functions are categorized under several different subsystems. === Subsystems === SDL is divided into several subsystems:<ref>{{Cite web|url=https://wiki.libsdl.org/APIByCategory|title = APIByCategory}}</ref> ; Basics: Initialization and Shutdown, Configuration Variables, Error Handling, Log Handling ; Video: Display and Window Management, surface functions, rendering acceleration, etc. ; Input Events: [[Event (computing)|Event handling]], Support for Keyboard, Mouse, Joystick and Game controller ; Force Feedback: SDL_haptic.h implements support for "Force Feedback" ; Audio: SDL_audio.h implements Audio Device Management, Playing and Recording ; Threads: [[thread (computer science)|multi-threading]]: Thread Management, Thread Synchronization Primitives, Atomic Operations ; Timers: Timer Support ; File Abstraction: Filesystem Paths, File I/O Abstraction ; Shared Object Support: Shared Object Loading and Function Lookup ; Platform and CPU Information: Platform Detection, CPU Feature Detection, Byte Order and Byte Swapping, Bit Manipulation ; Power Management: Power Management Status ; Additional: Platform-specific functionality Besides this basic, low-level support, there also are a few separate official libraries that provide some more functions. These comprise the "standard library", and are provided on the official website and included in the official documentation: * ''SDL_image'' — support for multiple image formats<ref>{{cite web |url=https://www.libsdl.org/projects/SDL_image/ |title=SDL_image 2.0 |website=libsdl.org |access-date=19 July 2014}}</ref> * ''SDL_mixer'' — complex audio functions, mainly for sound mixing<ref>{{cite web |url=https://www.libsdl.org/projects/SDL_mixer/ |title=SDL_mixer 2.0 |website=libsdl.org |access-date=19 July 2014}}</ref> * ''SDL_net'' — networking support<ref>{{cite web |url=https://www.libsdl.org/projects/SDL_net/ |title=SDL_net 2.0 |website=libsdl.org |access-date=19 July 2014}}</ref> * ''SDL_ttf'' — [[TrueType]] font rendering support<ref>{{cite web |url=https://www.libsdl.org/projects/SDL_ttf/ |title=SDL_ttf 2.0 |website=libsdl.org |access-date=19 July 2014}}</ref> * ''SDL_rtf'' — simple [[Rich Text Format]] rendering<ref>{{cite web |url=https://www.libsdl.org/projects/SDL_rtf/ |title=SDL_rtf 0.1 |website=libsdl.org |access-date=19 July 2014}}</ref> Other, non-standard libraries also exist. For example: SDL_Collide on SourceForge created by [[Amir Taaki]]. === Language bindings === The SDL 2.0 library has [[language binding]]s for: {{div col|colwidth=25em}} * [[Ada (programming language)|Ada]]<ref name="sdl2bindings"/> * Beef * [[C (programming language)|C]] * [[C++]] * [[C Sharp (programming language)|C#]]<ref name="sdl2bindings"/> * [[Common Lisp (programming language)|Common Lisp]]<ref>{{cite web|url=https://github.com/lispgames/cl-sdl2|title=cl-sdl2|publisher=GitHub|access-date=23 November 2017}}</ref> * [[D (programming language)|D]]<ref name="sdl2bindings"/> * [[Erlang (programming language)|Erlang]] * [[Fortran]]<ref>{{cite web|publisher=GitHub|url=https://github.com/interkosmos/f03sdl2|title=f03sdl2|access-date=2019-10-28}}</ref> * [[Gambas]]<ref>{{cite web|publisher=Gambas Wiki|url=https://gambaswiki.org/wiki/comp/gb.sdl2|title=gb.sdl2|access-date=2023-02-02}}</ref> * [[Go (programming language)|Go]]<ref name="sdl2bindings"/><ref name="Go+Julia">{{cite web|url=https://software.intel.com/en-us/blogs/2015/11/05/go-julia-fourier-open-source-frequon-invaders|title=Go + Julia + Fourier = Open Source Frequon Invaders|first=Arch D. |last=Robison|date= November 9, 2015|website=software.intel.com|language=en|access-date=2019-08-02}}</ref> * [[Haskell (programming language)|Haskell]]<ref>{{cite web|url=https://hackage.haskell.org/package/SDL|title=SDL on Hackage}}</ref><ref>{{cite web|url=https://hackage.haskell.org/package/sdl2|title=SDL2 on Hackage}}</ref> * [[Java (programming language)|Java]] (e.g. JSDL) * [[Julia (programming language)|Julia]]<ref>{{cite web|last=Bieler|first=Jonathan|title=jonathanBieler/SimpleDirectMediaLayer.jl|website=[[GitHub]]|date=2020-07-30|url=https://github.com/jonathanBieler/SimpleDirectMediaLayer.jl|access-date=2020-08-08}}</ref><ref>{{cite web|last=SquidSinker|title=Example games for GameZero.jl|website=[[GitHub]]|date=2020-08-02|url=https://github.com/SquidSinker/GZExamples|access-date=2020-08-08}}</ref><ref>{{cite web |last=Daly|first=Nathan|title=Example game written in julia using SDL2|website=[[GitHub]]|date=2019-07-31|url=https://github.com/NHDaly/PaddleBattle.jl|access-date=2019-08-02}}</ref><ref name="Go+Julia"/> * [[Lua (programming language)|Lua]]<ref name="sdl2bindings"/> * [[Nim (programming language)|Nim]]<ref>{{cite web|url=https://github.com/nim-lang/sdl2|title=SDL2 for Nim|publisher=GitHub|access-date=31 May 2022}}</ref> * [[OCaml]]<ref name="sdl2bindings"/> * [[Odin (programming language)|Odin]]<ref>{{cite web|url=https://pkg.odin-lang.org/vendor/sdl2/|title=Odin Vendor Library Collection}}</ref><ref>{{cite web|url=https://github.com/odin-lang/Odin/tree/master/vendor#sdl2|title=Odin GitHub repository|website=[[GitHub]] }}</ref> * [[Pascal (programming language)|Pascal]]<ref name="sdl2bindings"/> * [[Perl (programming language)|Perl]] (via SDL)<ref>{{cite web|url=https://github.com/PerlGameDev/SDL|title=PerlGameDev/SDL|publisher=GitHub|access-date=20 February 2019}}</ref> * [[PHP]]<ref>{{cite web|url=https://github.com/Ponup/php-sdl|title=PHP-SDL|publisher=GitHub|access-date=2019-10-28}}</ref> * [[Python (programming language)|Python]] (several, e.g. pygame_sdl2 and sdl2hl)<ref name="sdl2bindings"/> * [[Raku (programming language)|Raku]]<ref>{{cite web|url=https://modules.raku.org/dist/SDL2::Raw:cpan:TIMOTIMO)|title=SDL2::Raw|publisher=modules.raku.org|access-date=15 May 2020}}</ref> * [[Ring (programming language)|Ring]]<ref>{{Cite book|url=https://www.apress.com/gp/book/9781484258323|title=Beginning Ring Programming - From Novice to Professional {{!}} Mansour Ayouni {{!}} Apress|language=en}}</ref><ref>{{Cite web|url=https://ring-lang.github.io/doc1.16/libsdl.html|title = Using RingLibSDL — Ring 1.16 documentation}}</ref> * [[Rust (programming language)|Rust]]<ref name="sdl2bindings"/> * [[Vala (programming language)|Vala]] {{div col end}} === Supported back-ends === [[File:SDL Layers.svg|thumb|Abstraction layers of several SDL platforms]] Because of the way SDL is designed, much of its source code is split into separate modules for each operating system, to make calls to the underlying system. When SDL is compiled, the appropriate modules are selected for the target system. The following back-ends are available:<ref name="platforms" /> * [[Graphics Device Interface|GDI]] back-end for [[Microsoft Windows]]. * [[DirectX]] back-end; older SDL 1.2 uses DirectX 7 by default, while 2.0 defaults to DirectX 9 and can access up to DirectX 12. * [[Quartz (graphics layer)|Quartz]] back-end for [[macOS]] (dropped in 2.0). * [[Metal (API)|Metal]] back-end for [[macOS]] / [[iOS]] / [[tvOS]] since 2.0.8; older versions use OpenGL by default.<ref>{{cite web|url=https://www.libsdl.org/tmp/SDL/WhatsNew.txt|access-date=28 September 2020|title=WhatsNew.txt|archive-date=11 November 2020|archive-url=https://web.archive.org/web/20201111232012/https://www.libsdl.org/tmp/SDL/WhatsNew.txt|url-status=dead}}</ref><ref>{{cite web|url=http://lists.libsdl.org/pipermail/commits-libsdl.org/2017-December/002441.html|date=7 December 2017|title=[Commits] SDL: Enable building the Metal renderer by default, and weak lin...}}{{Dead link|date=May 2025 |bot=InternetArchiveBot |fix-attempted=yes }}</ref> * [[Xlib]] back-end for [[X Window System core protocol|X11]]-based [[windowing system]] on various operating systems.<ref>{{cite web |url=http://hg.libsdl.org/SDL/file/default/README-platforms.txt |title=SDL: README-platforms.txt@3e2f230a6d62 |website=Hg.libsdl.org |publisher=libsdl.org |access-date=2013-12-08 |archive-url=https://web.archive.org/web/20131215031050/http://hg.libsdl.org/SDL/file/default/README-platforms.txt |archive-date=2013-12-15}}</ref> * [[OpenGL]] contexts on various platforms.<ref>{{cite web |url=https://www.libsdl.org/release/SDL-1.2.15/docs/html/guidevideoopengl.html |title=Using OpenGL With SDL |access-date=2015-07-09 }}</ref> * [[EGL (API)|EGL]] back-end when used in conjunction with Wayland-based windowing system.,<ref>{{cite web |url=https://wiki.archlinux.org/index.php/Wayland#SDL |title=SDL and Wayland}}</ref> [[Raspberry Pi]]<ref>{{cite web|url=https://www.phoronix.com/scan.php?page=news_item&px=MTQ3MzA|title= Raspberry Pi Support Added To SDL2 Library|first= Michael|last= Larabel|date= 30 September 2013}}</ref> and other systems. * [[Vulkan (API)|Vulkan]] contexts on platforms that support it.<ref name="vulkan" /> * sceGu back-end, a Sony OpenGL-like backend native to the [[PlayStation Portable|PSP]]. <!-- Was seemingly added back to SDL 2, at least in restricted form: SDL 1.2 has support for [[RISC OS]] (dropped in 2.0). --> An unofficial [[Sixel]] back-end is available for SDL 1.2.<ref>{{cite web |url=https://github.com/saitoha/libsixel/tree/v1.6.1#sdl-integration-gaming-virtualization-etc |title=SDL 1.2 Sixel |website=[[GitHub]] |access-date=2016-04-09}}</ref> The [[Rockbox]] MP3 player firmware also distributes a version of SDL 1.2, which is used to run games such as [[Quake (video game)|Quake]].<ref>{{cite web |url=https://www.rockbox.org/wiki/SdlPluginPort |title=SDLPluginPort |access-date=2019-08-11}}</ref> == Reception and adoption == [[File:SDL-Workshop-IMG 2612.jpg|thumb|Workshop on SDL, [[University of Cádiz]] (2010)]] Over the years SDL was used for many commercial and non-commercial video game projects. For instance, [[MobyGames]] listed 120 games using SDL in 2013,<ref name=mobygames>{{cite web|url=http://www.mobygames.com/game-group/middleware-sdl/|archive-url=https://archive.today/20130208120319/http://www.mobygames.com/game-group/middleware-sdl/|url-status=dead|archive-date=8 February 2013|title=Middleware: SDL Group Description|quote=''Games that use the very portable Simple DirectMedia Layer.''|date=27 September 2013|access-date=18 May 2012|publisher=[[MobyGames]]}}</ref> and the SDL website itself listed around 700 games in 2012.<ref>{{cite web |url=https://www.libsdl.org/games.php?order=name&category=-1&completed=0&os=-1&match_name=&perpage=-1 |title=Games |date=18 May 2012 |access-date=18 May 2012 |publisher=libsdl.org |url-status=dead |archive-url=https://web.archive.org/web/20100629004347/http://www.libsdl.org/games.php?order=name&category=-1&completed=0&os=-1&match_name=&perpage=-1 |archive-date=29 June 2010 |df=dmy-all }}</ref> Important commercial examples are ''[[Angry Birds]]'',<ref name="sdlangry">{{cite web|url=http://www.galaxygameworks.com/testimonials.html |title=SDL Testimonials |publisher=Galaxygameworks.com |access-date=1 February 2012|archive-url=https://web.archive.org/web/20110716163841/http://www.galaxygameworks.com/testimonials.html |archive-date=16 July 2011}}</ref> ''[[Unreal Tournament]]'', and games developed using [[Valve Corporation|Valve]]'s [[Source Engine]], which uses SDL extensively for cross-platform compatibility; ones from the open-source domain are ''[[OpenTTD]]'',<ref name=OOTTD>{{cite web |url=http://www.openttd.org/en/development |title=Development |publisher=OpenTTD |access-date=19 March 2010 |archive-date=10 July 2014 |archive-url=https://web.archive.org/web/20140710225239/http://www.openttd.org/en/development |url-status=dead }}</ref> ''[[The Battle for Wesnoth]]''<ref name=wesnoth>{{cite web |url=http://wesnoth.org/wiki/CompilingWesnoth#Prerequisites |title=CompilingWesnoth |publisher=Wesnoth |date=27 February 2010 |access-date=19 March 2010 |archive-date=6 April 2009 |archive-url=https://web.archive.org/web/20090406100401/http://www.wesnoth.org/wiki/CompilingWesnoth#Prerequisites |url-status=dead }}</ref> or ''[[Freeciv]]''.<ref name=freeciv>{{cite web|url=http://freeciv.wikia.com/wiki/SDLClient |title=SDLClient - Freeciv.org |publisher=Freeciv.wikia.com |access-date=19 March 2010}}</ref> The cross-platform game releases of the popular [[Humble Indie Bundle]]s for Linux, Mac and Android are often SDL-based. SDL is also often used for later ports on new platforms with legacy code. For instance, the PC game [[Homeworld]] was ported to the [[Pandora (console)|Pandora]] [[handheld]]<ref name=homeworldpandora>{{cite web|url=https://pandorapress.net/2011/06/23/game-of-the-week-3-homeworld-sdl/|title=Game of the Week #3 – Homeworld SDL |date=23 June 2011 |publisher=pandorapress.net |access-date=8 May 2012 |author=((may88)) |quote=''[...] released port of HomeworldSDL. Forum member Edglex enables your Pandora to experience the excellent work done by the guys at HomeworldSDL.''}}</ref> and [[Jagged Alliance 2]] for Android<ref>[https://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=273148&page=1 JA2 Stracciatella Feedback » Jagged Alliance 2 Android Stracciatella Port RC2 Release - please test] {{webarchive|url=https://web.archive.org/web/20121023085701/http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=273148&page=1|date=23 October 2012}} on the Bear's Pit Forum, 3 October 2011</ref> via SDL. Also, several non video game programs use SDL; examples are the [[emulator]]s, such as [[DOSBox]], [[Fuse (emulator)|FUSE ZX Spectrum emulator]] and [[VisualBoyAdvance]]. There were several books written for development with SDL (see further reading). SDL is used in [[university]] courses teaching multimedia and [[computer science]], for instance, in a workshop about game programming using libSDL at the [[University of Cadiz]] in 2010, or a Game Design discipline at [[Universidade Tecnológica Federal do Paraná|UTFPR]] (Ponta Grossa campus) in 2015. === Video game examples using SDL === <gallery mode="packed" style="text-align:left" title="Video games adopting Simple DirectMedia Layer"> File:Unknown horizons 3176.PNG|''[[Unknown Horizons]]''<ref>{{cite web|url=https://github.com/fifengine/fifengine/wiki/Features|title=Features · fifengine/fifengine Wiki · GitHub|website=[[GitHub]]|access-date=9 March 2015}}</ref> File:Hwscreen.png|''Hedgewars''<ref>{{cite web|url=https://www.hedgewars.org/faq.html|title=FAQ Hedgewars|website=hedgewars.org|access-date=3 October 2014|quote=...SDL >= 1.2.5...}}</ref> File:Scorched 3D 39.1 screenshot 3.jpg|''[[Scorched 3D]]''<ref>{{cite web|url=http://www.scorched3d.co.uk/wiki/index.php/Development_Details|title=Development Details|website=scorched3d.co.uk|access-date=3 October 2014|quote=...Simple DirectMedia Layer - SDL for cross platform game windowing...|url-status=dead|archive-url=https://web.archive.org/web/20141006090704/http://www.scorched3d.co.uk/wiki/index.php/Development_Details|archive-date=6 October 2014|df=dmy-all}}</ref> File:Fretsonfirex1.jpg|''[[Frets on Fire]]''<ref>{{cite web|url=https://fretsonfire.sourceforge.net/about/|title=About the game|access-date=20 September 2021}}</ref> File:OOlite Mac OS X screenshot.jpg|''[[Oolite (computer game)|Oolite]]''<ref>{{cite web|url=https://github.com/OoliteProject/oolite-sdl-dependencies|title=OOlite SDL Dependencies|website=[[GitHub]]|date=29 May 2016|access-date=21 September 2021}}</ref> File:Wesnoth-1.6-5.jpg|''[[The Battle for Wesnoth]]''<ref>{{cite web|url=https://wiki.wesnoth.org/Roadmap|title=Roadmap - Wesnoth|website=www.wesnoth.org|access-date=9 March 2015|archive-date=6 March 2015|archive-url=https://web.archive.org/web/20150306190650/http://wiki.wesnoth.org/Roadmap|url-status=dead}}</ref> File:OpenTTD-1.3.3-en.png|''[[OpenTTD]]'' File:0 A.D. alpha 25 - playing as Spartans.jpg|''[[0 A.D. (video game)|0 A.D.]]''<ref>{{cite web|url=https://play0ad.com/new-release-0-a-d-alpha-19-syllepsis/|title=New Release: 0 A.D. Alpha 19 Syllepsis|date=November 26, 2015|access-date=20 September 2021|quote=Linux users, please be advised that SDL2 is now enabled by default on Linux.}}</ref> File:SMC15PromoShot.png|''[[Secret Maryo Chronicles]]''<ref>{{cite web|url=https://sourceforge.net/projects/smclone/|title=Secret Maryo Chronicles|website=sourceforge.net|date=28 August 2014 |access-date=3 October 2014|quote=... based on SDL ...}}</ref> File:Trine - Wizard Knight Caverns.jpg|''[[Trine (video game)|Trine]]'' File:Trine 2 - Deadly Dustland Three Heroes.jpg|''[[Trine 2]]''<ref>{{Cite web|title=Frozenbyte Support|url=https://trine2.com/help/faq/|access-date=2020-09-01|website=trine2.com}}</ref> File:Teeworlds.png|''[[Teeworlds]]''<ref>{{cite web | url=https://www.teeworlds.com/forum/viewtopic.php?id=12540 | title=[HowTo] Compile 0.7 on windows (Page 1) — Development — Teeworlds Forum }}</ref> </gallery> == See also == {{Portal|Free and open-source software}} {{div col |colwidth=15em|content= * [[Allegro (software library)|Allegro]] * [[ClanLib]] * [[Cross-platform support middleware]] * [[DirectFB]] * [[General Graphics Interface]] * [[GLFW]] * OpenML * [[Pygame]] * [[Raylib]] * [[Ren'Py]] * [[Simple and Fast Multimedia Library|SFML]] * [[SVGALib|SVGAlib]] }} == References == {{Reflist|30em}} == Further reading == * Alberto García Serrano: ''Programación de videojuegos en SDL'', Ediversitas, {{ISBN|84-95836-08-4}} (Spanish) * Ernest Pazera: ''Focus On SDL'', Muska & Lipman/Premier-Trade, {{ISBN|1-59200-030-4}} * Ron Penton: ''Data Structures for Game Programmers'', Muska & Lipman/Premier-Trade, {{ISBN|1-931841-94-2}} (''game programming examples with SDL'') * John R. Hall: ''Programming Linux Games'', No Starch, {{ISBN|1-886411-49-2}} (''First SDL book, by [[Loki Games]]'', archived online version: {{webarchive |url=https://web.archive.org/web/20030122200047/http://www.overcode.net/~overcode/writing/plg/local/release/plg-final-pdf-no-really-i-mean-it-this-time.pdf |date=22 January 2003 |title=PDF }}, {{webarchive |url=https://web.archive.org/web/20030214004255/http://www.overcode.net/~overcode/writing/plg/local/ |date=14 February 2003 |title=LaTex sources }}) == External links == * {{official website}} [[Category:Simple DirectMedia Layer| ]] [[Category:Application programming interfaces]] [[Category:Audio libraries]] [[Category:C (programming language) libraries]] [[Category:Cross-platform software]] [[Category:Graphics libraries]] [[Category:Linux APIs]] [[Category:MacOS APIs]] [[Category:Software using the zlib license]] [[Category:Video game development]] [[Category:Video game development software for Linux]] [[Category:Windows APIs]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Citation
(
edit
)
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Clarification needed span
(
edit
)
Template:Dead link
(
edit
)
Template:Div col
(
edit
)
Template:Div col end
(
edit
)
Template:ISBN
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Main other
(
edit
)
Template:Official website
(
edit
)
Template:Portal
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Template other
(
edit
)
Template:Use dmy dates
(
edit
)
Template:Webarchive
(
edit
)