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
  • 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
  • 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
  • Add SDL_ConfineCursor

    Add SDL_ConfineCursor

    This adds a new function similar to an extension found in the Unreal Engine version of SDL. The API is changed from UE only in the return value; UE returns an SDL_bool while this returns an int to be consistent with the rest of SDL_video.

    Notably absent is a real implementation, for two reasons:

    1. The X implementation, as you might expect, does more than add a single function and I haven't had time to try and bring the changes to upstream. I threw together a starting point for Wayland because I knew it would be mostly straightforward. However...
    2. It's not actually clear if this exact API makes sense anymore as of 2.0.16

    From what I can tell, this API pre-dates much of the grab/focus functionality that exists in modern SDL - it's basically SetWindowMouseGrab but with an added SDL_Rect parameter. This leads me to wonder... would it make more sense to rework this into SDL_SetWindowMouseGrabRegion, and expand the existing sysvideo API to include a rect? As the Wayland driver points out, the only real difference even in the backend is the added rectangle, and from what I can tell the X implementation just adds pointer barriers via XFixes, so it seems like implementing exactly the Epic extension would just duplicate a lot of existing functionality and introduce weird collisions with window state and such. The only unique behavior is that passing NULL for the SDL_Window* parameter removes all confinement rects; I don't know how important this feature is but I suppose it wouldn't be hard to call SetWindowMouseGrab(SDL_FALSE) for all your windows...

    CC @MikeSart @BrandonSchaefer, in case I've missed any critical details.

    Part of #4822, fixes #4850

    opened by flibitijibibo 37
  • 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 36
  • thread safe SDL_Renderer

    thread safe SDL_Renderer

    I still don't understand why we don't have thread safe SDL_renderer. I mean it's almost 2023. what isn't multithread accessible. my team is working on a modern fully featured GUI but are having a hard time implementing some features due to lack of a thread safe renderer. we were even thinking on rewriting the whole code base with a different graphics API. we've testeted the SDL's renderer on multithreaded systems and works fine with vulkan and direct x contexts. why are we letting a single API "OPENGL" prevent us from getting in on the fun and capabilities of the current tech "threading" caps.

    opened by volt-bot 0
  • 5858c7dfce80b0854b04475dde97996692ce9200 breaks nvidia on wayland

    5858c7dfce80b0854b04475dde97996692ce9200 breaks nvidia on wayland

    With https://github.com/libsdl-org/SDL/commit/5858c7dfce80b0854b04475dde97996692ce9200, any SDL2 program on nvidia with wayland (sway) just shows a black screen

    Not sure if I have to report it here or to nvidia devs, so doing it in both places

    Without revert

    broken

    With revert

    working

    Video: https://0x0.st/oVAZ.mp4 (Download and play in mpv, doesn't work in browser)

    opened by git-bruh 2
  • Fix: Use WIN_ClientPointToSDL for converting additional mouse coordinate events (for DPI scaling)

    Fix: Use WIN_ClientPointToSDL for converting additional mouse coordinate events (for DPI scaling)

    This PR adds WIN_ClientPointToSDL conversion to other mouse motion events triggered by WM_MOUSELEAVE, WIN_UpdateFocus, and WIN_UpdateMouseCapture.

    Description

    Since https://github.com/libsdl-org/SDL/commit/ab81a559f43abc0858c96788f8e00bbb352287e8, SDL has supported the SDL_WINDOWS_DPI_SCALING, which changes the SDL coordinate system units to be DPI-scaled points.

    In that commit, WIN_ClientPointToSDL was used to convert mouse positions to SDL coordinate system units (before passing them to SDL_SendMouseMotion).

    However, a few places were missed, which could result in unexpected / incorrect mouse position values when using SDL_WINDOWS_DPI_SCALING on a system with a high DPI mode in certain cases (like that triggered by WM_MOUSELEAVE).

    This PR adds WIN_ClientPointToSDL conversion to other mouse motion events triggered by WM_MOUSELEAVE, WIN_UpdateFocus, and WIN_UpdateMouseCapture.

    Existing Issue(s)

    Fixes #6261

    opened by past-due 0
  • SDL_WINDOWS_DPI_SCALING does not always convert mouse positions to the SDL coordinate system points

    SDL_WINDOWS_DPI_SCALING does not always convert mouse positions to the SDL coordinate system points

    Since https://github.com/libsdl-org/SDL/commit/ab81a559f43abc0858c96788f8e00bbb352287e8, SDL has supported the SDL_WINDOWS_DPI_SCALING, which changes the SDL coordinate system units to be DPI-scaled points.

    In that commit, WIN_ClientPointToSDL was used to convert mouse positions to SDL coordinate system units (before passing them to SDL_SendMouseMotion).

    However, a few places were missed, which could result in unexpected / incorrect mouse position values when using SDL_WINDOWS_DPI_SCALING on a system with a high DPI mode in certain cases (like that triggered by WM_MOUSELEAVE).

    A PR to fix this in incoming.

    opened by past-due 0
  • Regression: Apps launched via Emulationstation-DE AUR version (SDL 2.24.0-2) can't see controller, but with the earlier libSDL2-2.0.so.0 from the AppImage version (2.0.20+dfsg-2build1), they can.

    Regression: Apps launched via Emulationstation-DE AUR version (SDL 2.24.0-2) can't see controller, but with the earlier libSDL2-2.0.so.0 from the AppImage version (2.0.20+dfsg-2build1), they can.

    Hello. This is my first bug report on GitHub, so let's see if I can get it right:

    SDL VERSION: 2.24.0-2

    PLATFORM: x86_64 Intel PC

    OS: EndeavourOS Linux

    DE: Problem presents itself in both KDE Plasma and Openbox, was not tested in other DEs/WMs.

    HARDWARE: A wired (USB) Xbox 360 controller (ID 045e:028e Microsoft Corp. Xbox360 Controller).

    SOFTWARE: EmulationStation Desktop Edition (ES-DE), several emulators including RetroArch, mGBA, Flycast, bsnes and Dolphin.

    STEPS TO REPRODUCE: Prerequisites: The hardware listed above connected to a PC running an Arch-based distro with access to the AUR that recognizes the controller (which it should out of the box). At least one videogame emulator configured in ES-DE. 1. Launch a game emulator from the terminal, a .desktop file or other common method. Verify that it recognizes controller input. Exit the program. 2. Launch the AUR build of ES-DE. Verify that it also recognizes controller input. 3. Finally, launch the same, known to work, emulator from Step 1 via ES-DE.

    EXPECTED BEHAVIOR: The emulator will recognize the gamepad's input just as it did when launched directly.

    ACTUAL BEHAVIOR: The emulator does not recognize any controller input whatsoever.

    ADDITIONAL INFORMATION:

    • Mouse and keyboard input are not affected and work normally.
    • Unplugging the controller after the emulator has been launched via ES-DE then plugging it back in makes it work for that session.
    • The "EmulationStation-DE-x64_Current.AppInfo" version of ES-DE is bundled with an earlier version of SDL (2.0.20+dfsg-2build1) from the Ubuntu 22.04 repos.
    • This AppImage version works as expected and does not present this issue.
    • Replacing the natively installed file /usr/lib/libSDL2-2.0.so.0 with the version bundled in the AppImage causes the AUR version to also work as it should.

    CONCLUSION: One or more of the changes made to SDL between the two versions mentioned above has caused a regression which is probably the source of the error.

    opened by prmbittencourt 0
  • Vita: fix controls on PSTV with opened IME

    Vita: fix controls on PSTV with opened IME

    Description

    Gamepad input was reported on PSTV even when, in fact, it was intercepted by IME. This also simplifies code and adds error-reporting on vita for led/rumble. CI will fail until vitasdk docker image gets rebuilt.

    Existing Issue(s)

    opened by isage 0
Releases(release-2.24.0)
  • 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 3.8k Sep 17, 2022
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 1 Jan 19, 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 114 Sep 16, 2022
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 10.7k Sep 22, 2022
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 54 Aug 18, 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 35 Aug 21, 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 53 Sep 17, 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 52 Sep 20, 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 22 Aug 28, 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 216 Sep 21, 2022
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 4 Jul 28, 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