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
(section)
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.
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)