Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SDL2 port with latest changes from upstream #8

Open
wants to merge 1,883 commits into
base: master
Choose a base branch
from
This pull request is big! We’re only showing the most recent 250 commits.

Commits on Oct 29, 2018

  1. Configuration menu
    Copy the full SHA
    5fb7a3e View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2019

  1. render: add a hint for toggling relative scaling

    Fixes Bugzilla #4811.
    hmk committed Sep 30, 2019
    Configuration menu
    Copy the full SHA
    bc395f6 View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2020

  1. cocoa: allow calling CreateWindowFrom on an NSView

    This lets applications embed SDL with other widgets surrounding it.
    Already possible on Windows and X11.
    
    Fixes Bugzilla #5060.
    
    --HG--
    extra : rebase_source : 4e31c8c5b15cf001b3f4eae63d79e1620b351b67
    ligfx committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    b213315 View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2020

  1. wasapi: Improve WASAPI audio backend latency (thanks, Anthony!).

    Anthony Pesch's notes on his patch:
    
    "Currently, the WASAPI backend creates a stream in shared mode and sets the
    device's callback size to be half of the shared stream's total buffer size.
    
    This works, but doesn't coordinate will with the actual hardware. The hardware
    will raise an interrupt after every period which in turn will signal the
    object being waited on inside of WaitDevice. From my empirical testing, the
    callback size was often larger than the period size and not a multiple of it,
    which resulted in poor latency when trying to time an application based on the
    audio callback. The reason for this looked something like:
    
    * The device's callback would be called and and the audio buffer was filled.
    * WaitDevice would be called.
    * The hardware would raise an interrupt after one period.
    * WaitDevice would resume, see that a a full callback had not been played and
      then wait again.
    * The hardware would raise an interrupt after another period.
    * WaitDevice would resume, see that a full callback + some extra amount had
      been played and then it would again call our callback and this process would
      repeat.
    
    The effect of this is that the pacing between subsequent callbacks is poor -
    sometimes it's called very quickly, sometimes it's called very late.
    
    By matching the callback's size to the stream's period size, the pacing of
    calls to the user callback is improved substantially. I didn't write an actual
    test for this, but my use case for this was my Dreamcast emulator
    (https://redream.io) which uses the audio callback to help drive the emulation
    speed. Without this change and with the default shared stream buffer (which
    has a period of ~10ms) I would get frame times that were between ~3-30
    milliseconds; after this change I get frame times of ~11-22 milliseconds.
    
    Note, this patch also has a change that removes passing a duration to the
    Initialize call. It seems that the default duration used (when 0 is passed)
    does typically match up with the duration returned by GetDevicePeriod, however
    the Initialize docs say:
    
    > To set the buffer to the minimum size required by the engine thread, the
    > client should call Initialize with the hnsBufferDuration parameter set to 0.
    > Following the Initialize call, the client can get the size of the resulting
    > buffer by calling IAudioClient::GetBufferSize.
    
    This change isn't strictly required, but I made it to hopefully rule out
    another source of unexpected latency."
    
    Fixes Bugzilla #4592.
    
    --HG--
    extra : histedit_source : cc22ed774514f2596fed80632d7f6d60035b6b95
    icculus committed Apr 7, 2020
    Configuration menu
    Copy the full SHA
    51ae135 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1c00dd6 View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2020

  1. Configuration menu
    Copy the full SHA
    1d701e2 View commit details
    Browse the repository at this point in the history
  2. cocoa: Patched to compile.

    icculus committed Apr 8, 2020
    Configuration menu
    Copy the full SHA
    631a144 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5e4393b View commit details
    Browse the repository at this point in the history
  4. Add perforce support to showrev.sh

    In order to generate meaningful output from SDL_GetRevision()
    slouken committed Apr 8, 2020
    Configuration menu
    Copy the full SHA
    b3e9b93 View commit details
    Browse the repository at this point in the history
  5. Revert "Fix incorrectly terminated MakeThreadHighPriority dbus message"

    The first terminator is for input parameters. The second terminator was for the
    output parameters.
    
    If an error occurs when calling MakeThreadHighPriority(), e.g. a bad thread id,
    then the reply from connection_send_with_reply_and_block() will be null.
    slouken committed Apr 8, 2020
    Configuration menu
    Copy the full SHA
    146248e View commit details
    Browse the repository at this point in the history
  6. SDL: ps4 controller trigger bits on other controllers just mean that …

    …there's some activity, not saturation - only force it on if the analog value is 0.
    slouken committed Apr 8, 2020
    Configuration menu
    Copy the full SHA
    28d4068 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6350e06 View commit details
    Browse the repository at this point in the history
  8. Removed debug code

    slouken committed Apr 8, 2020
    Configuration menu
    Copy the full SHA
    803db9c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    933e012 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2020

  1. Configuration menu
    Copy the full SHA
    cbc4794 View commit details
    Browse the repository at this point in the history
  2. emscripten: Typo

    Beuc committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    c9d48bc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    90d6218 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9eacab8 View commit details
    Browse the repository at this point in the history
  5. emscripten: Let SDL_GetDisplayUsableBounds return the size of the window

    This does not account for scrollbars nor margins. But is much better then returning the full display size when not running fullscreen, but for example in an iframe.
    daid committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    44f412e View commit details
    Browse the repository at this point in the history
  6. emscripten: Pass canvas id to request_pointer_lock

    Fixes pointer lock with DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1
    Daft-Freak committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    db8351e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    320ffa0 View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2020

  1. metal: Added some support interfaces to Apple's Metal API (thanks, Ca…

    …leb!).
    
    Caleb Cornett's comments:
    
    "A few weeks ago, Alex added a partial Metal API to SDL2:
    
    https://hg.libsdl.org/SDL/rev/b87ba0fad17e
    
    I noticed it was missing a few features that would help Metal become a
    first-class citizen in SDL, so I went ahead and wrote them! Here are the new
    APIs:
    
    1. SDL_WINDOW_METAL flag for SDL_CreateWindow(). This allows the programmer
    to specify that they intend to create a window for use with SDL_MetalView.
    The flag is used to ensure correct usage of the API and to prevent
    accidentally defaulting to OpenGL on iOS.
    
    2. SDL_Metal_GetLayer(). This function takes a SDL_MetalView and returns a
    pointer to the view's backing CAMetalLayer. This simplifies things
    considerably, since in the current version of the SDL_Metal API the
    programmer is required to bridge-cast a SDL_MetalView handle to an NSView or
    UIView (depending on the platform) and then extract the layer from there.
    SDL_Metal_GetLayer automatically handles all of that, making the operation
    simple and cross-platform.
    
    3. SDL_Metal_GetDrawableSize(). This function already exists in the current
    SDL_Metal API (and is used behind-the-scenes for SDL_Vulkan_GetDrawableSize
    on Apple platforms) but was not publicly exposed. My patch exposes this
    function for public use. It works just like you'd expect.
    
    Tested on macOS 10.14 and iOS 12.4."
    
    Fixes Bugzilla #4796.
    icculus committed Apr 10, 2020
    Configuration menu
    Copy the full SHA
    ce16f94 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8c6b90d View commit details
    Browse the repository at this point in the history
  3. render: Scale relative mouse motion better for logical sizing

    From hmk:
    
    "When scaling is enabled (e.g. via SDL_RenderSetLogicalSize, size not equal
    to window size), mouse motion events are also scaled.  Small motions are
    rounded up (SDL_max() when the value after scaling is less than 1), while
    larger motions are truncated by the floating point -> integer conversion.
    
    https://hg.libsdl.org/SDL/file/18ede62f3f14/src/render/SDL_render.c#l658
    
    The end result feels something like mouse reverse mouse acceleration + angle
    snapping at low speeds, but less consistent (amount of truncation & rounding
    depends on how fast the mouse is moved) and potentially much worse if the
    scaling factor is large.  This pretty much makes it useless for anything
    where you need precise mouse aiming (think of games).  I suspect this is why
    aiming gets so terrible in some games that let you use scaling to reduce the
    render resolution (e.g. Ion Fury).
    
    With 4x4 scaling, I can reproduce a situation where it takes three fast flicks
    of the mouse across the pad to undo one slow sweep across the pad.  In other
    words, extreme reverse acceleration.  This does not happen when scaling is
    disabled.
    
    Furthermore, any game that uses relative mouse motion events for 3D camera
    rotation probably wants the raw mouse deltas and not a value that depends on
    scaling and resolution and rounding and truncation.  Ideal camera rotation
    just takes mouse input, multiplies it by sensitivity, and adds it to the
    angle-in-radians or whatever measure is used for yaw & pitch.  Pixels and
    screen resolution or window dimensions should not be a part of the equation
    at all, even if it could be implemented without rounding errors.
    
    [...]
    
    This [patch] completely eliminates angle snapping for me, and makes
    sensitivity consistent.  In other words, it's completely usable for, say,
    aiming in a first person shooter."
    
    Partially fixes Bugzilla #4811.
    
    --HG--
    extra : histedit_source : 9ddb125b0f448d9bba5c3ba73c22babafbbab2ad
    hmk committed Apr 10, 2020
    Configuration menu
    Copy the full SHA
    36dfe47 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2020

  1. build: Merge pkg-config Libs.private into Libs for static-only builds

    A project being built entirely statically will call pkg-config with
    --static, which utilises the Libs.private field. Conversely it will
    not use --static when not being built entirely statically, even if
    there is only a static build of SDL available. This will most likely
    cause the build to fail due to underlinking unless we merge the Libs
    fields.
    
    This is what the Meson build system does when it generates pkg-config
    files. This also also follows the behaviour of sdl2-config.
    
    At the same time, the runtime linker flags are not applicable to
    static-only builds so only add them for shared builds.
    chewi committed Apr 11, 2020
    Configuration menu
    Copy the full SHA
    3cb2522 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2020

  1. build: Don't duplicate Libs in Libs.private in pkg-config file

    pkg-config already prepends Libs to Libs.private when you specify
    --static so there's no need to duplicate them. Most other projects
    don't do this.
    chewi committed Apr 12, 2020
    Configuration menu
    Copy the full SHA
    4f71b42 View commit details
    Browse the repository at this point in the history
  2. video: NULL out pointer to freed window surface

    This behavior matches SDL_RecreateWindow and makes it less likely that
    another piece of code (e.g. a DestroyWindowFramebuffer implementation)
    will attempt to use or free the stale surface pointer.
    jayschwa committed Apr 12, 2020
    Configuration menu
    Copy the full SHA
    d2960c1 View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2020

  1. Partial fix for bug 5086 - CMake builds on Windows broken by sensor s…

    …upport (thanks DominikD!)
    slouken committed Apr 13, 2020
    Configuration menu
    Copy the full SHA
    cf179cb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b1621d3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c6c9f83 View commit details
    Browse the repository at this point in the history
  4. opengl: Allow SDL_GL_MakeCurrent() to accept a NULL window (thanks, M…

    …artin!).
    
    This allows you to bind surfaceless contexts on a background thread to, for
    example, load assets in a separate context, for platforms that have different
    requirements about sharing surfaces, etc.
    
    Martin's notes on the matter:
    
    "Here's a patch that enables passing NULL windows to SDL_GL_MakeCurrent, if
    the involved APIs allow it. Currently, this is only the case for EGL, and
    even then only if some specific extensions are present (which they usually
    are).
    
    If "surfaceless" contexts are not supported, SDL_GL_MakeCurrent continues to
    generate an error (albeit with a more specific error message than it used to),
    so this should not break anything that wasn't broken before."
    
    (Please see https://bugzilla.libsdl.org/show_bug.cgi?id=3695 for more
    discussion.)
    
    Fixes Bugzilla #3695.
    icculus committed Apr 13, 2020
    Configuration menu
    Copy the full SHA
    b04f324 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d1f1257 View commit details
    Browse the repository at this point in the history
  6. SDL_EGL_ChooseConfig: don't fall through if no matching format exists

    On Raspberry Pi 3 via the VC4 driver in firmware KMS mode, none of the
    found configs match the desired format, causing the function to fall through
    without any config being selected.
    
    Fix by first iterating over the found configs, and if no match exists,
    don't exclude the non-matching configs. This should fix RPI3 and possibly other
    targets without breaking targets that have a matching native format (such as RPI4).
    psyke83 committed Apr 13, 2020
    Configuration menu
    Copy the full SHA
    8172100 View commit details
    Browse the repository at this point in the history
  7. cmake: use check_symbol_exists, not check_function_exists (thanks, Ma…

    …nuel!)
    
    This fixes the problem where we think iOS has fseeko64, etc, but doesn't.
    
    Fixes Bugzilla #4885.
    icculus committed Apr 13, 2020
    Configuration menu
    Copy the full SHA
    e27e383 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2a9cf95 View commit details
    Browse the repository at this point in the history
  9. Fixed build

    slouken committed Apr 13, 2020
    Configuration menu
    Copy the full SHA
    d470617 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    5a71124 View commit details
    Browse the repository at this point in the history
  11. egl: Attempt to make this compile on WinRT, etc.

    --HG--
    extra : rebase_source : 11c3478b651613c87e6813937ae35e9abc65936e
    icculus committed Apr 13, 2020
    Configuration menu
    Copy the full SHA
    56ab0e5 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    f2273aa View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    85c6265 View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2020

  1. Configuration menu
    Copy the full SHA
    f44d454 View commit details
    Browse the repository at this point in the history
  2. render: Fixed compiler warning about implicit cast.

    --HG--
    extra : rebase_source : bc2b6eb3a0d9f459569e414b560715d9825a90b0
    icculus committed Apr 14, 2020
    Configuration menu
    Copy the full SHA
    0fbc5e3 View commit details
    Browse the repository at this point in the history
  3. opengl: Don't try to do Desktop OpenGL stuff if support isn't available.

    --HG--
    extra : rebase_source : 083533ff3a9a5c9404a65e4fefafeed9fffc9ae9
    icculus committed Apr 14, 2020
    Configuration menu
    Copy the full SHA
    b4361c5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    df596e3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    689cd73 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    66d5e63 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8432efb View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    199748d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    d039a7e View commit details
    Browse the repository at this point in the history
  10. Fixed bug 4299 - A recent change requires Core Bluetooth framework on…

    … iOS
    
    Caleb Cornett
    
    Just ran into this, and from my testing, whatever re-added the dependency is a _major_ regression. Not only is your app forced to link with CoreBluetooth, but iOS has apparently tightened up security and won't even let you _test_ your app unless it specifies the NSBluetoothAlwaysUsageDescription in an Info.plist. It doesn't even pop up an error message, it just straight up crashes.
    
    Adding the permission isn't a good solution either, since I'd really, really rather not have my app request users' bluetooth to always be enabled, especially if the only apparent reason is for Steam Controller support.
    slouken committed Apr 14, 2020
    Configuration menu
    Copy the full SHA
    fe6624d View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3e5d053 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    92b4716 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    72213d6 View commit details
    Browse the repository at this point in the history
  14. Fixed bug 5091 - Suspicious condition in HIDAPI_DriverXbox360_UpdateX…

    …Input
    
    meyraud705
    
    On line 220 of SDL_hidapi_xbox360.c https://hg.libsdl.org/SDL/file/d0ef8ec6a2eb/src/joystick/hidapi/SDL_hidapi_xbox360.c#l220
    
    if (!XINPUTGETSTATE(user_index, &xinput_state[user_index].state) == ERROR_SUCCESS) {
    
    logical not is only applied to the left hand side of this comparison.
    
    I think you mean:
    if (XINPUTGETSTATE(user_index, &xinput_state[user_index].state) != ERROR_SUCCESS) {
    slouken committed Apr 14, 2020
    Configuration menu
    Copy the full SHA
    9be0c61 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    526d328 View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2020

  1. Configuration menu
    Copy the full SHA
    c54c9c6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b125b96 View commit details
    Browse the repository at this point in the history
  3. haiku: Patched to compile.

    icculus committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    ded4215 View commit details
    Browse the repository at this point in the history
  4. hidapi: Blacklist the Razer Lycosa keyboard from enumeration.

    It's not a joystick and it hangs device enumeration.
    icculus committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    dc5800a View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2020

  1. Configuration menu
    Copy the full SHA
    ca99d73 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    aafa6b6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3d9cfce View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2020

  1. Configuration menu
    Copy the full SHA
    81ac6f1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4ddd4c4 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2020

  1. Added a Windows Gaming Input joystick driver

    This driver supports the Razer Atrox Arcade Stick
    
    Some of the quirks of this driver, inherent in Windows Gaming Input:
    * There will never appear to be controllers connected at startup. You must support hot-plugging in order to see these controllers.
    * You can't read the state of the guide button
    * You can't get controller events in the background
    slouken committed Apr 19, 2020
    Configuration menu
    Copy the full SHA
    d415791 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6c1a450 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2020

  1. joystick: On disconnect, recenter all game controller inputs.

    The joystick layer can't necessarily give us perfect centering, but we know
    that the game controller level has logical absolute idle positions that have
    nothing to do with the physical device.
    
    So send game controller events to make it look like the device is completely
    untouched before sending the final removal event.
    icculus committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    8e26ee2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0e82947 View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2020

  1. SDL_error: simplified error string management.

    This patch removes deferred error string formatting: now we do it during
    SDL_SetError(), so there's no limit on printf-style arguments used.
    
    Also removes stub for managing error string translations; we don't have the
    facilities to maintain that and the way we set arbitrary error strings
    doesn't really make this practical anyhow.
    
    Since the final error string is set right away and unique to the thread,
    we no longer need a static buffer for legacy SDL_GetError(), and we don't
    have to allocate 5x 128-byte argument fields per-thread. Also, since we now
    use SDL_vsnprintf instead of parsing the format string ourselves, there's a
    lot of code deleted and we have access to more robust formatting powers now.
    
    This does mean the final error strings can't be more than 128 bytes, down
    from the theoretical maximum of around 768, but I think this is probably okay.
    They might truncate but they will always be null-terminated!
    
    Fixes Bugzilla #5092.
    icculus committed Apr 21, 2020
    Configuration menu
    Copy the full SHA
    cb8b41a View commit details
    Browse the repository at this point in the history
  2. hid: Add Razer Arctosa keyboard to hid enumeration blacklist.

    Hangs SDL, same as the Razer Lycosa.
    
    Fixes Bugzilla #5101.
    icculus committed Apr 21, 2020
    Configuration menu
    Copy the full SHA
    f4b1652 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2020

  1. Added support for the following controllers:

    * PDP Afterglow Switch Controller
    * Thrustmaster ESwap Pro PS4 controller
    * Giotek VX4
    * Generic PS4 controller vid/pid that several knock offs use
    slouken committed Apr 22, 2020
    Configuration menu
    Copy the full SHA
    1c8786c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c8b01e2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c6b7c40 View commit details
    Browse the repository at this point in the history

Commits on Apr 23, 2020

  1. Configuration menu
    Copy the full SHA
    350c2f2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    100f2b2 View commit details
    Browse the repository at this point in the history
  3. Added support for the following controllers:

    * 8BitDo N30 Pro 2
    * 8BitDo SN30 Gamepad
    * 8BitDo SN30 Pro+
    * 8BitDo Zero 2
    * SZMY-POWER PC Gamepad
    * ThrustMaster eSwap PRO Controller
    * ZEROPLUS P4 Wired Gamepad
    
    In additional, all 8BitDo controllers use SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS to have the correct mapping based on user preferences.
    slouken committed Apr 23, 2020
    Configuration menu
    Copy the full SHA
    bc9e742 View commit details
    Browse the repository at this point in the history
  4. Fixed compiler warning

    slouken committed Apr 23, 2020
    Configuration menu
    Copy the full SHA
    cf961d9 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2020

  1. cmake: various Haiku settings were accidentally under "if(SDL_VIDEO)"

    --HG--
    extra : histedit_source : c2ba84e713e3e9a755cd46e8600db117da6bbab8
    icculus committed Apr 24, 2020
    Configuration menu
    Copy the full SHA
    2b3a520 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8e7e9e6 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2020

  1. Enable Xbox One HIDAPI driver on macOS

    The Xbox One HIDAPI driver is required on macOS for Xbox One S Bluetooth
    support since https://hg.libsdl.org/SDL/rev/2c4ec356333e
    cgutman committed Apr 26, 2020
    Configuration menu
    Copy the full SHA
    1913806 View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2020

  1. Configuration menu
    Copy the full SHA
    b11a08c View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2020

  1. Added additional logging to track down why the NVIDIA controller does…

    …n't send the back button
    slouken committed Apr 28, 2020
    Configuration menu
    Copy the full SHA
    e739f2b View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2020

  1. Configuration menu
    Copy the full SHA
    fd196c4 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2020

  1. Fixed bug 5112 - CMake won't compile in VS2019

    dark_sylinc
    
    Trying to build SDL with VS2019 using CMake will encounter a linking error
    
    More specifically:
    
        1>SDL_string.obj : error LNK2019: unresolved external symbol memset referenced in function SDL_vsnprintf_REAL
    slouken committed May 2, 2020
    Configuration menu
    Copy the full SHA
    fc20f07 View commit details
    Browse the repository at this point in the history

Commits on May 4, 2020

  1. Configuration menu
    Copy the full SHA
    a0cc4ab View commit details
    Browse the repository at this point in the history
  2. hints: Allow specifying audio device metadata.

    This is only supported on PulseAudio. You can set a description when opening
    your audio device that will show up in pauvcontrol, which lets you set
    per-stream volume levels.
    
    Fixes Bugzilla #4801.
    icculus committed May 4, 2020
    Configuration menu
    Copy the full SHA
    3273588 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    55e242b View commit details
    Browse the repository at this point in the history
  4. Improvement for bug 3446 - The haptic API does not allow to select th…

    …e direction axes
    
    meyraud705
    
    I see how the documentation is confusing. I think that the choice of the axis is an implementation detail. The documentation should state the goal of this value, so I propose this wording:
    
        "Use this value to play an effect on the steering wheel axis. This provides
         better compatibility across platforms and devices as SDL will guess the
         correct axis."
    
    Value could even be renamed 'SDL_HAPTIC_STEERING_AXIS'.
    
    For Linux, sending an effect on the X axis with a Logitech wheel works. Others brands don't have driver for Linux as far as I know.
    slouken committed May 4, 2020
    Configuration menu
    Copy the full SHA
    b050d66 View commit details
    Browse the repository at this point in the history
  5. Fixed bug 5121 - Use SDL_calloc instead of calloc in Wayland_CreateWi…

    …ndow
    
    meyraud705
    
    'SDL_Windows::driverdata' of a Wayland window is allocated by calloc in 'Wayland_CreateWindow' but freed by SDL_free in 'Wayland_DestroyWindow'.
    slouken committed May 4, 2020
    Configuration menu
    Copy the full SHA
    044699a View commit details
    Browse the repository at this point in the history
  6. locale: Implemented SDL_GetPreferredLocales().

    This was something I proposed a long time ago, Sylvain Becker did
    additional work on it, then back to me.
    
    Fixes Bugzilla #2131.
    icculus committed May 4, 2020
    Configuration menu
    Copy the full SHA
    483f803 View commit details
    Browse the repository at this point in the history

Commits on May 5, 2020

  1. stdlib: Fixed compiler warnings about int vs size_t.

    --HG--
    extra : rebase_source : d761f0279b8c2a7476a62664aba15ff12d741ca6
    icculus committed May 5, 2020
    Configuration menu
    Copy the full SHA
    b239a1d View commit details
    Browse the repository at this point in the history

Commits on May 6, 2020

  1. hid: Cleanup Windows joystick blacklist code, to make additions easier.

    --HG--
    extra : amend_source : 7a864d451f6bc11e948cabe2905fef21118fe0c9
    icculus committed May 6, 2020
    Configuration menu
    Copy the full SHA
    22e8a66 View commit details
    Browse the repository at this point in the history
  2. hid: Add Microsoft Precision Mouse to the joystick blacklist.

    Same deal as the Razer keyboards, it hangs the enumeration.
    icculus committed May 6, 2020
    Configuration menu
    Copy the full SHA
    fae6a64 View commit details
    Browse the repository at this point in the history
  3. ControllerList: add NACON Revolution Unlimited (and it's dongle) and …

    …NACON Daija fight stick.
    slouken committed May 6, 2020
    Configuration menu
    Copy the full SHA
    7bb7c48 View commit details
    Browse the repository at this point in the history
  4. ControllerList: add PDP Faceoff Deluxe Audio Switch Controller and HO…

    …RI Real Arcade Pro V Switch Edition
    slouken committed May 6, 2020
    Configuration menu
    Copy the full SHA
    1f33869 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5ea56b4 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2020

  1. Configuration menu
    Copy the full SHA
    285fdba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2dfaaa3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4ae1cbb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f0da7de View commit details
    Browse the repository at this point in the history

Commits on May 11, 2020

  1. Fixed bug 5103 - Port fcitx support to both fcitx 4 & 5

    wengxt
    
    Due to the new major fcitx version is coming close, the existing code need to be ported to use new Fcitx dbus interface.
    
    The new dbus interface is supported by both fcitx 4 and 5, and has a good side effect, which is that it will work with flatpak for free. Also the patch remove the dependency on fcitx header. Instead, it just hardcodes a few enum value in the code so need to handle the different header for fcitx4 or 5.
    slouken committed May 11, 2020
    Configuration menu
    Copy the full SHA
    d51766e View commit details
    Browse the repository at this point in the history
  2. Fixed bug 5098 - macOS CreateWindowFrom doesn't work with high-dpi di…

    …splays
    
    michaeljosephmaltese
    
    Display ends up taking only 1/4 of the screen area. It needs to call "setWantsBestResolutionOpenGLSurface:highdpi", like when creating a window the normal way.
    slouken committed May 11, 2020
    Configuration menu
    Copy the full SHA
    70187b1 View commit details
    Browse the repository at this point in the history

Commits on May 13, 2020

  1. emscripten: Fix crash in SDL_SetWindowTitle().

    This patch came from emscripten-ports, thanks!
    
    Fixes Bugzilla #5133.
    icculus committed May 13, 2020
    Configuration menu
    Copy the full SHA
    69ddb59 View commit details
    Browse the repository at this point in the history

Commits on May 15, 2020

  1. docs: Linux systems don't need to install wayland-protocols anymore.

    We ship the protocol xml files we need with SDL's sources now.
    icculus committed May 15, 2020
    Configuration menu
    Copy the full SHA
    03c1db3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    114fa3f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c5c3850 View commit details
    Browse the repository at this point in the history
  4. Fixed bug 5100 - compilation CMake Android armeabi-v7a (Thanks Steve …

    …Robinson!)
    
    fatal error: 'cpu-features.h' file not found on CMake Android armeabi-v7a
    1bsyl committed May 15, 2020
    Configuration menu
    Copy the full SHA
    2812131 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f1e51f7 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2020

  1. Fix issue with colorkey, palette and format conversion

    Set the colorkey information on the converted surface.
    Test-case in bug 3826/2979, conflicting with bug 4798
    1bsyl committed May 17, 2020
    Configuration menu
    Copy the full SHA
    d5360e5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3e7e51f View commit details
    Browse the repository at this point in the history

Commits on May 18, 2020

  1. emscripten-buildbot.sh: target WebAssembly instead of asm.js.

    Fixes Bugzilla #5132.
    
    --HG--
    extra : rebase_source : 482ad3c0eb7cac010aa5dc915895777fe6b141f4
    icculus committed May 18, 2020
    Configuration menu
    Copy the full SHA
    5a62990 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    61371ac View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dc4aa30 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2020

  1. Configuration menu
    Copy the full SHA
    8b322a5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    32e2974 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e65ab51 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    71b8f0e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    de89c9b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8a1cfd4 View commit details
    Browse the repository at this point in the history
  7. haiku: Patched to compile.

    icculus committed May 19, 2020
    Configuration menu
    Copy the full SHA
    6e73a73 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3c84d11 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    5fc645f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1186ff2 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    abb3fc4 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    57f8169 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    51dab0b View commit details
    Browse the repository at this point in the history
  14. configure: Not all compilers understand -idirafter, use -I instead.

    If this is a problem, we can write a test for the compiler flag, but shouldn't
    we _always_ use our Khronos headers instead of depending on the system...?
    icculus committed May 19, 2020
    Configuration menu
    Copy the full SHA
    2957c14 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    be6618f View commit details
    Browse the repository at this point in the history
  16. configure: Do a real check for -idirafter anyhow.

    (The CMake project cheats around this by asking "are we GCC or Clang?" and I'm
    inclined to leave it like that for now.)
    icculus committed May 19, 2020
    Configuration menu
    Copy the full SHA
    5f5cd26 View commit details
    Browse the repository at this point in the history
  17. configure: -idirafter needs a space, -I doesn't.

    Some compilers are apparently quite cranky about the -I not having a space!
    icculus committed May 19, 2020
    Configuration menu
    Copy the full SHA
    e1e7561 View commit details
    Browse the repository at this point in the history
  18. configure: Just don't do the -idirafter on QNX.

    The compiler understands it, but the "qcc" compiler driver doesn't, and the
    standard Khronos headers upset QNX anyhow, since they try to include X11
    headers in the __unix__ section.
    icculus committed May 19, 2020
    Configuration menu
    Copy the full SHA
    67dd8af View commit details
    Browse the repository at this point in the history

Commits on May 20, 2020

  1. Configuration menu
    Copy the full SHA
    1d31eb0 View commit details
    Browse the repository at this point in the history
  2. configure: fix fcitx tests.

    Otherwise Unix systems without D-Bus support will attempt to compile sources
    they can't handle.
    icculus committed May 20, 2020
    Configuration menu
    Copy the full SHA
    c003ee7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b62836d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    38d4244 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    693c2e7 View commit details
    Browse the repository at this point in the history
  6. hidapi: Fix compiler warning.

    icculus committed May 20, 2020
    Configuration menu
    Copy the full SHA
    a790889 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b18cf52 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    cfccc40 View commit details
    Browse the repository at this point in the history

Commits on May 21, 2020

  1. Configuration menu
    Copy the full SHA
    300683a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7a74e35 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    36ea254 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    587f7fc View commit details
    Browse the repository at this point in the history

Commits on May 22, 2020

  1. Configuration menu
    Copy the full SHA
    307655c View commit details
    Browse the repository at this point in the history

Commits on May 25, 2020

  1. Configuration menu
    Copy the full SHA
    7b1bc6a View commit details
    Browse the repository at this point in the history

Commits on May 26, 2020

  1. Make some changes to SDL_SetThreadPriority to try and have SDL transp…

    …arently handle more of the work.
    
    1. Comment that SDL_SetThreadPriority will make any necessary system changes when applying priority.
    2. Add a hint to override SDL's default behavior for scheduler policy.
    3. Modify the pthreads SDL_SetThreadPriority so that instead of just using the current thread scheduler policy it will change it to a policy that should work best for the requested priority.
    4. Add hint checks in SDL_SetThreadPriority so that rsn8887#3 can be overridden if desired.
    5. Modify the Linux SDL_SetThreadPriority so that in the case that policy, either by SDL defaults or from the hint, is a realtime policy it uses the realtime rtkit API.
    6. Prior to calling rtkit on Linux make the necessary thread state changes that rtkit requires.  Currently this is done every time as it isn't expected that SDL_SetThreadPriority will be called repeatedly for a thread.
    slouken committed May 26, 2020
    Configuration menu
    Copy the full SHA
    c501536 View commit details
    Browse the repository at this point in the history
  2. Include SDL_hint.h.

    slouken committed May 26, 2020
    Configuration menu
    Copy the full SHA
    5c02671 View commit details
    Browse the repository at this point in the history
  3. Include SDL_hints.h.

    slouken committed May 26, 2020
    Configuration menu
    Copy the full SHA
    4d0c34f View commit details
    Browse the repository at this point in the history
  4. Rename Linux-only variable.

    slouken committed May 26, 2020
    Configuration menu
    Copy the full SHA
    2a9d4f7 View commit details
    Browse the repository at this point in the history
  5. More Linux fixes.

    slouken committed May 26, 2020
    Configuration menu
    Copy the full SHA
    ec212af View commit details
    Browse the repository at this point in the history
  6. Getting closer.

    slouken committed May 26, 2020
    Configuration menu
    Copy the full SHA
    50ff857 View commit details
    Browse the repository at this point in the history
  7. Fixed iOS build

    slouken committed May 26, 2020
    Configuration menu
    Copy the full SHA
    90c00aa View commit details
    Browse the repository at this point in the history
  8. Fixed bug 5140 - KMSDRM: Dynamic vsync toggle does not work

    Manuel Alfayate Corchete
    
    The KMSDRM backend was doing things wrong because of some small (but important) misconceptions on how KMS/DRM works: to implement a largely broken non-vsync refresh mechanism, the SwapWindow() function was issuing new pageflips before previous ones had completed, thus causing EBUSY returns, buffer mismanagement, etc... resulting in general breakage on vsync disabling from apps, that would not allow vsync to work again without KMSDRM video re-initialization.
    To further clarify, on most DRM drivers async pageflips are NOT working nowadays, so all issued pageflips will complete on next VBLANK, NOT ASAP (calling drmModePageFlip() with the DRM_MODE_PAGE_FLIP_ASYNC flag will return error).
    
    The old code was assuming that can just issue a synchronous (=on VBLANK) pageflip and then pass a 0 timeout to the pull() function so we do not wait for the pageflip event, thinking that this will lead to correct non-vsynced screen updates from the program: That is plain wrong.
    Each pageflip has to be waite before issuing a new one, ALWAYS. And if we do not support ASYNC pageflips on the DRM driver level, then we are forced to wait for the next VBLANK. There is no way around it.
    
    I have also added many comments on the KMSDRM code. This is needed for future reference for me or others who may need to look at this code: KMS/DRM terminology regarding what SYNC and ASYNC mean in pageflip terms, and where to do certain things and why, is not trivial. It is not desirable or possible to invest time on researching the same concepts every time there is need to dive into this code. So please leave all these comments in the patch.
    slouken committed May 26, 2020
    Configuration menu
    Copy the full SHA
    6deb980 View commit details
    Browse the repository at this point in the history
  9. Fixed bug 5141 - KMSDRM: manage SDL_GetGlobalMouseState()

    Manuel Alfayate Corchete
    
    On the KMSDRM backend, there is no such thing as a desktop, yet some programs could (and DO) use SDL_GetGlobalMouseState().
    So I think its good idea that, in KMSDRM, it returns the same mouse coordinates anyway as SDL_GetMouseState() would return. There is nothing else it could return, as far as I can understand, since there is no desktop anyway.
    This small patch does precisely that.
    slouken committed May 26, 2020
    Configuration menu
    Copy the full SHA
    c3c77ca View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    64e95be View commit details
    Browse the repository at this point in the history
  11. cocoa: Change Caps Lock behavior to toggle instead of locking

    It currently behaves like a locking key which is pressed
    when Caps Lock is enabled and released when disabled. This
    means that apps that trigger events on Caps Lock key down will
    only fire these events every other time Caps Lock is pressed.
    cgutman committed May 26, 2020
    Configuration menu
    Copy the full SHA
    8d6ee6e View commit details
    Browse the repository at this point in the history

Commits on May 27, 2020

  1. Configuration menu
    Copy the full SHA
    9171f4a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a6c6c27 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4b924fe View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6ec495c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    18e8dbb View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    611dbfb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4d869dd View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    b29708d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7bcf671 View commit details
    Browse the repository at this point in the history

Commits on May 28, 2020

  1. wayland: assert that mmap() didn't return NULL.

    In practice, it never _would_, but in theory it _might_, so this assertion
    tells the static analyzer not to worry about it.
    icculus committed May 28, 2020
    Configuration menu
    Copy the full SHA
    a0030e7 View commit details
    Browse the repository at this point in the history
  2. wayland: Move buffer copy into mime_data_list_add()

    It makes it clearer who owns the memory, and more reasonable to free it on
    failure in the creating function.
    
    (and, of course, pacifies static analysis.)
    icculus committed May 28, 2020
    Configuration menu
    Copy the full SHA
    0474257 View commit details
    Browse the repository at this point in the history
  3. wayland: Changed output removal in handle_surface_leave()

    No longer needs an extra malloc, handles unexpected cases like the same
    output being listed twice.
    icculus committed May 28, 2020
    Configuration menu
    Copy the full SHA
    35374aa View commit details
    Browse the repository at this point in the history

Commits on May 29, 2020

  1. SDL_blit: Fix undefined bitshift operations

    Arithmatic operations promote Uint8 to signed int. If the top bit of a
    Uint8 is set, and it is left shifted 24 places, then the result is not
    representable in a signed 32 bit int. This would be undefined behaviour
    on systems where int is 32 bits.
    jlegg0 committed May 29, 2020
    Configuration menu
    Copy the full SHA
    7a4179c View commit details
    Browse the repository at this point in the history
  2. Fixed bug 5161 - Autodetect controller mappings based on the Linux Ga…

    …mepad Specification
    
    Jan Bujak
    
    I wrote a new driver for my gamepad on Linux. I'd like SDL to support it out-of-box, as currently it just treats it as a generic joystick instead of a gamepad. From what I can see the only way to do that is to either 1) pick one of the already supported controllers' PID, VID and button layouts and have my driver send that (effectively lying that it's something else), or 2) submit a preconfigured, hardcoded mapping to SDL.
    
    Both of those, in my opinion, are silly when we already have the Linux Gamepad Specification which standarizes this:
    
    https://www.kernel.org/doc/html/v4.15/input/gamepad.html
    
    Unfortunately SDL doesn't make use of it currently. So I've took it upon myself to add it; patch is in the attachments.
    
    Basically what the patch does is that if SDL finds no built-it controller mappings for a given joystick it then asks the joystick backend to autodetect it, and that uses the relevant evdev bits to figure out which button/axis is which. (See the specs for more details.)
    
    With this patch applied my own driver for my controller works out-of-box with SDL with no extra configuration and is correctly recognized as a gamepad; this is also going to be the case for any other driver which follows the Linux Gamepad Specification.
    slouken committed May 29, 2020
    Configuration menu
    Copy the full SHA
    550d1a0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1378c64 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b991942 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f8430b7 View commit details
    Browse the repository at this point in the history
  6. - Added exception handler for the new SecurityException in USBDevice …

    …getSerialNumber
    Sockmonsters committed May 29, 2020
    Configuration menu
    Copy the full SHA
    85c1d40 View commit details
    Browse the repository at this point in the history
  7. Don't bother logging security exception getting the device serial number

    This can happen anytime we haven't opened the device yet
    slouken committed May 29, 2020
    Configuration menu
    Copy the full SHA
    5cfcd98 View commit details
    Browse the repository at this point in the history
  8. Fixed bug 5146 - SDL_RenderFillRect doesn't work in DirectFB

    Lacky
    
    It looks like refactoring of SDL2 internal API has broken SDL_RenderFillRect for DirectFB. In new version function SDL_RenderFillRect returns 0, but rectangle is not visible.
    
    Replacing "count" with "len" in the argument list for SDL_memcpy in DirectFB_QueueFillRects fixes problem.
    slouken committed May 29, 2020
    Configuration menu
    Copy the full SHA
    30e46de View commit details
    Browse the repository at this point in the history
  9. Fixed bug 5145 - Fix whitespace in SDL_vulkan.h

    Colin Caine
    
    Everywhere else seems to use spaces.
    
    See patch diffed from a fresh hg checkout yesterday.
    slouken committed May 29, 2020
    Configuration menu
    Copy the full SHA
    bfaba1e View commit details
    Browse the repository at this point in the history
  10. Fixed bug 5105 - sndio support not working in dynamic mode (dlopen)

    Giovanni Bajo
    
    The CMake build system supports several audio frameworks for Linux: one of them is sndio.
    
    All frameworks can be built with "runtime linking" (that is, using dlopen to load the library at runtime). In sdlchecks.cmake, there's code to do the same with sndio:
    
    =================================================================
    # Requires:
    # - n/a
    # Optional:
    # - SNDIO_SHARED opt
    # - HAVE_DLOPEN opt
    macro(CheckSNDIO)
      if(SNDIO)
        # TODO: set include paths properly, so the sndio headers are found
        check_include_file(sndio.h HAVE_SNDIO_H)
        find_library(D_SNDIO_LIB sndio)
        if(HAVE_SNDIO_H AND D_SNDIO_LIB)
          set(HAVE_SNDIO TRUE)
          file(GLOB SNDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sndio/*.c)
          set(SOURCE_FILES ${SOURCE_FILES} ${SNDIO_SOURCES})
          set(SDL_AUDIO_DRIVER_SNDIO 1)
          if(SNDIO_SHARED)
            if(NOT HAVE_DLOPEN)
              message_warn("You must have SDL_LoadObject() support for dynamic sndio loading")
            else()
              FindLibraryAndSONAME("sndio")
              set(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "\"${SNDIO_LIB_SONAME}\"")
              set(HAVE_SNDIO_SHARED TRUE)
            endif()
          else()
            list(APPEND EXTRA_LIBS ${D_SNDIO_LIB})
          endif()
          set(HAVE_SDL_AUDIO TRUE)
        endif()
      endif()
    endmacro()
    =================================================================
    
    The feature is gated by an option called SNDIO_SHARED. It is also fully implemented in SDL_sndioaudio.c
    
    Unfortunately, it seems there is a missing line in CMakeLists.txt, so SNDIO_SHARED is not defined:
    
    ======================================================================
    set_option(ALSA                "Support the ALSA audio API" ${UNIX_SYS})
    dep_option(ALSA_SHARED         "Dynamically load ALSA audio support" ON "ALSA" OFF)
    set_option(JACK                "Support the JACK audio API" ${UNIX_SYS})
    dep_option(JACK_SHARED         "Dynamically load JACK audio support" ON "JACK" OFF)
    set_option(ESD                 "Support the Enlightened Sound Daemon" ${UNIX_SYS})
    dep_option(ESD_SHARED          "Dynamically load ESD audio support" ON "ESD" OFF)
    set_option(PULSEAUDIO          "Use PulseAudio" ${UNIX_SYS})
    dep_option(PULSEAUDIO_SHARED   "Dynamically load PulseAudio support" ON "PULSEAUDIO" OFF)
    set_option(ARTS                "Support the Analog Real Time Synthesizer" ${UNIX_SYS})
    dep_option(ARTS_SHARED         "Dynamically load aRts audio support" ON "ARTS" OFF)
    set_option(NAS                 "Support the NAS audio API" ${UNIX_SYS})
    set_option(NAS_SHARED          "Dynamically load NAS audio API" ${UNIX_SYS})
    set_option(SNDIO               "Support the sndio audio API" ${UNIX_SYS})
    set_option(FUSIONSOUND         "Use FusionSound audio driver" OFF)
    dep_option(FUSIONSOUND_SHARED  "Dynamically load fusionsound audio support" ON "FUSIONSOUND" OFF)
    ======================================================================
    
    You can see that all frameworks define a "dep_option" NAME_SHARED, and SNDIO is the only one where the option is missing.
    
    This means that runtime loading of sndio is never activated. If sndio is found at configuration time, it is always activated in "linked" mode, so that the final binary will have a load-time dependency with libsdnio. This is unfortunate.
    
    To fix the problem, it is sufficient to add this line:
    
    dep_option(SNDIO_SHARED        "Dynamically load the sndio audio API" ${UNIX_SYS} ON "SNDIO" OFF)
    
    I've verified that this fixes the bug, and sndio can now be dynamically loaded as expected.
    slouken committed May 29, 2020
    Configuration menu
    Copy the full SHA
    86c309a View commit details
    Browse the repository at this point in the history

Commits on May 30, 2020

  1. Fixed bug 5155 - HIDAPI_JoystickDisconnected incorrect array shift

    Anthony Pesch
    
    I was looking into my own input bug and noticed an issue in the HIDAPI code while looking over it. I don't have a controller that goes down this path to test and try to provoke the issue, but it looks pretty straight forward.
    
    The memmove to shift the joystick id array on disconnect isn't scaling the size by sizeof(SDL_JoystickID), likely corrupting the ids on disconnect.
    slouken committed May 30, 2020
    Configuration menu
    Copy the full SHA
    1fa548e View commit details
    Browse the repository at this point in the history
  2. Fixed bug 5113 - SDL_UpdateWindowSurfaceRects BitBlt the entire surfa…

    …ce on Win32
    
    Ryan C. Gordon
    
    As discussed here:
    https://discourse.libsdl.org/t/question-about-implementation-of-sdl-updatewindowsurfacerects/27561
    
    "As you can see this function [WIN_UpdateWindowFramebuffer, in src/video/windows/SDL_windowsframebuffer.c] calls BitBlt on entire screen, even though it accepts the rects. Rects variable is not even used in this function at all. Now my question is why is that the case?"
    slouken committed May 30, 2020
    Configuration menu
    Copy the full SHA
    d63b745 View commit details
    Browse the repository at this point in the history

Commits on Jun 2, 2020

  1. Fixed bug 5147 - KMSDRM: SetWindowFullscreen() failing with SDL_WINDO…

    …W_FULLSCREEN_DESKTOP
    
    Manuel Alfayate Corchete
    
    This patch is needed so programs that do this work as expected:
    1) Start in a different video mode than the mode used by the system and then...
    2) Try to go fullscreen with the mode originally used by the system via SetWindowFullScreen() with the SDL_WINDOW_FULLSCREEN_DESKTOP flag.
    
    An example would be pt2-clone in https://github.com/8bitbubsy/pt2-clone.
    This program does this:
    
    Starts with:
    
    video.window = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED,
        SDL_WINDOWPOS_CENTERED, screenW, screenH, windowFlags);
    
    
    and then, *IF* the user has configured it in fullscreen mode in its .ini, it tries to go fullscreen with the desktop mode:
    
    SDL_SetWindowFullscreen(video.window, SDL_WINDOW_FULLSCREEN_DESKTOP);
    
    
    This sequence of operations is currently failing because SDL_SetDisplayModeForDisplay() in SDL_video.c fails because display->desktop_mode is not being initialized with its correct value: SetDisplayMode() in SDL_kmsdrmvideo.c will not be able to set the mode because it detects the mode to have a driverdata of 0x0 ("if (!modedata)") and rightfully returns an error.
    
    So, the included patch fixes this small problem, and programs that first change the video mode and then try to go fullscreen with the system video mode will now work.
    The patch simply fixes an small omission, but its really needed now that dynamic video mode changing was implemented on the KMSDRM backend.
    slouken committed Jun 2, 2020
    Configuration menu
    Copy the full SHA
    68d5560 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3384f7b View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2020

  1. Fixed bug 5167 - Memory leak in GuessXInputDevice

    meyraud705
    
    Variable 'devices' is not freed if function GuessXInputDevice, in SDL_xinputjoystick.c, return early.
    slouken committed Jun 3, 2020
    Configuration menu
    Copy the full SHA
    2e255d5 View commit details
    Browse the repository at this point in the history
  2. Fixed bug 5168 - Memory leak in RAWINPUT_JoystickOpen

    meyraud705
    
    Variable 'hwdata' is not freed in RAWINPUT_JoystickOpen if device->driver->OpenJoystick() fails.
    slouken committed Jun 3, 2020
    Configuration menu
    Copy the full SHA
    8168f31 View commit details
    Browse the repository at this point in the history
  3. video: Set window->surface NULL after freeing it.

    Otherwise, when SDL_CreateWindowFramebuffer() is called again, it will return
    the free'd surface instead of creating a new one.
    
    --HG--
    extra : rebase_source : 83e1f3f0b41d39ac1e344dd0550212e8ce75a66f
    icculus committed Jun 3, 2020
    Configuration menu
    Copy the full SHA
    b7252b8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    63629dd View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8f15e12 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5cd4900 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2020

  1. Configuration menu
    Copy the full SHA
    72ab2c1 View commit details
    Browse the repository at this point in the history
  2. Fixed build warning

    slouken committed Jun 4, 2020
    Configuration menu
    Copy the full SHA
    9637b2f View commit details
    Browse the repository at this point in the history
  3. Fixed bug 5169 - Can not build current sources because of recent thre…

    …ad management changes
    
    Manuel Alfayate Corchete
    
    I'm trying to build SDL2 with threads support here in GNU/Linux, both X86 and ARM, and it does not seem to be possible ATM:
    
    
    /home/manuel/src/SDLLLL/src/core/linux/SDL_threadprio.c:233:26: error: 'rtkit_max_realtime_priority' undeclared (first use in this function)
    slouken committed Jun 4, 2020
    Configuration menu
    Copy the full SHA
    96f1313 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a042a85 View commit details
    Browse the repository at this point in the history
  5. Fixed exception if getManifestEnvironmentVariables() is called withou…

    …t a current SDL activity
    slouken committed Jun 4, 2020
    Configuration menu
    Copy the full SHA
    4c1c6d0 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2020

  1. Initial Vita port

    xerpi authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    22d12ed View commit details
    Browse the repository at this point in the history
  2. Vita: Update ar arguments

    xerpi authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    b51a5db View commit details
    Browse the repository at this point in the history
  3. Vita: Update port

    xerpi authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    0c23afd View commit details
    Browse the repository at this point in the history
  4. VITA: Update Makefile

    xerpi authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    56565f3 View commit details
    Browse the repository at this point in the history
  5. added types.h

    ooPo authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    73885e4 View commit details
    Browse the repository at this point in the history
  6. fix VITA_RenderPresent

    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    5abdec7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2a81606 View commit details
    Browse the repository at this point in the history
  8. enable joystick axis (analog)

    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    9465fbd View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    4c9c181 View commit details
    Browse the repository at this point in the history
  10. fix VITA_RenderCopy scaling

    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    11cb0c5 View commit details
    Browse the repository at this point in the history
  11. fix SDL_SemValue

    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    ae1a4ad View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    8edf0c6 View commit details
    Browse the repository at this point in the history
  13. fix merge

    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    ba0d8f4 View commit details
    Browse the repository at this point in the history
  14. PSP2: fix vitaaudio

    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    876b1bd View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    15ab332 View commit details
    Browse the repository at this point in the history
  16. PSP2: fix for latest vitasdk

    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    4403843 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    fe8b179 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    cf01ea9 View commit details
    Browse the repository at this point in the history
  19. VITA: Link SDL_dataqueue.o (xerpi)

    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    34d6bf7 View commit details
    Browse the repository at this point in the history
  20. VITA: proper defines

    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    f4e0c0a View commit details
    Browse the repository at this point in the history
  21. VITA: enable arm asm optimisations

    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    0fc3da3 View commit details
    Browse the repository at this point in the history
  22. VITA: fix optimisation flags

    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    d48f547 View commit details
    Browse the repository at this point in the history
  23. VITA: disable VITA_UnlockTexture, this is redundant as we directly wr…

    …ite to vita2d texture data with VITA_LockTexture
    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    7418062 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    cd28557 View commit details
    Browse the repository at this point in the history
  25. VITA: add software opengl

    Add software opengl implementation via osmesa port (https://github.com/Cpasjuste/osmesa-samples-psp2). This give basic SDL2/GL support. GL renderer is still disabled (should be easy to enable, just needs some testing). A common usage would use "SDL_CreateWindow(SDL_WINDOW_OPENGL)", "SDL_GL_CreateContext" and "SDL_GL_SwapWindow". Multiple GL context not supported yet (not handled).
    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    3589460 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    5c16360 View commit details
    Browse the repository at this point in the history
  27. VITA: fix missing video files

    Cpasjuste authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    259cf2b View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    36c8aa8 View commit details
    Browse the repository at this point in the history
  29. VITA: Add touch screen support

    angguss authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    f507262 View commit details
    Browse the repository at this point in the history
  30. VITA: Cleanup unused variables

    angguss authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    1effd5b View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    a3dfcca View commit details
    Browse the repository at this point in the history
  32. vita: fix merge

    rsn8887 authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    2393e4e View commit details
    Browse the repository at this point in the history
  33. Vita: fix merge

    rsn8887 authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    22c8444 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    c837f73 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    8cd3670 View commit details
    Browse the repository at this point in the history
  36. VITA: support Game Controller API

    rsn8887 authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    aa3115f View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    d21f64c View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    b4e1a0f View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    81a41a5 View commit details
    Browse the repository at this point in the history
  40. VITA: fix repeated BT keyboard events

    rsn8887 authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    a02069c View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    544a1f5 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    4aedbd6 View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    37bf7b6 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    dd47a08 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    5778b0d View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    d1fee65 View commit details
    Browse the repository at this point in the history
  47. vita: fix merge

    rsn8887 authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    690a00c View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    13d86ea View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    8bdbecd View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    0a5a51c View commit details
    Browse the repository at this point in the history
  51. Calling wait_rendering_done before freeing stuffs. (rsn8887#4)

    Solves a crash in OpenClaw.
    Rinnegatamante authored and sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    6520572 View commit details
    Browse the repository at this point in the history
  52. Configuration menu
    Copy the full SHA
    77c6f5e View commit details
    Browse the repository at this point in the history
  53. Configuration menu
    Copy the full SHA
    c6281eb View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    f3d23a4 View commit details
    Browse the repository at this point in the history
  55. Configuration menu
    Copy the full SHA
    fe5adc4 View commit details
    Browse the repository at this point in the history
  56. Fix crash creating texture

    sergiou87 committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    8cad3a7 View commit details
    Browse the repository at this point in the history
  57. Configuration menu
    Copy the full SHA
    726296f View commit details
    Browse the repository at this point in the history