Simple Directmedia Layer

Related tags

Game sdl2
Overview
                         Simple DirectMedia Layer

                                  (SDL)

                                Version 2.0

---
https://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting
with README.md

Enjoy!
	Sam Lantinga				([email protected])
Comments
  • Renderer line drawing ongoing issues

    Renderer line drawing ongoing issues

    It appears that when running on Windows with the OpenGL backend (not Direct3D) SDL_RenderDrawLine() is not plotting the final endpoint. So for example:

    SDL_RenderDrawLine(renderer, 200, 300, 300, 300);

    is not plotting the pixel at 300,300 at all. This worked correctly in SDL 2.0.16.

    The program below will demonstrate this; it should draw a green square without any black line, but with SDL 2.0.18 and Windows 10 it plots this: SDL_square Commenting out the OpenGL hint results in correct behavior.

    /**************************************************************\
    * Testcase to demonstrate a possible regression in SDL 2.0.18  *
    * when running with the OpenGL rendering backend on Windows 10 *
    \**************************************************************/
    
    #include <stdlib.h>
    #include <stdio.h>
    #include <unistd.h>
    #include "SDL2/SDL.h"
    
    #define SCREEN_WIDTH  640
    #define SCREEN_HEIGHT 500
    
    int main(int argc, char* argv[])
    {
    int y, running = 1;
    SDL_Event ev;
    SDL_Window *window;
    SDL_Renderer *renderer;
    
    if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_EVENTS) != 0)
    {
    	SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
    		"Testcase", SDL_GetError(), NULL);
    	return 1;
    }
    
    	SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl");
    
    window = SDL_CreateWindow("Testcase",  SDL_WINDOWPOS_CENTERED,  SDL_WINDOWPOS_CENTERED, 
    		SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);
    if (window == NULL)
    {
    	SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
    		"Testcase", SDL_GetError(), NULL);
    	SDL_Quit();
    	return 5;
    }
    
    renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED |SDL_RENDERER_PRESENTVSYNC);
    if (renderer == NULL)
    {
    	SDL_DestroyWindow(window);
    	SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
    		"Testcase", SDL_GetError(), NULL);
    	SDL_Quit();
    	return 6;
    }
    
    while (running)
    {
    	while (SDL_PollEvent(&ev))
    		switch (ev.type)
    		{
    			case SDL_QUIT:
    				running = 0;
    		}
    
    // Clear the window to white:
    	SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
    	SDL_RenderClear(renderer);
    
    // Draw a black vertical line from 300,200 to 300,300:
    
    	SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
    	SDL_RenderDrawLine(renderer, 300, 200, 300, 300);
    
    // Draw a series of green horizontal lines from x = 200 to x = 300,
    // these should overwrite the previously-drawn black line:
    
    	SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
    	for (y = 200; y <= 300 ; y++)
    		SDL_RenderDrawLine(renderer, 200, y, 300, y);
    
    	SDL_RenderPresent(renderer);
    }
    
    SDL_DestroyRenderer(renderer);
    SDL_DestroyWindow(window);
    SDL_Quit();
    
    exit(0);
    }
    
    
    opened by rtrussell 159
  • Ideas for SDL 3

    Ideas for SDL 3

    This bug report was migrated from our old Bugzilla tracker.

    Reported in version: don't know Reported for operating system, platform: All, All

    Comments on the original bug report:

    On 2020-01-22 15:55:25 +0000, David Demelier wrote:

    Hi,

    I already sent some ideas by email but I've been convinced by an individual on the IRC channel to do this on the bugzilla to get reviews.

    Here's a list of things I'd love to see and implement (as a developer myself) for SDL 3.

    Any feedback is welcomed.

    Stricter coding, naming style.

    For the moment there are high number of style issues in the API. Some symbols are SDL_lowerCased and some are SDL_UpperCased. Some are not even prefixed by SDL_.

    Every functions that are tighed to a specific structure should:

    • Be prefixed by its name: SDL_Foo (object), SDL_FooOpen, SDL_FooDestroy, SDL_FooUpdate, etc.
    • Take the object as first argument: SDL_FooUpdate(SDL_Foo *, ...);

    Getter and setters should be named as following:

    • SDL_Namespace(Get|Set)What (e.g. SDL_Renderer(Get|Set)DrawColor)

    Constructors and destructors should be named as following if applicable:

    • SDL_NamespaceOpen (e.g. SDL_JoystickOpen)
    • SDL_NamespaceDestroy (e.g. SDL_JoystickDestroy)

    If objects are not meant to be dynamically allocated, the names "Init" and "Finish" or "Close" can also be used.

    Proper semantic versioning.

    One SDL 2.0.x version added sensor support, while it should be bugfix instead. The current versioning scheme makes too difficult to check what features were provided and when at a glance.

    What did 2.0.1 provided? What 2.0.2 provided?

    In the head of packagers, they feel like they are bugfixes while they've added new APIs!

    The Semantic Versioning is the most appropriate versioning scheme for libraries.

    • Major : massive breakage allowed in the API (not every year though, somewhat like every 5-6 years).
    • Minor : improvements and new features added with API compatibility honored
    • Patch : simple bugfixes

    Simplify development process

    At the moment there is no much information about the way to contribute to SDL. One can ping maintainer using patches via mail but are sometimes missed. Also they are linked to an individual and can not be reviewed by others.

    Since SDL does not have a system for reviewing yet, I propose that a development mailing-list is re-opened and people could send their patch via hg email as the bugzilla is more tailored for bug reporting.

    Removing useless platforms.

    • arts: no longer used
    • winrt: too, AFAIK

    Fixing inconsistencies where some functions use plain primitives types rather than structs.

    If we have structs, then functions should always operate on them. Since C99, compound literals makes life easier while passing temporaries to functions.

    • SDL_SetRenderDrawColor takes 4 ints

    • SDL_SetPaletteColor take a SDL_Color object

    • SDL_RenderDrawLine takes 4 ints

    • SDL_RenderSetClipRect takes a SDL_Rect

    The color handling is sometimes in 4 ints, sometimes SDL_Color.

    Getting rid of dozens of buildsystems to unique one: CMake.

    There are just too many build systems in the tree and that is too complicated for users, developers and packagers. Also, having only one for a portable library that SDL is, makes difficult to merge all checks/operations in all build systems.

    Also, lots of people do not rely on the SDL CMake configuration package files provided as autoconf does not install them. Having CMake only will simplify the integration and maintainance.

    Use doxygen documentation to avoid outdated information on the wiki.

    I've literally spent 3 hours to document the sensor API on the wiki. That's a big waste of time. SDL headers are already almost documented in doxygen, it should be completed with missing bits and the only source of truth.

    Changing something in one enum results in editing the wiki as well.

    Rename pkg-config files

    The SDL pkg-config file is sdl2 while addons are SDL2_*.

    Making addons first class citizen and built from the same source tree with proper naming.

    The SDL addons feel they are separate projects as they still do not have any public visibility from the libsdl.org website. At a glance, a newcomer don't even know these libraries exist.

    They have the same troubles as the above paragraphs (cmake, consistency, etc.).

    I propose the simple inclusion of these addons with a new naming scheme for them and a simpler API. Also, they will be available as separate shared/static libraries controlled at build time. Thus, people who don't need SDL_mixer or SDL_ttf can simply not build/link theme.

    SDL_ttf new API

    Every functions start with SDL_Font.

    • SDL_Font (struct)
    • SDL_FontStyle (enum SDL_FONT_SOLID, SDL_FONT_SHADED, SDL_FONT_BLENDED)
    • TTF_Init -> SDL_FontInit()
    • TTF_OpenFont* -> SDL_FontOpen*
    • TTF_(Get|Set)Font* -> SDL_Font(Get|Set)*
    • TTF_FontHeight -> SDL_FontGetHeight
    • TTF_FontAscent -> SDL_FontGetAscent
    • TTF_FontDescent -> SDL_FontGetDescent
    • TTF_FontLineSkip -> SDL_FontGetLineSkip
    • TTF_FontFaces -> SDL_FontGetFaces
    • TTF_GlyphIsProvided -> SDL_FontIsGlyphProvided
    • TTF_GlyphMetrics -> SDL_FontGetGlyphMetrics
    • TTF_SizeText -> Should be removed, UTF-8 is the standard
    • TTF_SizeUTF8 -> SDL_FontTextMetrics
    • TTF_SizeUNICODE -> Should be removed, UTF-16 is deprecated
    • TTF_Render* -> SDL_FontRender(const char *, SDL_FontStyle) (UTF-8 only)

    SDL_image new API

    Every function start with SDL_Image.

    • SDL_ImageFormat (enum SDL_IMAGE_(CUR|ICO|BMP|PNM|...))
    • IMG_Init -> SDL_ImageInit()
    • IMG_Load -> SDL_ImageOpen(const char *path)
    • IMG_Load_RW -> SDL_ImageOpen_RW
    • IMG_LoadTyped_RW -> SDL_ImageOpenTyped_RW(SDL_RWOps *, SDL_ImageFormat)
    • IMG_is* -> SDL_ImageGetType (returns SDL_ImageFormat)

    SDL_mixer new API

    Basic functions start with SDL_Mixer.

    • Mix_Init -> SDL_MixerInit
    • Mix_OpenAudio -> SDL_MixerOpen
    • Mix_CloseAudio -> SDL_MixerClose
    • Mix_GetNumChunkDecoders -> SDL_MixerGetNumChunkDecoders
    • Mix_GetChunkDecoder -> SDL_MixerGetChunkDecoder

    Channel and groups functions

    • Mix_AllocateChannels -> SDL_ChannelsAllocate
    • Mix_ReserveChannels -> SDL_ChannelsReserve
    • Mix_Group* -> SDL_ChannelGroup*
    • Mix_HaltGroup -> SDL_ChannelGroupHalt
    • Mix_Volume -> SDL_ChannelVolume
    • Mix_PlayChannel -> SDL_ChannelPlay
    • Mix_PlayChannelTimed -> SDL_ChannelPlayTimed
    • Mix_FadeInChannel -> SDL_ChannelFadeIn
    • Mix_FadeInChannelTimed -> SDL_ChannelFadeInTimed
    • Mix_Pause -> SDL_ChannelPause
    • Mix_Resume -> SDL_ChannelResume
    • Mix_HaltChannel -> SDL_ChannelHalt
    • Mix_ExpireChannel -> SDL_ChannelExpire
    • Mix_FadeOutChannel -> SDL_ChannelFadeOut
    • Mix_ChannelFinished -> SDL_ChannelHasFinished
    • Mix_Playing -> SDL_ChannelIsPlaying
    • Mix_Paused -> SDL_ChannelIsPaused
    • Mix_FadingChannel -> SDL_ChannelGetFading
    • Mix_GetChunk -> SDL_ChannelGetChunk

    Chunk functions

    • Mix_LoadWAV -> SDL_ChunkOpen
    • Mix_LoadWAV_RW -> SDL_ChunkOpen_RW
    • Mix_QuickLoad -> SDL_ChunkQuickOpen
    • Mix_QuickLoad_RW -> SDL_ChunkQuickOpen_RW
    • Mix_FreeChunk -> SDL_ChunkDestroy
    • Mix_VolumeChunk -> SDL_ChunkGetVolume

    Music functions

    • Mix_GetNumMusicDecoders -> SDL_MusicGetNumDecoders
    • Mix_GetMusicDecoder -> SDL_MusicGetDecoder
    • Mix_LoadMUS -> SDL_MusicOpen
    • Mix_FreeMusic -> SDL_MusicDestroy
    • Mix_PlayMusic -> SDL_MusicPlay
    • Mix_FadeInMusic -> SDL_MusicFadeIn
    • Mix_FadeInMusicPos -> SDL_MusicFadeInPos
    • Mix_HookMusic -> SDL_MusicHook
    • Mix_VolumeMusic -> SDL_MusicVolume
    • Mix_PauseMusic -> SDL_MusicPause
    • Mix_ResumeMusic -> SDL_MusicResume
    • Mix_RewindMusic -> SDL_MusicRewind
    • Mix_SetMusicPosition -> SDL_MusicSetPosition
    • Mix_SetMusicCMD -> SDL_MusicSetCommand
    • Mix_HaltMusic -> SDL_MusicHalt
    • Mix_FadeOutMusic -> SDL_MusicFadeOut
    • Mix_HookMusicFinished -> SDL_MusicSetHookFinished
    • Mix_GetMusicType -> SDL_MusicGetType
    • Mix_PlayingMusic -> SDL_MusicIsPlaying
    • Mix_PausedMusic -> SDL_MusicIsPaused
    • Mix_FadingMusic -> SDL_MusicIsFading
    • Mix_GetMusicHookData -> SDL_MusicGetHookFinished

    Effect functions

    • Mix_RegisterEffect -> SDL_EffectRegister
    • Mix_UnregisterEffect -> SDL_EffectUnregister
    • Mix_UnregisterAllEffects -> SDL_EffectUnregisterAll
    • Mix_SetPostMix -> SDL_EffectSetPostMix
    • Mix_SetPanning -> SDL_EffectSetPanning
    • Mix_SetDistance -> SDL_EffectSetDistance
    • Mix_SetPosition -> SDL_EffectSetPosition
    • Mix_SetReverseStereo -> SDL_EffectSetReverseStereo

    SDL_net

    To my humble opinion, this library should be removed as they are many networking library in C including POSIX.

    On 2020-01-23 02:56:03 +0000, Sam Lantinga wrote:

    I agree with most of this feedback, and like the satellite library naming suggestions, thanks!

    Some comments on the build system:

    Not all platforms have CMake, and many developers don't have CMake installed. Windows developers should be able to use Visual Studio, Mac developers should be able to use Xcode. I should be able to use autoconf. :)

    I'm fine with CMake being the recommended build environment, and even stripping out support for non-UNIX platforms from it, but I've run into enough problems with it over the years that I don't use CMake. Also, note that the official SDL windows binaries are built on Mac using mingw64, to integrate with build scripts and avoid C runtime dependencies, and that currently requires autotools.

    On 2020-03-23 22:53:39 +0000, wrote:

    Simplify development process

    I think there should be more discussion on just moving the center of development to github / git. I'm aware that this has been proposed by many people over the years, but I feel it hasn't gotten the proper attention it needs.

    Github or at least git, would make it much easier for people to contribute to the development of SDL.

    On 2020-03-24 01:04:30 +0000, Ryan C. Gordon wrote:

    (In reply to daegon.dhsk from comment # 2)

    Github or at least git, would make it much easier for people to contribute to the development of SDL.

    This is a hard no from me, both to GitHub and git itself.

    --ryan.

    On 2020-03-24 01:15:27 +0000, wrote:

    (In reply to Ryan C. Gordon from comment # 3)

    (In reply to daegon.dhsk from comment # 2)

    Github or at least git, would make it much easier for people to contribute to the development of SDL.

    This is a hard no from me, both to GitHub and git itself.

    --ryan.

    Could we get some details on the background?

    On 2020-03-24 03:32:52 +0000, Ryan C. Gordon wrote:

    (In reply to daegon.dhsk from comment # 4)

    Could we get some details on the background?

    Even if I didn't personally think git is a lousy system, Mercurial is working fine for us and changing it just introduces unnecessary friction.

    As for GitHub: we have been burned by cloud providers several times over the past 20 years, and have spent significant effort engineering our infrastructure so we own all of it. Becoming reliant on an unnecessary for-profit company for the most crucial piece of our workflow is not something we're willing to do.

    --ryan.

    On 2020-03-24 08:15:06 +0000, David Demelier wrote:

    (In reply to daegon.dhsk from comment # 2)

    Simplify development process

    I think there should be more discussion on just moving the center of development to github / git. I'm aware that this has been proposed by many people over the years, but I feel it hasn't gotten the proper attention it needs.

    Github or at least git, would make it much easier for people to contribute to the development of SDL.

    I can't understand this hype to request people to move to Git. Git is by far much more complicated than Mercurial so I'd like to know what's “easier” for you to contribute.

    If by easier you mean that you can send a pull request, please not that sending a patch is by far much easier:

    hg clone http://hg.libsdl.org/SDL && cd SDL
    vim
    hg ci
    hg export OR hg email
    

    That's it.

    You can't come to a project and ask them to change their tooling, this is a subjective material. I don't like Git but I don't ask projects to move from Git to Mercurial. I don't like meson and I don't request projects that use meson to switch to CMake. I can go for a while.

    The only way we could improve the contributing process for SDL is to provide a detailed documentation because for now there are not that much. So some people send emails and some tasks on bugzilla. We need a unified, detailed process. That's it.

    On 2020-04-02 22:25:09 +0000, David Ludwig wrote:

    (In reply to David Demelier from comment # 6)

    If by easier you mean that you can send a pull request, please not that sending a patch is by far much easier:

    hg clone http://hg.libsdl.org/SDL && cd SDL
    vim
    hg ci
    hg export OR hg email
    

    That's it.

    Wait, vim is now part of the easy route?! (and I like vim, for some things at least) ;-)

    In all seriousness, a move to git sounds ok to me, though not one to GitHub and its partially-closed nature. I find git's overall ecosystem to be MUCH nicer than Mercurial's (enough that I am willing to argue that Mercurial isn't always the "easiest" option, not any more at least), and would probably welcome a move to git repos. I have, within the past few years, lost Mercurial support in some valuable-to-me tools (BitBucket, especially), and finding good, alternative tooling hasn't always been easy.

    As for the initial suggestions, I'm in favor of a lot of it! I especially like the idea of iterating on SDL's function names. Having a scheme along the lines of SDL_ seems very helpful with regards to editor auto-completion.

    I'd like to add one suggestion with regards to naming: include the major version number in the prefix. I.e. SDL3.h, SDL3_RenderSetDrawColor, etc. It would make SDL 3.x detection be a matter of finding a header, rather than finding a header and parsing it, which might not always be possible (with C++'s __has_include, for example). It would also help make it possible to distinguish SDL 1.x and 2.x code from 3.x code, which I could see helping if and when porting stuff to 3.x.

    Regarding dropping WinRT, it's my understanding that Xbox One still requires using those APIs. Unless that changes, I think removing that support would be bad (though, that platform's SDL code could definitely use some improvement, with at least some pruning of older, WinRT SDK support).

    Regarding build-systems, I like the idea of better CMake integration, but I would like to see file-globbing of SDL's src directory be an option, too, at least for platforms where this is possible. (One of these days, I should finish my support for this. I've had prototypes working on Apple-platforms, as well as Windows, at one point or another).

    As for including satellite libraries in SDL-proper, this makes me leery as it seems like it would introduce a lot of additional dependencies in SDL, which is already inherently complex due to the number of platforms it supports. Having naming changes within them does sound nice, and perhaps possible without needing to include them in SDL itself.

    On 2020-05-26 07:50:59 +0000, Jan Niklas Hasse wrote:

    Windows developers should be able to use Visual Studio, Mac developers should be able to use Xcode.

    Both can be generated using CMake :)

    On 2020-11-28 11:36:22 +0000, Dominik Reichardt wrote:

    Windows developers should be able to use Visual Studio, Mac developers should be able to use Xcode.

    Both can be generated using CMake :)

    I have only tried a few times but those projects all didn't generate a working xcode project. No idea if this is a problem with their CMake files but if you have to work extensively on the Xcode project file each time you generate it from code, then it is no good, IMO worse than a partially working included one.

    So, when I see there is only CMake, I try to find whether someone else already built an Xcode project file or just turn away and don't bother.

    Generation of the unix stuff generally works though.

    On 2020-11-28 11:39:12 +0000, Jan Niklas Hasse wrote:

    I have only tried a few times but those projects all didn't generate a working xcode project.

    What do you mean by "those projects"?

    On 2020-11-28 11:44:23 +0000, Dominik Reichardt wrote:

    I have only tried a few times but those projects all didn't generate a working xcode project.

    What do you mean by "those projects"?

    the projects that had only Cmake and I tried to generate the Xcode project with

    On 2020-11-28 11:59:54 +0000, Jan Niklas Hasse wrote:

    Ah I see. I think some projects don't take Xcode into account and use some unidiomatic CMake constructs that break it.

    It is definitely possible though and works great in my projects. It's a good idea to add a CI job which generates and builds with -GXcode.

    enhancement 
    opened by SDLBugzilla 101
  • wayland client-side decorations

    wayland client-side decorations

    The attached set of patches implement client-side window decorations on Wayland using 'libdecoration' from https://gitlab.gnome.org/jadahl/libdecoration. The libdecoration dependency is downloaded directly from upstream at build-time.

    sdl_decoration_scale sdl_decoration_sprite2

    This fixes https://bugzilla.libsdl.org/show_bug.cgi?id=2710

    This fixes #3739.

    Cheers and thanks for making Linux gaming happen :-)

    opened by christianrauch 93
  • video: Prefer Wayland over X11

    video: Prefer Wayland over X11

    This is a ~~draft~~ patch that will (at last) prioritize the Wayland video driver over X11. This is here purely for internal testing only and is NOT meant for wider community testing; to test SDL Wayland support you should set SDL_VIDEODRIVER=wayland instead.

    Click here for the SDL Wayland bug tracker.

    The Big List of Annoying Things That Aren't SDL's Fault:

    The Big List of EGL Stuff That Might Be a Problem:

    This Big List of Things in X11 That Wayland Might Also Want but It's Not a Huge Deal:

    Known Issues:

    Fixes #2710. Fixes #4988.

    opened by flibitijibibo 73
  • Create git submodules for third party dependencies

    Create git submodules for third party dependencies

    Right now we track external dependencies as code checked into the SDL_* libraries with .patch files with SDL specific changes to those packages. Those are cumbersome to maintain (some of the .patch files are out of date) and time consuming to update when upstream changes occur or we want to pull in CVE fixes and other improvements.

    I propose that we fork the upstream projects into libsdl-org (or create repositories for those projects not already in git) and use git submodules to include those dependencies into SDL libraries. This would largely affect SDL_image and SDL_mixer, but could be used anywhere we depend on third party libraries.

    The documentation for git submodules is here: https://git-scm.com/book/en/v2/Git-Tools-Submodules

    It looks like the work flow is greatly complicated by using git submodules, and it's easy to forget the various steps needed to use them properly if the submodule options aren't already in the git config.

    @smcv, do you have thoughts on the pros and cons of this approach?

    @icculus, @1bsyl, @sezero, what are your thoughts?

    enhancement 
    opened by slouken 63
  • Android: Touchscreen controlling doesn't work at some devices when using SDL_GetTouchFinger() calling by touch IDs

    Android: Touchscreen controlling doesn't work at some devices when using SDL_GetTouchFinger() calling by touch IDs

    Hello!

    Recently I found that some users has problem that touchscreen doesn't work for them. Later, by my log file, I found that SDL_GetNumTouchDevices() got returned two touch screen devices, and seems, one of them is a ghost tha steals control and makes no way to use the real one. At my phone the touch control works fine, however, I suddely found it returns !!!6!!! touch devices :scream:

    (Note, to choose the device to work, I do scan all devices to find any that has fingers placed)

    • My phone is SGN9 with Android 10
    • My buddy's phone is another Samsung phone with Android 11
    • Other folk used Xiaomi with Android 11 and had the similar problem of touch screen not working.
    • I use SDL 2.0.18, but plan to update into 2.0.20.
    • All returned touch devices described as direct input

    Was this bug been fixed at 2.0.20? Why these mystery touch devices got appear here?

    opened by Wohlstand 56
  • wayland: Always assume configure is wrong for non-resizable windows.

    wayland: Always assume configure is wrong for non-resizable windows.

    Configure events from compositors have an extremely annoying habit of giving us completely bogus sizes, from all sorts of places. Thankfully, the protocol gives us the ability to completely ignore the width/height and just stick with what we know, so for all windows that are not meant to be resized, pretend we never even got the width/height at all, the compositor is required to respect our dimensions whether they match configure's suggestion or not.

    Tested with FEZ, Capsized, Streets of Rage 4, a handful of Unity games, Baba Is You, Portal 2, and Super Hexagon.

    This fixes an issue with xdg-shell where going from fullscreen->windowed would give us configure event that very clearly ignored dimensions passed via a SetWindowSize call. Should fix #4572 to the extent that is possible (need a libdecor and GNOME 40 update first). #4571 is still an issue.

    CC @cgutman, @christianrauch, @dos1. This manages to remove the dispatch, but a notable detail is that ~~this also made floating_width/height obsolete as far as I could tell~~ nope, was still needed, this is fixed. Testing both fullscreen toggling and maximize/restore seemed to work just fine on GNOME 40 and Plasma 5.22.

    opened by flibitijibibo 50
  • Android black screen on resume using OpenGL ES 2.0

    Android black screen on resume using OpenGL ES 2.0

    This bug report was migrated from our old Bugzilla tracker.

    Reported in version: 2.0.14 Reported for operating system, platform: Android (All), ARM

    Comments on the original bug report:

    On 2021-02-02 22:01:29 +0000, Vitaly Novichkov wrote:

    Hello!

    I found that the bug against the black screen on resuming got back, it happens on various devices:

    • Open the game
    • Switch to another application, try to do anything
    • Try to switch the game back
    • You'll get the black screen
    • However, the game itself will resume its normal work, but a black screen
    • No matter what to draw: textures or color-filled shapes
    • I do render into texture, then into the screen. Also, I draw some shapes on the screen directly. This happens on Android 4.1, 5.1, Android 10, also on Android 8 the bug confirmed.

    At the logger I get the next spamming:

    02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/EGL_emulation: tid 3690: eglMakeCurrent(1500): error 0x3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/libEGL: eglMakeCurrent:777 error 3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/EGL_emulation: tid 3690: eglMakeCurrent(1500): error 0x3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/libEGL: eglMakeCurrent:777 error 3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/EGL_emulation: tid 3690: eglMakeCurrent(1500): error 0x3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/libEGL: eglMakeCurrent:777 error 3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/EGL_emulation: tid 3690: eglMakeCurrent(1500): error 0x3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/libEGL: eglMakeCurrent:777 error 3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/EGL_emulation: tid 3690: eglMakeCurrent(1500): error 0x3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/libEGL: eglMakeCurrent:777 error 3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/EGL_emulation: tid 3690: eglMakeCurrent(1500): error 0x3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/libEGL: eglMakeCurrent:777 error 3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/EGL_emulation: tid 3690: eglMakeCurrent(1500): error 0x3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/libEGL: eglMakeCurrent:777 error 3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/EGL_emulation: tid 3690: eglMakeCurrent(1500): error 0x3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/libEGL: eglMakeCurrent:777 error 3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/EGL_emulation: tid 3690: eglMakeCurrent(1500): error 0x3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/libEGL: eglMakeCurrent:777 error 3002 (EGL_BAD_ACCESS) 02-03 00:55:02.482 3666-3690/ru.wohlsoft.thextech.debug E/EGL_emulation: tid 3690: eglMakeCurrent(1500): error 0x3002 (EGL_BAD_ACCESS)


    If needed, I can try to compose a simple unit test that reproduces this bug

    On 2021-02-03 07:21:14 +0000, Sylvain wrote:

    Did you make sure not to call any rendering function between the two events SDL_WILL_ENTER_BACKGROUND and SDL_DID_ENTER_FOREGROUND

    see docs/README-android.md

    On 2021-02-03 21:50:38 +0000, Vitaly Novichkov wrote:

    Oh, interesting, how I messed this up? Gonna try this out... Thanks for the notice!

    On 2021-02-03 22:19:12 +0000, Vitaly Novichkov wrote:

    btw, does that also counting the rendering into the texture too? Okay, I'll check.

    On 2021-02-03 23:16:12 +0000, Vitaly Novichkov wrote:

    Nope, that didn't help completely, even I made the strict avoiding of any render functions being called, I still can get the black screen and the EGL_BAD_ACCESS error after I switched application back

    On 2021-02-04 07:24:08 +0000, Sylvain wrote:

    that really really is a reason, are you depleting the event loop ? no multi-threading ?

    really stop using renderer after reading WILL_ENTER_BG, and start again using DID_ENTER_FG.

    are you using the SDL_Renderer or your own context ?

    On 2021-02-04 08:02:26 +0000, Vitaly Novichkov wrote:

    are you depleting the event loop ?

    No, I do call the event loop sequentially

    no multi-threading ?

    No, single threading

    really stop using renderer after reading WILL_ENTER_BG, and start again using DID_ENTER_FG.

    Oh, I did a mistake - I used the WILL_ENTER_FG instead of WILL_ENTER_BG event, I should re-try this experiment again.

    are you using the SDL_Renderer or your own context ?

    I use SDL_Renderer

    On 2021-02-04 08:32:58 +0000, Vitaly Novichkov wrote:

    Okay, I really made sure no render will be called between those events, I even added asserts to crash if any of the render calls will be executed after SDL_APP_WILLENTERBACKGROUND event, and allow them to be called after SDL_APP_DIDENTERFOREGROUND event that unlocks the render.

    On 2021-02-04 08:35:03 +0000, Vitaly Novichkov wrote:

    The result is the same, on Android 10:

    • open the game
    • switch another application (my log will print the fact "SDL_APP_WILLENTERBACKGROUND" was coming, I made sure those messages be printed to see the result)
    • All big render calls got blocked by a boolean
    • All small routine render calls got blocked by assert
    • Switch the game back (my log will print the fact of "SDL_APP_DIDENTERFOREGROUND")
    • Black screen

    On 2021-02-04 08:41:00 +0000, Vitaly Novichkov wrote:

    I also checked the fact of any attempts to call the render calls, just by spamming of the same message into the log, the spamming is off completely when entering background, and getting on back when entered background.

    On 2021-02-04 08:48:27 +0000, Sylvain wrote:

    are you depleting the event loop ? No, I do call the event loop sequentially

    before each frame, and also periodically, you must poll all the events.

    Just to make sure, all functions using the SDL_renderer includes: RenderCopy, RenderPresent, CreateTexture, UpdateTexture, ..

    On 2021-02-04 08:55:37 +0000, Vitaly Novichkov wrote:

    before each frame, and also periodically, you must poll all the events.

    Yes, that what I already do, I poll all events in every loop cycle

    Just to make sure, all functions using the SDL_renderer includes:

    CreateTexture, UpdateTexture I don't call them during the loop except for the lazy-decompression algorithm that gets executed when calling the big render call, I blocked by the boolean

    RenderCopy, RenderPresent Both blocked by the boolean I do set

    On 2021-02-04 09:15:34 +0000, Sylvain wrote:

    This look strange ...

    you have recent SDL2 lib + sync'ed java file ?

    you can add trace here: http://hg.libsdl.org/SDL/file/1cde3dd0f44d/src/video/android/SDL_androidevents.c to backup and restore context

    maybe log the event: SDL_RENDER_DEVICE_RESET

    with those print do you have a full adb log to check ?

    try with a simpler test case ?

    On 2021-02-04 09:47:04 +0000, Vitaly Novichkov wrote:

    Closing to the evening (UTC+3) I'll try to compose a simple test program that simulates my and verify the work.

    On 2021-02-04 09:52:02 +0000, Vitaly Novichkov wrote:

    Anyway, without of SDL2 patching, I did the tracking of SDL_RENDER_DEVICE_RESET event, and I got next:

    02-04 12:50:08.444 2791-2814/ru.wohlsoft.thextech.debug D/TRACKERS: Android: Entering background
    02-04 12:50:16.879 2791-2814/ru.wohlsoft.thextech.debug D/TRACKERS: Android: Resumed foreground
    02-04 12:50:19.591 2791-2814/ru.wohlsoft.thextech.debug D/TRACKERS: Android: Entering background
    02-04 12:50:23.807 2791-2814/ru.wohlsoft.thextech.debug D/TRACKERS: Android: Resumed foreground
    02-04 12:50:27.021 2791-2814/ru.wohlsoft.thextech.debug D/TRACKERS: Android: Entering background
    02-04 12:50:32.787 2791-2814/ru.wohlsoft.thextech.debug D/TRACKERS: Android: Resumed foreground
    02-04 12:50:32.787 2791-2814/ru.wohlsoft.thextech.debug D/TRACKERS: Android: Render Device Reset
    

    I had multiple times to go into the background, and then, resume back, but the thing got blacked once SDL_RENDER_DEVICE_RESET was happened at my log

    On 2021-02-04 09:54:51 +0000, Vitaly Novichkov wrote:

    So, seems once this event came:


    SDL_RENDER_TARGETS_RESET

    the render targets have been reset and their contents need to be updated (>= SDL 2.0.2)

    SDL_RENDER_DEVICE_RESET

    the device has been reset and all textures need to be recreated (>= SDL 2.0.4)

    I should reload all the textures again, right?

    On 2021-02-04 09:55:33 +0000, Vitaly Novichkov wrote:

    I'll try some in the evening after my workday will finish.

    On 2021-02-04 12:26:04 +0000, Sylvain wrote:

    yep, re-create texture once you get the device reset. (you don't need to recreate the SDL renderer)

    On 2021-02-04 12:53:31 +0000, Sylvain wrote:

    Updated the android README file because this is a recurrent issue http://hg.libsdl.org/SDL/rev/8609e27b3eed

    feel free to improve it!

    opened by SDLBugzilla 47
  • SDL Rendering raw NV12 with OpenGLES2 (HW acceleration) issue

    SDL Rendering raw NV12 with OpenGLES2 (HW acceleration) issue

    I am rendering raw frames from a camera using SDL with hardware acceleration, frames are NV12 pixel format. The NV12 frames are rendered with opengles2 for fast rendering and low CPU usage. The platform is Rockchip RK3568 for reference. SDL2 with opengles2/3 and hw acceleration works fine. Streaming the camera using raw NV12 gives ~30% CPU usage out of 400%, and using ffplay with SDL2 (opengles2 with hw acceleration) gives ~60% CPU usage out of 400% due to possibly converting NV12 and resizing via software prior to rendering with SDL2 (opengles2 and hw acceleration). This is the reason i want to use SDL_PIXELFORMAT_NV12.

    SDL info

    width: 1920 x height: 1080
    INFO: libSDL: compiled with=2.0.19 linked against=2.0.19
    INFO: Renderer Driver (default): (null)
    INFO: Renderer Driver (set): opengles2
    SDL information:
        SDL_FRAMEBUFFER_ACCELERATION: (null)
        SDL_RENDER_DRIVER: opengles2
        SDL_RENDER_OPENGL_SHADERS: (null)
        SDL_RENDER_LOGICAL_SIZE_MODE: (null)
        SDL_RENDER_SCALE_QUALITY: (null)
        SDL_RENDER_VSYNC: (null)
        SDL_VIDEO_HIGHDPI_DISABLED: (null)
        SDL_VIDEO_WIN_D3DCOMPILER: (null)
        SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT: (null)
        SDL_VIDEO_DOUBLE_BUFFER: (null)
    
    

    the issue

    The Image rendered looks wrong with SDL_PIXELFORMAT_NV12, maybe some padding missed with SDL_PIXELFORMAT_NV12

    Here is the image rendered (raw frame) with SDL_PIXELFORMAT_NV12: SDL_PIXELFORMAT_NV12_1920x1080_scrot

    Here is the raw frame from the camera (for analysis) and a png created with ffmpeg from the raw nv12 frame: 1920x1080.nv12.tar.gz

    Checking the image with ffmpeg: ffmpeg -y -f rawvideo -s 1920x1080 -pix_fmt nv12 -i 1920x1080.nv12 -pix_fmt rgb24 1920x1080.nv12.png 1920x1080 nv12

    Streaming with ffplay: ffplay_1920x1080

    excerpt code

    The code used to render the frame:

    sdlRenderer = SDL_CreateRenderer(sdlWindow, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE | SDL_RENDERER_PRESENTVSYNC)
    sdlTexture = SDL_CreateTexture(sdlRenderer, SDL_PIXELFORMAT_NV12, SDL_TEXTUREACCESS_STREAMING, videoIn->width, videoIn->height + 32);
    
    SDL_LockTexture(sdlTexture, NULL, (void**)&p, &pitch);
    if (videoIn->formatIn == V4L2_PIX_FMT_NV12) {
        memcpy(p, videoIn->framebuffer, videoIn->bsize /*videoIn->width * (videoIn->height) * 3 / 2*/);
    } else {
        memcpy(p, videoIn->framebuffer, videoIn->width * (videoIn->height) * 2);
    }
    SDL_UnlockTexture(sdlTexture);
    SDL_RenderClear(sdlRenderer);
    SDL_RenderCopy(sdlRenderer, sdlTexture, NULL, NULL);
    SDL_RenderPresent(sdlRenderer);
    
    opened by avafinger 42
  • Triangles rendering (with per vertex color)

    Triangles rendering (with per vertex color)

    Second attempt to render triangles with SDL, adding SDL_RenderGeometry

    In this version, triangles can be non uniform, with a per vertex color. Textures can also have a per vertex modulation.

    Using the adviced prototype:

    typedef struct SDL_Vertex{
        SDL_FPoint position;        /**< Vertex position, in SDL_Renderer coordinates  */
        SDL_Color  color;           /**< Vertex color */
        SDL_FPoint tex_coord;       /**< Normalized texture coordinates, if needed */
    } SDL_Vertex;
    
    /**
     *  \brief Render a list of triangles, optionally using a texture and indices into the vertex array
     *  Color and alpha modulation is done per vertex (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).
     *
     *  \param texture      (optional) The SDL texture to use.
     *  \param vertices     Vertices.
     *  \param num_vertices Number of vertices.
     *  \param indices      (optional) An array of integer indices into the 'vertices' array, if NULL all vertices will be rendered in sequential order.
     *  \param num_indices  Number of indices.
     *
     *  \return 0 on success, or -1 if the operation is not supported
     */
    extern DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer,
                                                   SDL_Texture *texture,
                                                   SDL_Vertex *vertices, int num_vertices,
                                                   int *indices, int num_indices);
    

    Description

    Back-end added: Software, Opengl, OpenGLES2, D3D11, METAL, D3D9, OpengGLES Metal and OpenGLES2 are modified more internally so that 'color' isn't uniform anymore but an attribute. Software Renderer tries also to reconstruct SDL_Rect from Vertex, and to use faster SDL_RenderCopy when possible.

    I've checked that it integrates correctly with DearImGui. (see example files here: https://github.com/ocornut/imgui/pull/3926 ) And also with Spine (using spine-c runtime) With Nuklear ( https://github.com/Immediate-Mode-UI/Nuklear/pull/280 ) With Librocket (https://github.com/libRocket/libRocket/pull/301 ) With Microui ( https://github.com/rxi/microui/pull/48 )

    Some parts are used from the various patches

    Existing Issue(s)

    Referencing #772 : SDL_RenderGeometry #692 : Implement polygon rendering

    opened by 1bsyl 41
  • Using egl in sdl in android leads to crash

    Using egl in sdl in android leads to crash

    I want to create egl context using my sdl android app. I know I can create the built in SDL_GL_createcontext but it doesn't work in my case. It only shows black screen on my attempt to embed mpv on android using SDL. That's why I thought of using EGL. Down below is my code. However the sdl asserts the following. Am I missing something here? The code below works fine in SDL windows application using angle jwith just simple difference. I am using the stable version of SDL. image

    #include <stdlib.h>
    #include <stdio.h>
    
    #include "SDL.h"
    #include "SDL_syswm.h"
    
    #include <EGL/egl.h>
    #include <GLES2/gl2.h>
    
    using namespace std;
    
    
    int main(int argc, char* argv[])
    {
        SDL_Window* window = 0;
        
        if (0 != SDL_Init(SDL_INIT_VIDEO))
        {
            fprintf(stderr, "\nUnable to initialize SDL: %s\n", SDL_GetError());
            return 1;
        }
        window = SDL_CreateWindow("Glad Sample",
            SDL_WINDOWPOS_CENTERED,
            SDL_WINDOWPOS_CENTERED,
            800, 600, SDL_WINDOW_SHOWN |
            SDL_WINDOW_OPENGL);
    
      EGLint configAttribList[] =
        {
            EGL_RED_SIZE,       8,
            EGL_GREEN_SIZE,     8,
            EGL_BLUE_SIZE,      8,
            EGL_ALPHA_SIZE,     8 /*: EGL_DONT_CARE*/,
            EGL_DEPTH_SIZE,     EGL_DONT_CARE,
            EGL_STENCIL_SIZE,   EGL_DONT_CARE,
            EGL_SAMPLE_BUFFERS, 0,
            EGL_NONE
        };
    
        EGLint surfaceAttribList[] =
        {
            // EGL_CONTEXT_CLIENT_VERSION, 2,
             EGL_WIDTH, 800,
             EGL_HEIGHT, 600,
             EGL_NONE
    
        };
        EGLint attribListPbuffer[] = {
        EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
        EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
        EGL_BUFFER_SIZE, 32,
        EGL_DEPTH_SIZE, 24,
        EGL_STENCIL_SIZE, 8,
        EGL_NONE
        };
    
        EGLint numConfigs;
        EGLint majorVersion;
        EGLint minorVersion;
        EGLDisplay display;
        EGLContext context;
        EGLSurface surface;
        EGLConfig config;
        EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE, EGL_NONE };
    
        SDL_SysWMinfo info;
        SDL_VERSION(&info.version); // initialize info structure with SDL version info
        SDL_GetWindowWMInfo(window, &info);   
        SDL_bool get_win_info = SDL_GetWindowWMInfo(window, &info);
        SDL_assert_release(get_win_info);
        EGLNativeWindowType hWnd = info.info.android.window;
    
        // Get Display 
        display = eglGetDisplay(EGL_DEFAULT_DISPLAY); // EGL_DEFAULT_DISPLAY 
        if (display == EGL_NO_DISPLAY)
        {
            return EGL_FALSE;
        }
    
        // Initialize EGL 
        if (!eglInitialize(display, &majorVersion, &minorVersion))
        {
            return EGL_FALSE;
        }
    
        // Get configs 
        if (!eglGetConfigs(display, NULL, 0, &numConfigs))
        {
            return EGL_FALSE;
        }
    
        // Choose config 
        if (!eglChooseConfig(display, configAttribList, &config, 1, &numConfigs))
        {
            return EGL_FALSE;
        }
    
        // Create a 
        surface = eglCreateWindowSurface(display, config,hWnd, surfaceAttribList);
        if (surface == EGL_NO_SURFACE)
        {
            return EGL_FALSE;
        }
        context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs);
        if (context == EGL_NO_CONTEXT)
        {
            return EGL_FALSE;
        }
    
        // Make the context current 
        if (!eglMakeCurrent(display, surface, surface, context))
        {
            return EGL_FALSE;
        }
        
        SDL_Event event;
    
        bool running = true;
        while (running)
        {
            SDL_PollEvent(&event);
            switch (event.type) {
            case SDL_QUIT:
                running = false;
                break;
            case SDL_WINDOWEVENT:
                if (event.window.event == SDL_WINDOWEVENT_EXPOSED)
                  //  redraw = 1;
                break;
            }
           
            glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
            glClear(GL_COLOR_BUFFER_BIT);
            eglSwapBuffers(display, surface);
    
        }
        SDL_DestroyWindow(window);
        SDL_Quit();
    
        exit(0);
    }
    
    opened by ZhenFTW 40
  • Easy way to get a cache patch on Android

    Easy way to get a cache patch on Android

    Hello. SDL have SDL_AndroidGetInternalStoragePath and SDL_AndroidGetExternalStoragePath functions for accessing the device memory on Android. My application writes a lot of temporary files and I prefer to use getCacheDir according to the documentation. But SDL2 doesn't seem to have any simple function for this. So I have to use JNI to get it. Is there any reason for this?

    opened by MoNTE48 1
  • Add Drag and drop position, for x11 and wayland

    Add Drag and drop position, for x11 and wayland

    Some start to send event of position while doing a drag n drop: (see https://github.com/libsdl-org/SDL/issues/5292 )

    x11:

    • doesn't report the filename. (is it possible?)

    wayland:

    • doesn't report the window (original flaw for all drag and drop)
    opened by 1bsyl 0
  • I only want to use kms/drm as the video driver. What compilation parameters should I use?

    I only want to use kms/drm as the video driver. What compilation parameters should I use?

    I'm on an arm machine to work, Here's how I compiled it:

    cmake -S /home/linaro/mnt/sdl_dev/SDL -DSDL_STATIC=OFF -DSDL_LIBC=ON -DSDL_DUMMYVIDEO=ON -DSDL_DIRECTX=OFF -DSDL_X11=OFF -DSDL_WAYLAND=OFF -DSDL_OPENGLES=OFF -DSDL_OPENGL=OFF -DSDL_VULKAN=OFF -DSDL_KMSDRM_SHARED=ON -DSDL_DIRECTFB=ON -DSDL_TEST=ON -DSDL_TESTS=ON && make -j8 && sudo make install

    But the results don't seem very normal:

    linaro@linaro-alip:~/mnt/sdl_dev/sdl_build/test$ ./testyuv INFO: 100 iterations in 274 ms, 2.74ms each DEBUG: No available video device ERROR: Couldn't create window: No available video device

    I don't want to use gles or anything, just drm to display, how do I compile?

    opened by zack-huangzihan 0
  • SDL_Init with SDL_INIT_JOYSTICK hangs for ~15 seconds when with Razer Blackwidow keyboard connected (maybe related to #3567)

    SDL_Init with SDL_INIT_JOYSTICK hangs for ~15 seconds when with Razer Blackwidow keyboard connected (maybe related to #3567)

    Hi, I am running Fedora 37 and using SDL 2.26.0 from the Fedora repo's and after some testing found the offending USB device is my Razer Blackwidow V3

    ID 1532:024e Razer USA, Ltd Razer BlackWidow V3

    The problem is observed when calling SDL_Init with SDL_INIT_JOYSTICK where it hangs for about 15 seconds. Unplugging the device and running resolves. I found a similar issue from 2021 (#3567) if that helps.

    opened by BurkeyCode 0
  • [Feature Request] RWop saves filename field

    [Feature Request] RWop saves filename field

    I was wondering if there was any appetite for adding a file name (+ extension) field to the File RWop.

    I think it could be useful to get a RWop struct (from wherever) and be able to get a file name or extension out of it.

    Anecdote 1 Inside of pygame, we implemented a system to do this, because the RWops get created deep in one place (with lots of Python string decoding mumbo jumbo), and then used in a fully different place, which needs the file extension (for music type or image type, for example).

    I implemented this system by using one of the hidden data pointers and mallocing some room for the extension, but I couldn't figure out a way to give a "standard RWop" -- a file RWop -- a custom deletion function to clean up that memory. So we now have a different strategy to get around storing the memory in the RWop directly.

    Anecdote 2 https://wiki.libsdl.org/SDL_mixer/Mix_GetMusicTitle

    Please note that if the music was loaded from an SDL_RWops instead of a filename, the filename returned will be an empty string ("").

    Having this field could allow SDL_mixer to get rid of this caveat in their API

    opened by Starbuck5 2
Releases(release-2.26.1)
  • release-2.26.1(Dec 1, 2022)

    This is a stable bugfix release, with the following changes:

    • Improved audio resampling quality
    • Fixed crash if SDL_GetPointDisplayIndex() or SDL_GetRectDisplayIndex() are called before SDL_VideoInit()
    • Fixed building with older Xcode and macOS SDK
    • Fixed building when not using shared Wayland libraries
    Source code(tar.gz)
    Source code(zip)
    SDL2-2.26.1-win32-x64.zip(802.66 KB)
    SDL2-2.26.1-win32-x86.zip(706.75 KB)
    SDL2-2.26.1.dmg(1.98 MB)
    SDL2-2.26.1.tar.gz(7.70 MB)
    SDL2-2.26.1.tar.gz.sig(95 bytes)
    SDL2-2.26.1.zip(8.99 MB)
    SDL2-2.26.1.zip.sig(95 bytes)
    SDL2-devel-2.26.1-mingw.tar.gz(14.87 MB)
    SDL2-devel-2.26.1-mingw.zip(14.99 MB)
    SDL2-devel-2.26.1-VC.zip(2.58 MB)
  • release-2.26.0(Nov 22, 2022)

    In addition to lots of bug fixes, here are the major changes in this release:

    General:

    • Updated OpenGL headers to the latest API from The Khronos Group Inc.
    • Added SDL_GetWindowSizeInPixels() to get the window size in pixels, which may differ from the window coordinate size for windows with high-DPI support
    • Added simulated vsync synchronization for the software renderer
    • Added the mouse position to SDL_MouseWheelEvent
    • Added SDL_ResetHints() to reset all hints to their default values
    • Added SDL_GetJoystickGUIDInfo() to get device information encoded in a joystick GUID
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 to control whether the HIDAPI driver for XBox 360 controllers should be used
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED to control whether the player LEDs should be lit to indicate which player is associated with an Xbox 360 controller
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS to control whether the HIDAPI driver for XBox 360 wireless controllers should be used
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE to control whether the HIDAPI driver for XBox One controllers should be used
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED to control the brightness of the XBox One guide button LED
    • Added support for PS3 controllers to the HIDAPI driver, enabled by default on macOS, controlled by the SDL_HINT_JOYSTICK_HIDAPI_PS3 hint
    • Added support for Nintendo Wii controllers to the HIDAPI driver, not enabled by default, controlled by the SDL_HINT_JOYSTICK_HIDAPI_WII hint
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED to control whether the player LED should be lit on the Nintendo Wii controllers
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS to control whether Nintendo Switch Joy-Con controllers will be in vertical mode when using the HIDAPI driver
    • Added access to the individual left and right gyro sensors of the combined Joy-Cons controller
    • Added a microsecond timestamp to SDL_SensorEvent and SDL_ControllerSensorEvent, when the hardware provides that information
    • Added SDL_SensorGetDataWithTimestamp() and SDL_GameControllerGetSensorDataWithTimestamp() to retrieve the last sensor data with the associated microsecond timestamp
    • Added the hint SDL_HINT_HIDAPI_IGNORE_DEVICES to have the SDL HID API ignore specific devices
    • SDL_GetRevision() now includes more information about the SDL build, including the git commit hash if available

    Windows:

    • Added the hint SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE to control whether the system mouse acceleration curve is used for relative mouse motion

    macOS:

    • Implemented vsync synchronization on macOS 12

    Linux:

    • Added SDL_SetPrimarySelectionText(), SDL_GetPrimarySelectionText(), and SDL_HasPrimarySelectionText() to interact with the X11 primary selection clipboard
    • Added the hint SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP to control whether mouse pointer warp emulation is enabled under Wayland

    Android:

    • Enabled IME soft keyboard input
    • Added version checking to make sure the SDL Java and C code are compatible
    Source code(tar.gz)
    Source code(zip)
    SDL2-2.26.0-win32-x64.zip(802.70 KB)
    SDL2-2.26.0-win32-x86.zip(706.76 KB)
    SDL2-2.26.0.dmg(1.98 MB)
    SDL2-2.26.0.tar.gz(7.71 MB)
    SDL2-2.26.0.tar.gz.sig(95 bytes)
    SDL2-2.26.0.zip(8.99 MB)
    SDL2-2.26.0.zip.sig(95 bytes)
    SDL2-devel-2.26.0-mingw.tar.gz(14.87 MB)
    SDL2-devel-2.26.0-mingw.zip(14.99 MB)
    SDL2-devel-2.26.0-VC.zip(2.58 MB)
  • prerelease-2.25.1(Nov 17, 2022)

    This is a release candidate for 2.26

    In addition to lots of bug fixes, here are the major changes in this release:

    General:

    • Updated OpenGL headers to the latest API from The Khronos Group Inc.
    • Added SDL_GetWindowSizeInPixels() to get the window size in pixels, which may differ from the window coordinate size for windows with high-DPI support
    • Added simulated vsync synchronization for the software renderer
    • Added the mouse position to SDL_MouseWheelEvent
    • Added SDL_ResetHints() to reset all hints to their default values
    • Added SDL_GetJoystickGUIDInfo() to get device information encoded in a joystick GUID
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 to control whether the HIDAPI driver for XBox 360 controllers should be used
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED to control whether the player LEDs should be lit to indicate which player is associated with an Xbox 360 controller
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS to control whether the HIDAPI driver for XBox 360 wireless controllers should be used
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE to control whether the HIDAPI driver for XBox One controllers should be used
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED to control the brightness of the XBox One guide button LED
    • Added support for PS3 controllers to the HIDAPI driver, enabled by default on macOS, controlled by the SDL_HINT_JOYSTICK_HIDAPI_PS3 hint
    • Added support for Nintendo Wii controllers to the HIDAPI driver, not enabled by default, controlled by the SDL_HINT_JOYSTICK_HIDAPI_WII hint
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED to control whether the player LED should be lit on the Nintendo Wii controllers
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS to control whether Nintendo Switch Joy-Con controllers will be in vertical mode when using the HIDAPI driver
    • Added access to the individual left and right gyro sensors of the combined Joy-Cons controller
    • Added a microsecond timestamp to SDL_SensorEvent and SDL_ControllerSensorEvent, when the hardware provides that information
    • Added SDL_SensorGetDataWithTimestamp() and SDL_GameControllerGetSensorDataWithTimestamp() to retrieve the last sensor data with the associated microsecond timestamp
    • Added the hint SDL_HINT_HIDAPI_IGNORE_DEVICES to have the SDL HID API ignore specific devices
    • SDL_GetRevision() now includes more information about the SDL build, including the git commit hash if available

    Windows:

    • Added the hint SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE to control whether the system mouse acceleration curve is used for relative mouse motion

    macOS:

    • Implemented vsync synchronization on macOS 12

    Linux:

    • Added SDL_SetPrimarySelectionText(), SDL_GetPrimarySelectionText(), and SDL_HasPrimarySelectionText() to interact with the X11 primary selection clipboard
    • Added the hint SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP to control whether mouse pointer warp emulation is enabled under Wayland

    Android:

    • Enabled IME soft keyboard input
    • Added version checking to make sure the SDL Java and C code are compatible
    Source code(tar.gz)
    Source code(zip)
    SDL2-2.25.1-win32-x64.zip(803.07 KB)
    SDL2-2.25.1-win32-x86.zip(707.19 KB)
    SDL2-2.25.1.dmg(1.98 MB)
    SDL2-2.25.1.tar.gz(7.70 MB)
    SDL2-2.25.1.zip(8.99 MB)
    SDL2-devel-2.25.1-mingw.tar.gz(14.87 MB)
    SDL2-devel-2.25.1-mingw.zip(15.00 MB)
    SDL2-devel-2.25.1-VC.zip(2.58 MB)
  • release-2.24.2(Nov 1, 2022)

    This is a stable bugfix release, with the following changes:

    Windows

    • Only check to see if the ICC profile changes when the display changes or we gain focus
    • Fixed window resize handing when using the D3D12 renderer
    • Fixed Xbox controller detection on Windows XP

    macOS

    • Fixed long delay in SDL_CloseAudioDevice()

    Linux

    • Fixed crash in Wayland_HasScreenKeyboardSupport()

    FreeBSD

    • Fixed building without GNU sort, but warn that dynamic libraries won't be found

    Emscripten

    • Fixed infinite recursion related to mutexes on startup

    OS/2

    • Fixes and improvements to SDL_LoadObject() functionality
    Source code(tar.gz)
    Source code(zip)
    SDL2-2.24.2-win32-x64.zip(777.79 KB)
    SDL2-2.24.2-win32-x86.zip(681.70 KB)
    SDL2-2.24.2.dmg(1.89 MB)
    SDL2-2.24.2.tar.gz(7.17 MB)
    SDL2-2.24.2.tar.gz.sig(95 bytes)
    SDL2-2.24.2.zip(8.41 MB)
    SDL2-2.24.2.zip.sig(95 bytes)
    SDL2-devel-2.24.2-mingw.tar.gz(14.21 MB)
    SDL2-devel-2.24.2-mingw.zip(14.34 MB)
    SDL2-devel-2.24.2-VC.zip(2.48 MB)
  • release-2.24.1(Oct 5, 2022)

    This is a stable bugfix release, with the following changes:

    General

    • Fixed shader compilation issues using the OpenGL ES2 renderer
    • Fixed configure tests failing when using clang 15

    Windows

    • Fixed running on Windows XP
    • Fixed invalid executables being created with mingw based compilers

    macOS

    • Fixed new windows setting the SDL_WINDOW_BORDERLESS flag incorrectly
    • Fixed audio race condition on shutdown
    • Fixed crash if there are no input devices available

    FreeBSD

    • Building requires GNU sort, which is now checked at configure time
    • Fixed building with libusb not dynamically loaded, enabling HIDAPI support
    Source code(tar.gz)
    Source code(zip)
    SDL2-2.24.1-win32-x64.zip(777.62 KB)
    SDL2-2.24.1-win32-x86.zip(681.63 KB)
    SDL2-2.24.1.dmg(1.89 MB)
    SDL2-2.24.1.tar.gz(7.17 MB)
    SDL2-2.24.1.tar.gz.sig(95 bytes)
    SDL2-2.24.1.zip(8.41 MB)
    SDL2-2.24.1.zip.sig(95 bytes)
    SDL2-devel-2.24.1-mingw.tar.gz(14.20 MB)
    SDL2-devel-2.24.1-mingw.zip(14.33 MB)
    SDL2-devel-2.24.1-VC.zip(2.48 MB)
  • release-2.24.0(Aug 19, 2022)

    In addition to lots of bug fixes, here are the major changes in this release:

    General:

    • New version numbering scheme, similar to GLib and Flatpak.
      • An even number in the minor version (second component) indicates a production-ready stable release such as 2.24.0, which would have been 2.0.24 under the old system.
        • The patchlevel (micro version, third component) indicates a bugfix-only update: for example, 2.24.1 would be a bugfix-only release to fix bugs in 2.24.0, without adding new features.
      • An odd number in the minor version indicates a prerelease such as 2.23.0. Stable distributions should not use these prereleases.
        • The patchlevel indicates successive prereleases, for example 2.23.1 and 2.23.2 would be prereleases during development of the SDL 2.24.0 stable release.
    • Added SDL_GetPointDisplayIndex() and SDL_GetRectDisplayIndex() to get the display associated with a point and rectangle in screen space
    • Added SDL_bsearch(), SDL_crc16(), and SDL_utf8strnlen() to the stdlib routines
    • Added SDL_CPUPauseInstruction() as a macro in SDL_atomic.h
    • Added SDL_size_mul_overflow() and SDL_size_add_overflow() for better size overflow protection
    • Added SDL_ResetHint() to reset a hint to the default value
    • Added SDL_ResetKeyboard() to reset SDL's internal keyboard state, generating key up events for all currently pressed keys
    • Added the hint SDL_HINT_MOUSE_RELATIVE_WARP_MOTION to control whether mouse warping generates motion events in relative mode. This hint defaults off.
    • Added the hint SDL_HINT_TRACKPAD_IS_TOUCH_ONLY to control whether trackpads are treated as touch devices or mice. By default touchpads are treated as mouse input.
    • The hint SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS now defaults on
    • Added support for mini-gamepad mode for Nintendo Joy-Con controllers using the HIDAPI driver
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS to control whether Joy-Con controllers are automatically merged into a unified gamepad when using the HIDAPI driver. This hint defaults on.
    • The hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED can be set to a floating point value to set the brightness of the Home LED on Nintendo Switch controllers
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED to set the Home LED brightness for the Nintendo Joy-Con controllers. By default the Home LED is not modified.
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED to control whether the player LED should be lit on the Nintendo Joy-Con controllers
    • Added support for Nintendo Online classic controllers using the HIDAPI driver
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC to control whether the HIDAPI driver for Nintendo Online classic controllers should be used
    • Added support for the NVIDIA Shield Controller to the HIDAPI driver, supporting rumble and battery status
    • Added support for NVIDIA SHIELD controller to the HIDAPI driver, and a hint SDL_HINT_JOYSTICK_HIDAPI_SHIELD to control whether this is used
    • Added functions to get the platform dependent name for a joystick or game controller:
      • SDL_JoystickPathForIndex()
      • SDL_JoystickPath()
      • SDL_GameControllerPathForIndex()
      • SDL_GameControllerPath()
    • Added SDL_GameControllerGetFirmwareVersion() and SDL_JoystickGetFirmwareVersion(), currently implemented for DualSense(tm) Wireless Controllers using HIDAPI
    • Added SDL_JoystickAttachVirtualEx() for extended virtual controller support
    • Added joystick event SDL_JOYBATTERYUPDATED for when battery status changes
    • Added SDL_GUIDToString() and SDL_GUIDFromString() to convert between SDL GUID and string
    • Added SDL_HasLSX() and SDL_HasLASX() to detect LoongArch SIMD support
    • Added SDL_GetOriginalMemoryFunctions()
    • Added SDL_GetDefaultAudioInfo() to get the name and format of the default audio device, currently implemented for PipeWire, PulseAudio, WASAPI, and DirectSound
    • Added HIDAPI driver for the NVIDIA SHIELD controller (2017 model) to enable support for battery status and rumble
    • Added support for opening audio devices with 3 or 5 channels (2.1, 4.1). All channel counts from Mono to 7.1 are now supported.
    • Rewrote audio channel converters used by SDL_AudioCVT, based on the channel matrix coefficients used as the default for FAudio voices
    • SDL log messages are no longer limited to 4K and can be any length
    • Fixed a long-standing calling convention issue with dynapi affecting OpenWatcom or OS/2 builds

    Windows:

    • Added initial support for building for Windows and Xbox with Microsoft's Game Development Kit (GDK), see docs/README-gdk.md for details
    • Added a D3D12 renderer implementation and SDL_RenderGetD3D12Device() to retrieve the D3D12 device associated with it
    • Added the hint SDL_HINT_WINDOWS_DPI_AWARENESS to set whether the application is DPI-aware. This hint must be set before initializing the video subsystem
    • Added the hint SDL_HINT_WINDOWS_DPI_SCALING to control whether the SDL coordinates are in DPI-scaled points or pixels
    • Added the hint SDL_HINT_DIRECTINPUT_ENABLED to control whether the DirectInput driver should be used
    • Added support for SDL_GetAudioDeviceSpec to the DirectSound backend

    Linux:

    • Support for XVidMode has been removed, mode changes are only supported using the XRandR extension
    • Added the hint SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION to control whether to expose a set of emulated modes in addition to the native resolution modes available on Wayland
    • Added the hint SDL_HINT_KMSDRM_DEVICE_INDEX to specify which KMSDRM device to use if the default is not desired
    • Added the hint SDL_HINT_LINUX_DIGITAL_HATS to control whether to treat hats as digital rather than checking to see if they may be analog
    • Added the hint SDL_HINT_LINUX_HAT_DEADZONES to control whether to use deadzones on analog hats

    macOS:

    • Bumped minimum OS deployment version to macOS 10.9
    • Added SDL_GL_FLOATBUFFERS to allow Cocoa GL contexts to use EDR
    • Added the hint SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH to control whether dispatching OpenGL context updates should block the dispatching thread until the main thread finishes processing. This hint defaults to blocking, which is the safer option on modern macOS.
    Source code(tar.gz)
    Source code(zip)
    SDL2-2.24.0-win32-x64.zip(776.93 KB)
    SDL2-2.24.0-win32-x86.zip(680.88 KB)
    SDL2-2.24.0.dmg(1.88 MB)
    SDL2-2.24.0.tar.gz(7.17 MB)
    SDL2-2.24.0.tar.gz.sig(95 bytes)
    SDL2-2.24.0.zip(8.41 MB)
    SDL2-2.24.0.zip.sig(95 bytes)
    SDL2-devel-2.24.0-mingw.tar.gz(14.14 MB)
    SDL2-devel-2.24.0-mingw.zip(14.28 MB)
    SDL2-devel-2.24.0-VC.zip(2.48 MB)
  • release-2.0.22(Apr 25, 2022)

    In addition to lots of bug fixes, here are the major changes in this release:

    General:

    • Added SDL_RenderGetWindow() to get the window associated with a renderer
    • Added floating point rectangle functions:
      • SDL_PointInFRect()
      • SDL_FRectEmpty()
      • SDL_FRectEquals()
      • SDL_FRectEqualsEpsilon()
      • SDL_HasIntersectionF()
      • SDL_IntersectFRect()
      • SDL_UnionFRect()
      • SDL_EncloseFPoints()
      • SDL_IntersectFRectAndLine()
    • Added SDL_IsTextInputShown() which returns whether the IME window is currently shown
    • Added SDL_ClearComposition() to dismiss the composition window without disabling IME input
    • Added SDL_TEXTEDITING_EXT event for handling long composition text, and a hint SDL_HINT_IME_SUPPORT_EXTENDED_TEXT to enable it
    • Added the hint SDL_HINT_MOUSE_RELATIVE_MODE_CENTER to control whether the mouse should be constrained to the whole window or the center of the window when relative mode is enabled
    • The mouse is now automatically captured when mouse buttons are pressed, and the hint SDL_HINT_MOUSE_AUTO_CAPTURE allows you to control this behavior
    • Added the hint SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL to let SDL know that a foreign window will be used with OpenGL
    • Added the hint SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN to let SDL know that a foreign window will be used with Vulkan
    • Added the hint SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE to specify whether an SDL_QUIT event will be delivered when the last application window is closed
    • Added the hint SDL_HINT_JOYSTICK_ROG_CHAKRAM to control whether ROG Chakram mice show up as joysticks

    Windows:

    • Added support for SDL_BLENDOPERATION_MINIMUM and SDL_BLENDOPERATION_MAXIMUM to the D3D9 renderer

    Linux:

    • Compiling with Wayland support requires libwayland-client version 1.18.0 or later
    • Added the hint SDL_HINT_X11_WINDOW_TYPE to specify the _NET_WM_WINDOW_TYPE of SDL windows
    • Added the hint SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR to allow using libdecor with compositors that support xdg-decoration

    Android:

    • Added SDL_AndroidSendMessage() to send a custom command to the SDL java activity
    Source code(tar.gz)
    Source code(zip)
    SDL2-2.0.22-win32-x64.zip(699.02 KB)
    SDL2-2.0.22-win32-x86.zip(608.79 KB)
    SDL2-2.0.22.dmg(1.78 MB)
    SDL2-2.0.22.tar.gz(6.91 MB)
    SDL2-2.0.22.tar.gz.sig(95 bytes)
    SDL2-2.0.22.zip(8.09 MB)
    SDL2-2.0.22.zip.sig(95 bytes)
    SDL2-devel-2.0.22-mingw.tar.gz(13.52 MB)
    SDL2-devel-2.0.22-mingw.zip(13.65 MB)
    SDL2-devel-2.0.22-VC.zip(2.29 MB)
  • release-2.0.20(Jan 11, 2022)

    This is largely a bugfix release, with the following changes:

    General:

    • SDL_RenderGeometryRaw() takes a pointer to SDL_Color, not int. You can cast color data in SDL_PIXELFORMAT_RGBA32 format (SDL_PIXELFORMAT_ABGR8888 on little endian systems) for this parameter.
    • Improved accuracy of horizontal and vertical line drawing when using OpenGL or OpenGLES
    • Added the hint SDL_HINT_RENDER_LINE_METHOD to control the method of line drawing used, to select speed, correctness, and compatibility.

    Windows:

    • Fixed size of custom cursors

    Linux:

    • Fixed hotplug controller detection, broken in 2.0.18
    Source code(tar.gz)
    Source code(zip)
    SDL2-2.0.20-win32-x64.zip(689.69 KB)
    SDL2-2.0.20-win32-x86.zip(601.78 KB)
    SDL2-2.0.20.dmg(1.73 MB)
    SDL2-2.0.20.tar.gz(6.87 MB)
    SDL2-2.0.20.tar.gz.sig(95 bytes)
    SDL2-2.0.20.zip(8.04 MB)
    SDL2-2.0.20.zip.sig(95 bytes)
    SDL2-devel-2.0.20-mingw.tar.gz(13.40 MB)
    SDL2-devel-2.0.20-VC.zip(2.27 MB)
  • release-2.0.18(Nov 30, 2021)

    In addition to lots of bug fixes, here are the major changes in this release:

    General:

    • The SDL wiki documentation and development headers are automatically kept in sync
    • Each function has information about in which version of SDL it was introduced
    • SDL-specific CMake options are now prefixed with 'SDL_'. Be sure to update your CMake build scripts accordingly!
    • Added the hint SDL_HINT_APP_NAME to let SDL know the name of your application for various places it might show up in system information
    • Added SDL_RenderGeometry() and SDL_RenderGeometryRaw() to allow rendering of arbitrary shapes using the SDL 2D render API
    • Added SDL_SetTextureUserData() and SDL_GetTextureUserData() to associate application data with an SDL texture
    • Added SDL_RenderWindowToLogical() and SDL_RenderLogicalToWindow() to convert between window coordinates and logical render coordinates
    • Added SDL_RenderSetVSync() to change whether a renderer present is synchronized with vblank at runtime
    • Added SDL_PremultiplyAlpha() to premultiply alpha on a block of SDL_PIXELFORMAT_ARGB8888 pixels
    • Added a window event SDL_WINDOWEVENT_DISPLAY_CHANGED which is sent when a window changes what display it's centered on
    • Added SDL_GetWindowICCProfile() to query a window's ICC profile, and a window event SDL_WINDOWEVENT_ICCPROF_CHANGED that is sent when it changes
    • Added the hint SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY to allow EGL windows to be transparent instead of opaque
    • SDL_WaitEvent() has been redesigned to use less CPU in most cases
    • Added SDL_SetWindowMouseRect() and SDL_GetWindowMouseRect() to confine the mouse cursor to an area of a window
    • You can now read precise mouse wheel motion using 'preciseX' and 'preciseY' event fields
    • Added SDL_GameControllerHasRumble() and SDL_GameControllerHasRumbleTriggers() to query whether a game controller supports rumble
    • Added SDL_JoystickHasRumble() and SDL_JoystickHasRumbleTriggers() to query whether a joystick supports rumble
    • SDL's hidapi implementation is now available as a public API in SDL_hidapi.h

    Windows:

    • Improved relative mouse motion over Windows Remote Desktop
    • Added the hint SDL_HINT_IME_SHOW_UI to show native UI components instead of hiding them (defaults off)

    Windows/UWP:

    • WGI is used instead of XInput for better controller support in UWP apps

    Linux:

    • Added the hint SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME to set the activity that's displayed by the system when the screensaver is disabled
    • Added the hint SDL_HINT_LINUX_JOYSTICK_CLASSIC to control whether /dev/input/js* or /dev/input/event* are used as joystick devices
    • Added the hint SDL_HINT_JOYSTICK_DEVICE to allow the user to specify devices that will be opened in addition to the normal joystick detection
    • Added SDL_LinuxSetThreadPriorityAndPolicy() for more control over a thread priority on Linux

    Android:

    • Added support for audio output and capture using AAudio on Android 8.1 and newer
    • Steam Controller support is disabled by default, and can be enabled by setting the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM to "1" before calling SDL_Init()

    Apple Arcade:

    • Added SDL_GameControllerGetAppleSFSymbolsNameForButton() and SDL_GameControllerGetAppleSFSymbolsNameForAxis() to support Apple Arcade titles

    iOS:

    • Added documentation that the UIApplicationSupportsIndirectInputEvents key must be set to true in your application's Info.plist in order to get real Bluetooth mouse events.
    • Steam Controller support is disabled by default, and can be enabled by setting the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM to "1" before calling SDL_Init()
    Source code(tar.gz)
    Source code(zip)
    SDL2-2.0.18-win32-x64.zip(685.27 KB)
    SDL2-2.0.18-win32-x86.zip(599.62 KB)
    SDL2-2.0.18.dmg(1.73 MB)
    SDL2-devel-2.0.18-mingw.tar.gz(13.38 MB)
    SDL2-devel-2.0.18-VC.zip(2.27 MB)
  • release-2.0.16(Aug 10, 2021)

    In addition to lots of bug fixes, here are the major changes in this release:

    General:

    • Added SDL_FlashWindow() to get a user's attention
    • Added SDL_GetAudioDeviceSpec() to get the preferred audio format of a device
    • Added SDL_SetWindowAlwaysOnTop() to dynamically change the SDL_WINDOW_ALWAYS_ON_TOP flag for a window
    • Added SDL_SetWindowKeyboardGrab() to support grabbing the keyboard independently of the mouse
    • Added SDL_SoftStretchLinear() to do bilinear scaling between 32-bit software surfaces
    • Added SDL_UpdateNVTexture() to update streaming NV12/21 textures
    • Added SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow sending custom trigger effects to the DualSense controller
    • Added SDL_GameControllerGetSensorDataRate() to get the sensor data rate for PlayStation and Nintendo Switch controllers
    • Added support for the Amazon Luna game controller
    • Added rumble support for the Google Stadia controller using the HIDAPI driver
    • Added SDL_GameControllerType constants for the Amazon Luna and Google Stadia controllers
    • Added analog rumble for Nintendo Switch Pro controllers using the HIDAPI driver
    • Reduced CPU usage when using SDL_WaitEvent() and SDL_WaitEventTimeout()

    Windows:

    • Added SDL_SetWindowsMessageHook() to set a function that is called for all Windows messages
    • Added SDL_RenderGetD3D11Device() to get the D3D11 device used by the SDL renderer

    Linux:

    • Greatly improved Wayland support
    • Added support for audio output and capture using Pipewire
    • Added the hint SDL_HINT_AUDIO_INCLUDE_MONITORS to control whether PulseAudio recording should include monitor devices
    • Added the hint SDL_HINT_AUDIO_DEVICE_STREAM_ROLE to describe the role of your application for audio control panels

    Android:

    • Added support for audio output and capture using AAudio
    • Added SDL_AndroidShowToast() to show a lightweight notification

    iOS:

    • Added support for mouse relative mode on iOS 14.1 and newer
    • Added support for the Xbox Series X controller

    tvOS:

    • Added support for the Xbox Series X controller
    Source code(tar.gz)
    Source code(zip)
  • release-2.0.14(Jul 8, 2021)

    In addition to lots of bug fixes, here are the major changes in this release:

    General:

    • Added support for PS5 DualSense and Xbox Series X controllers to the HIDAPI controller driver
    • Added game controller button constants for paddles and new buttons
    • Added game controller functions to get additional information:
    • SDL_GameControllerGetSerial()
    • SDL_GameControllerHasAxis()
    • SDL_GameControllerHasButton()
    • SDL_GameControllerGetNumTouchpads()
    • SDL_GameControllerGetNumTouchpadFingers()
    • SDL_GameControllerGetTouchpadFinger()
    • SDL_GameControllerHasSensor()
    • SDL_GameControllerSetSensorEnabled()
    • SDL_GameControllerIsSensorEnabled()
    • SDL_GameControllerGetSensorData()
    • SDL_GameControllerRumbleTriggers()
    • SDL_GameControllerHasLED()
    • SDL_GameControllerSetLED()
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_PS5 to control whether the HIDAPI driver for PS5 controllers should be used.
    • Added joystick functions to get additional information:
    • SDL_JoystickGetSerial()
    • SDL_JoystickRumbleTriggers()
    • SDL_JoystickHasLED()
    • SDL_JoystickSetLED()
    • Added an API to allow the application to create virtual joysticks:
    • SDL_JoystickAttachVirtual()
    • SDL_JoystickDetachVirtual()
    • SDL_JoystickIsVirtual()
    • SDL_JoystickSetVirtualAxis()
    • SDL_JoystickSetVirtualButton()
    • SDL_JoystickSetVirtualHat()
    • Added SDL_LockSensors() and SDL_UnlockSensors() to guarantee exclusive access to the sensor list
    • Added SDL_HAPTIC_STEERING_AXIS to play an effect on the steering wheel
    • Added the hint SDL_HINT_MOUSE_RELATIVE_SCALING to control whether relative motion is scaled by the screen DPI or renderer logical size
    • The default value for SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS is now false for better compatibility with modern window managers
    • Added SDL_GetPreferredLocales() to get the application's current locale setting
    • Added the hint SDL_HINT_PREFERRED_LOCALES to override your application's default locale setting
    • Added SDL_OpenURL() to open a URL in the system's default browser
    • Added SDL_HasSurfaceRLE() to tell whether a surface is currently using RLE encoding
    • Added SDL_SIMDRealloc() to reallocate memory obtained from SDL_SIMDAlloc()
    • Added SDL_GetErrorMsg() to get the last error in a thread-safe way
    • Added SDL_crc32(), SDL_wcscasecmp(), SDL_wcsncasecmp(), SDL_trunc(), SDL_truncf()
    • Added clearer names for RGB pixel formats, e.g. SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, etc.

    Windows:

    • Added the RAWINPUT controller driver to support more than 4 Xbox controllers simultaneously
    • Added the hint SDL_HINT_JOYSTICK_RAWINPUT to control whether the RAWINPUT driver should be used
    • Added the hint SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT to control whether XInput and WGI should be used to for complete controller functionality with the RAWINPUT driver.

    macOS:

    • Added the SDL_WINDOW_METAL flag to specify that a window should be created with a Metal view
    • Added SDL_Metal_GetLayer() to get the CAMetalLayer backing a Metal view
    • Added SDL_Metal_GetDrawableSize() to get the size of a window's drawable, in pixels

    Linux:

    • Added Vulkan support to the KMSDRM video driver
    • Added the hint SDL_HINT_AUDIO_DEVICE_APP_NAME to specify the name that shows up in PulseAudio for your application
    • Added the hint SDL_HINT_AUDIO_DEVICE_STREAM_NAME to specify the name that shows up in PulseAudio associated with your audio stream
    • Added the hint SDL_HINT_LINUX_JOYSTICK_DEADZONES to control whether HID defined dead zones should be respected on Linux
    • Added the hint SDL_HINT_THREAD_PRIORITY_POLICY to specify the thread scheduler policy
    • Added the hint SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL to allow time critical threads to use a realtime scheduling policy

    Android:

    • Added SDL_AndroidRequestPermission() to request a specific system permission
    • Added the hint SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO to control whether audio will pause when the application goes intot he background

    OS/2:

    • Added support for OS/2, see docs/README-os2.md for details

    Emscripten (running in a web browser):

    • Added the hint SDL_HINT_EMSCRIPTEN_ASYNCIFY to control whether SDL should call emscripten_sleep internally
    Source code(tar.gz)
    Source code(zip)
  • release-2.0.12(May 24, 2022)

    In addition to lots of bug fixes, here are the major changes in this release:

    General:

    • Added SDL_GetTextureScaleMode() and SDL_SetTextureScaleMode() to get and set the scaling mode used for a texture
    • Added SDL_LockTextureToSurface(), similar to SDL_LockTexture() but the locked area is exposed as a SDL surface.
    • Added new blend mode, SDL_BLENDMODE_MUL, which does a modulate and blend operation
    • Added the hint SDL_HINT_DISPLAY_USABLE_BOUNDS to override the results of SDL_GetDisplayUsableBounds() for display index 0.
    • Added the window underneath the finger to the SDL_TouchFingerEvent
    • Added SDL_GameControllerTypeForIndex(), SDL_GameControllerGetType() to return the type of a game controller (Xbox 360, Xbox One, PS3, PS4, or Nintendo Switch Pro)
    • Added the hint SDL_HINT_GAMECONTROLLERTYPE to override the automatic game controller type detection
    • Added SDL_JoystickFromPlayerIndex() and SDL_GameControllerFromPlayerIndex() to get the device associated with a player index
    • Added SDL_JoystickSetPlayerIndex() and SDL_GameControllerSetPlayerIndex() to set the player index associated with a device
    • Added the hint SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS to specify whether Nintendo Switch Pro controllers should use the buttons as labeled or swapped to match positional layout. The default is to use the buttons as labeled.
    • Added support for Nintendo GameCube controllers to the HIDAPI driver, and a hint SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE to control whether this is used.
    • Improved support for Xbox 360 and Xbox One controllers when using the HIDAPI driver
    • Added support for many game controllers, including:
      • 8BitDo FC30 Pro
      • 8BitDo M30 GamePad
      • BDA PS4 Fightpad
      • HORI Fighting Commander
      • Hyperkin Duke
      • Hyperkin X91
      • MOGA XP5-A Plus
      • NACON GC-400ES
      • NVIDIA Controller v01.04
      • PDP Versus Fighting Pad
      • Razer Raion Fightpad for PS4
      • Razer Serval
      • Stadia Controller
      • SteelSeries Stratus Duo
      • Victrix Pro Fight Stick for PS4
      • Xbox One Elite Series 2
    • Fixed blocking game controller rumble calls when using the HIDAPI driver
    • Added SDL_zeroa() macro to zero an array of elements
    • Added SDL_HasARMSIMD() which returns true if the CPU has ARM SIMD (ARMv6+) features

    Windows:

    • Fixed crash when using the release SDL DLL with applications built with gcc
    • Fixed performance regression in event handling introduced in 2.0.10
    • Added support for SDL_SetThreadPriority() for UWP applications

    Linux:

    • Added the hint SDL_HINT_VIDEO_X11_WINDOW_VISUALID to specify the visual chosen for new X11 windows
    • Added the hint SDL_HINT_VIDEO_X11_FORCE_EGL to specify whether X11 should use GLX or EGL by default

    iOS / tvOS / macOS:

    • Added SDL_Metal_CreateView() and SDL_Metal_DestroyView() to create CAMetalLayer-backed NSView/UIView and attach it to the specified window.

    iOS/ tvOS:

    • Added support for Bluetooth Steam Controllers as game controllers

    tvOS:

    • Fixed support for surround sound on Apple TV

    Android:

    • Added SDL_GetAndroidSDKVersion() to return the API level of the current device
    • Added support for audio capture using OpenSL-ES
    • Added support for Bluetooth Steam Controllers as game controllers
    • Fixed rare crashes when the app goes into the background or terminates
    Source code(tar.gz)
    Source code(zip)
    SDL2-2.0.12-win32-x64.zip(535.66 KB)
    SDL2-2.0.12-win32-x86.zip(458.76 KB)
    SDL2-2.0.12.dmg(1.10 MB)
    SDL2-2.0.12.tar.gz(5.45 MB)
    SDL2-2.0.12.tar.gz.sig(95 bytes)
    SDL2-2.0.12.zip(6.46 MB)
    SDL2-2.0.12.zip.sig(95 bytes)
    SDL2-devel-2.0.12-mingw.tar.gz(10.09 MB)
    SDL2-devel-2.0.12-VC.zip(1.92 MB)
  • release-2.0.10(May 24, 2022)

    In addition to lots of bug fixes and build improvements, here are the major changes in this release:

    General:

    • The SDL_RW* macros have been turned into functions that are available only in 2.0.10 and onward
    • Added SDL_SIMDGetAlignment(), SDL_SIMDAlloc(), and SDL_SIMDFree(), to allocate memory aligned for SIMD operations for the current CPU
    • Added SDL_RenderDrawPointF(), SDL_RenderDrawPointsF(), SDL_RenderDrawLineF(), SDL_RenderDrawLinesF(), SDL_RenderDrawRectF(), SDL_RenderDrawRectsF(), SDL_RenderFillRectF(), SDL_RenderFillRectsF(), SDL_RenderCopyF(), SDL_RenderCopyExF(), to allow floating point precision in the SDL rendering API.
    • Added SDL_GetTouchDeviceType() to get the type of a touch device, which can be a touch screen or a trackpad in relative or absolute coordinate mode.
    • The SDL rendering API now uses batched rendering by default, for improved performance
    • Added SDL_RenderFlush() to force batched render commands to execute, if you're going to mix SDL rendering with native rendering
    • Added the hint SDL_HINT_RENDER_BATCHING to control whether batching should be used for the rendering API. This defaults to "1" if you don't specify what rendering driver to use when creating the renderer.
    • Added the hint SDL_HINT_EVENT_LOGGING to enable logging of SDL events for debugging purposes
    • Added the hint SDL_HINT_GAMECONTROLLERCONFIG_FILE to specify a file that will be loaded at joystick initialization with game controller bindings
    • Added the hint SDL_HINT_MOUSE_TOUCH_EVENTS to control whether SDL will synthesize touch events from mouse events
    • Improved handling of malformed WAVE and BMP files, fixing potential security exploits

    Linux:

    • Removed the Mir video driver in favor of Wayland

    iOS / tvOS:

    • Added support for Xbox and PS4 wireless controllers in iOS 13 and tvOS 13
    • Added support for text input using Bluetooth keyboards

    Android:

    • Added low latency audio using OpenSL ES
    • Removed SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH (replaced by SDL_HINT_MOUSE_TOUCH_EVENTS and SDL_HINT_TOUCH_MOUSE_EVENTS) SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH=1, should be replaced by setting both previous hints to 0. SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH=0, should be replaced by setting both previous hints to 1.
    • Added the hint SDL_HINT_ANDROID_BLOCK_ON_PAUSE to set whether the event loop will block itself when the app is paused.
    Source code(tar.gz)
    Source code(zip)
    SDL2-2.0.10-win32-x64.zip(508.98 KB)
    SDL2-2.0.10-win32-x86.zip(438.82 KB)
    SDL2-2.0.10.dmg(1.02 MB)
    SDL2-2.0.10.tar.gz(5.29 MB)
    SDL2-2.0.10.tar.gz.sig(95 bytes)
    SDL2-2.0.10.zip(6.27 MB)
    SDL2-2.0.10.zip.sig(95 bytes)
    SDL2-devel-2.0.10-mingw.tar.gz(9.87 MB)
    SDL2-devel-2.0.10-VC.zip(1.84 MB)
  • release-2.0.9(May 24, 2022)

    In addition to lots of bug fixes and build improvements, here are the major changes in this release:

    General:

    • Added a new sensor API, initialized by passing SDL_INIT_SENSOR to SDL_Init(), and defined in SDL_sensor.h
    • Added an event SDL_SENSORUPDATE which is sent when a sensor is updated
    • Added SDL_GetDisplayOrientation() to return the current display orientation
    • Added an event SDL_DISPLAYEVENT which is sent when the display orientation changes
    • Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms. (Thanks to Valve for contributing the PS4 and Nintendo Switch Pro controller support)
    • Added support for many other popular game controllers
    • Added SDL_JoystickGetDevicePlayerIndex(), SDL_JoystickGetPlayerIndex(), and SDL_GameControllerGetPlayerIndex() to get the player index for a controller. For XInput controllers this returns the XInput index for the controller.
    • Added SDL_GameControllerRumble() and SDL_JoystickRumble() which allow simple rumble without using the haptics API
    • Added SDL_GameControllerMappingForDeviceIndex() to get the mapping for a controller before it's opened
    • Added the hint SDL_HINT_MOUSE_DOUBLE_CLICK_TIME to control the mouse double-click time
    • Added the hint SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS to control the mouse double-click radius, in pixels
    • Added SDL_HasColorKey() to return whether a surface has a colorkey active
    • Added SDL_HasAVX512F() to return whether the CPU has AVX-512F features
    • Added SDL_IsTablet() to return whether the application is running on a tablet
    • Added SDL_THREAD_PRIORITY_TIME_CRITICAL for threads that must run at the highest priority

    Mac OS X:

    • Fixed black screen at start on Mac OS X Mojave

    Linux:

    • Added SDL_LinuxSetThreadPriority() to allow adjusting the thread priority of native threads using RealtimeKit if available.

    iOS:

    • Fixed Asian IME input

    Android:

    • Updated required Android SDK to API 26, to match Google's new App Store requirements
    • Added support for wired USB Xbox, PS4, and Nintendo Switch Pro controllers
    • Added support for relative mouse mode on Android 7.0 and newer (except where it's broken, on Chromebooks and when in DeX mode with Samsung Experience 9.0)
    • Added support for custom mouse cursors on Android 7.0 and newer
    • Added the hint SDL_HINT_ANDROID_TRAP_BACK_BUTTON to control whether the back button will back out of the app (the default) or be passed to the application as SDL_SCANCODE_AC_BACK
    • Added SDL_AndroidBackButton() to trigger the Android system back button behavior when handling the back button in the application
    • Added SDL_IsChromebook() to return whether the app is running in the Chromebook Android runtime
    • Added SDL_IsDeXMode() to return whether the app is running while docked in the Samsung DeX
    Source code(tar.gz)
    Source code(zip)
    SDL2-2.0.9-win32-x64.zip(486.96 KB)
    SDL2-2.0.9-win32-x86.zip(416.29 KB)
    SDL2-2.0.9.dmg(994.31 KB)
    SDL2-2.0.9.tar.gz(5.00 MB)
    SDL2-2.0.9.tar.gz.sig(95 bytes)
    SDL2-2.0.9.zip(5.96 MB)
    SDL2-2.0.9.zip.sig(95 bytes)
    SDL2-devel-2.0.9-mingw.tar.gz(9.54 MB)
    SDL2-devel-2.0.9-VC.zip(1.80 MB)
  • release-2.0.8(May 23, 2022)

    In addition to lots of bug fixes and build improvements, here are the major changes in this release:

    General:

    • Added SDL_fmod() and SDL_log10()
    • Each of the SDL math functions now has the corresponding float version
    • Added SDL_SetYUVConversionMode() and SDL_GetYUVConversionMode() to control the formula used when converting to and from YUV colorspace. The options are JPEG, BT.601, and BT.709

    Windows:

    • Implemented WASAPI support on Windows UWP and removed the deprecated XAudio2 implementation
    • Added resampling support on WASAPI on Windows 7 and above

    Windows UWP:

    • Added SDL_WinRTGetDeviceFamily() to find out what type of device your application is running on

    Mac OS X:

    • Added support for the Vulkan SDK for Mac: https://www.lunarg.com/lunarg-releases-vulkan-sdk-1-0-69-0-for-mac/
    • Added support for OpenGL ES using ANGLE when it's available

    Mac OS X / iOS / tvOS:

    • Added a Metal 2D render implementation
    • Added SDL_RenderGetMetalLayer() and SDL_RenderGetMetalCommandEncoder() to insert your own drawing into SDL rendering when using the Metal implementation

    iOS:

    • Added the hint SDL_HINT_IOS_HIDE_HOME_INDICATOR to control whether the home indicator bar on iPhone X should be hidden. This defaults to dimming the indicator for fullscreen applications and showing the indicator for windowed applications.

    iOS / Android:

    • Added the hint SDL_HINT_RETURN_KEY_HIDES_IME to control whether the return key on the software keyboard should hide the keyboard or send a key event (the default)

    Android:

    • SDL now supports building with Android Studio and Gradle by default, and the old Ant project is available in android-project-ant
    • SDL now requires the API 19 SDK to build, but can still target devices down to API 14 (Android 4.0.1)
    • Added SDL_IsAndroidTV() to tell whether the application is running on Android TV

    Android / tvOS:

    • Added the hint SDL_HINT_TV_REMOTE_AS_JOYSTICK to control whether TV remotes should be listed as joystick devices (the default) or send keyboard events.

    Linux:

    • Added the hint SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR to control whether the X server should skip the compositor for the SDL application. This defaults to "1"
    • Added the hint SDL_HINT_VIDEO_DOUBLE_BUFFER to control whether the Raspberry Pi and KMSDRM video drivers should use double or triple buffering (the default)
    Source code(tar.gz)
    Source code(zip)
    SDL2-2.0.18.zip.sig(95 bytes)
    SDL2-2.0.8-win32-x64.zip(497.96 KB)
    SDL2-2.0.8-win32-x86.zip(408.45 KB)
    SDL2-2.0.8.dmg(1.37 MB)
    SDL2-2.0.8.tar.gz(4.68 MB)
    SDL2-2.0.8.tar.gz.sig(95 bytes)
    SDL2-2.0.8.zip(5.63 MB)
    SDL2-2.0.8.zip.sig(95 bytes)
    SDL2-devel-2.0.8-mingw.tar.gz(7.62 MB)
    SDL2-devel-2.0.8-VC.zip(1.79 MB)
Owner
Simple Directmedia Layer
Simple Directmedia Layer (SDL) is a framework for creating cross-platform games and applications.
Simple Directmedia Layer
Simple Directmedia Layer

Simple DirectMedia Layer (SDL) Version 2.0 --- https://www.libsdl.org/ Simple Di

Simple Directmedia Layer 4.7k Jan 5, 2023
Simple Directmedia Layer

hb-sdl Harbour bindings for SDL 2.0.16, a Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to aud

Rafał Jopek 3 Nov 8, 2022
Simple DirectMedia Layer (SDL) 1.2 for Symbian S60v1 devices such as the Nokia N-Gage.

SDL 1.2 Even though SDL 1.2 is outdated and officially no longer supported, this is an attempt to get it running on Symbian S60v1 devices such as the

N-Gage SDK. 4 Apr 4, 2022
An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.

Simple DirectMedia Layer (SDL) sdl12-compat --- https://www.libsdl.org/ This is t

Simple Directmedia Layer 139 Jan 5, 2023
A simple and easy-to-use library to enjoy videogames programming

raylib is a simple and easy-to-use library to enjoy videogames programming. raylib is highly inspired by Borland BGI graphics lib and by XNA framework

Ray 11.3k Jan 4, 2023
A simple text-based adventure game

The Lighthouse of Doom This repository contain a simple text-based adventure game, implemented twice, once in portable C, and once in Z80 assembly lan

Steve Kemp 55 Nov 1, 2022
Simple tower defense game using C++ with Entity Component System (ECS)

CubbyTower CubbyTower is a simple tower defense game using C++ with Entity Component System (ECS). The code is built on C++17 and can be compiled with

Chris Ohk 39 Dec 20, 2022
Simple CSV localization system for Unreal Engine 4

BYG Localization We wanted to support fan localization for Industries of Titan and found that Unreal's built-in localization system was not exactly wh

Brace Yourself Games 56 Dec 8, 2022
A single-header C++ library for making simple 2D games

A single-header C++ library for making simple 2D games PLATFORM: Windows LANGUAGE: C++ ENVIRONMENT: Visual Studio Why? Learning C++ is often seen as d

Sumo Digital Academy 63 Dec 22, 2022
Simple, fast, easy to get started mid-level game engine written in Zig

Alka Game engine written in zig, compatible with master branch. This engine does provide a toolset for you but generally you have to implement how the

Kiakra 23 Dec 5, 2022
A simple localization framework that can re-localize in built maps based on FAST-LIO.

Realtime 3D global localization in a pre-built point cloud map. By fusing low-frequency global localization (about 0.5~0.2Hz), and high-frequency odometry from FAST-LIO, the entire system is computationally efficient.

KINO 248 Jan 3, 2023
A simple snake game made in C language.

My-snake-game This is my first game more to come! to play the game execute the snake.exe and press X to start. W to go up / D to go right / A to go le

Ayman Baioumy 4 Aug 31, 2022
A simple shooter game like Space Invaders that runs on QMK Firmware.

About A simple shooter game like Space Invaders that runs on QMK Firmware. What is it like? Player's Manual English: manual_en.md Japanese: manual_jp.

null 5 Sep 30, 2022
Dragon's Dice Roller aims to be a lightweight, simple, reliable and easy-to-use dice roller for RPG games.

Dragon's Dice Roller is the first and (so far the only) open source RPG dice roller written in C available on GitHub. It aims to be a lightweight, simple, reliable and easy-to-use dice roller for any kind of role-playing game.

Michael Kolesidis 10 Apr 22, 2022
A c program to play a simple 2 players tic tac toe game

Tic_Tac_Toe_Game A c program to play a simple 2 players tic tac toe game Tic-tac-toe is a simple game for two players who take turns marking the space

Muhammad Zain Ul Haque 1 Oct 28, 2021
A simple game framework written in C++ using SDL

SGF SGF (Simple Game Framework) is, as the name implies; a very simple and easy to use game framework written in C++ using SDL. Currently the project

Cam K. 1 Nov 4, 2021
Building Escape is a simple room escape game made with Unreal Engine 4.27 and C++.

Building-Escape Building Escape is a simple room escape game made with Unreal Engine and C++. The main purpose of the game is to find a way to escape

Christine Coomans 2 Dec 13, 2021
A simple C++ program for an interactive Tic Tac Toe Game.

CSE 332 Lab 3:Tic-Tac-Toe Game Objective: This lab is intended to extend your use of basic C++ language features from the previous labs, and to give y

Julia Grandury 1 Nov 8, 2021
Using Astar 2d simple console game

Journey-to-a-astar About this game Astar 알고리즘을 변형하여 이용한 2D맵 게임입니다. 게임의 목표는 ★(a star)에 도달하는 것 입니다. 별을 지키는 적이 플레이어를 쫓아옵니다. 적에게 잡히지 않고 최대한 빠른시간안에 별에 도달하면

Minseob Kim 1 Dec 10, 2021