Commit Graph

21577 Commits

Author SHA1 Message Date
Ryan C. Gordon 9f19cffc78 io: With stdio, only forbid opening directories as files.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
This allows opening Unix device nodes, etc.

Fixes #15188.
2026-03-12 12:41:34 -04:00
Ryan C. Gordon 4d675f2bd3 io: Wrap IsRegularFileOrPipe in a more generic preprocessor test.
This way we can turn it off for various console platforms without changes
to this file.
2026-03-12 12:41:34 -04:00
Ryan C. Gordon 803cd7589a io: Remove iodata->regular_file check.
It wasn't used, and causes an extra fstat().
2026-03-12 12:41:34 -04:00
Sam Lantinga 11adfd2008 Disable system gesture state for all GCControllers
Technically we only want to do this for controllers that are opened, but we don't have a way to match up controllers using other APIs with individual GCControllers.
2026-03-12 08:34:34 -07:00
Sam Lantinga b80b466423 Removed redundant ifdef 2026-03-12 08:29:47 -07:00
Frank Praznik 18219d5b53 wayland: Prevent the window from errantly growing when scale to display is used
Some compositors will send a configure event immediately after a scale event, however, this event can contain the old logical size, and should be ignored, or the window will incorrectly change size when moved between displays with differing scale factors.

Store the last requested logical size as the last configure size when resizing a floating window due to a scale change, so a configure event immediately following with the old size will be ignored.
2026-03-12 10:19:22 -04:00
WillyJL c45be94938 Fix strpbrk() discarded const qualifier
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-03-10 14:25:28 -07:00
Evan Hemsley b4b9a037b6 GPU: Refcount Vulkan allocations to fix transfer corruption on defrag (#15127)
Merging, this can be cherry-picked as well.
2026-03-10 13:33:07 -07:00
Nintorch 419dcfe747 Fallback for non-gamepad controllers in GameInput
This PR makes the GameInput joystick backend ignore non-gamepad controllers if DirectInput or XInput backends are enabled. This is done to prevent possible bugs and/or regressions.
2026-03-10 11:06:10 -07:00
SDL Wiki Bot d20c7e537d Sync SDL3 wiki -> header
[ci skip]
2026-03-10 12:43:12 +00:00
SDL Wiki Bot 6ccf3d097e Sync SDL3 wiki -> header
[ci skip]
2026-03-09 20:14:48 +00:00
Nintorch 0138843eb7 Small GameInput joystick backend improvements
This PR includes small improvements to the GameInput joystick backend:
- Device subtypes
- Compatibility with DirectInput joystick mappings (if the controller is not a gamepad, i.e. `GAMEINPUT_InternalIsGamepad()` returns `false`)
- Fallback to DirectInput/XInput for currently unsupported devices (force feedback ones and the ones that are neither gamepads nor controllers, I'm not sure if that's possible, but maybe racing wheels and other device subtypes would count?)
2026-03-09 11:12:00 -07:00
Sam Lantinga 25b62f01ed Don't load libopenxr_loader.so
We are locked to version 1 of the ABI, so don't load what might be a symlink to a newer and incompatible version.

Platforms like OpenBSD that only have .so versions of libraries can add a special case here like Android in the future.

Fixes https://github.com/libsdl-org/SDL/issues/15172
2026-03-09 09:59:02 -07:00
Sanjay Govind 101273f429 extract capabilities for 360 controllers over libusb (#15183)
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Read capabilities when using xinput controllers via the libusb backend

This gives us access to the subtype on linux and macOS, and gives us a lot of data we can use for handling more detailed device types when I look into a unified api for exposing instrument data later.
2026-03-08 17:29:56 -07:00
SDL Wiki Bot 466ab45722 Sync SDL3 wiki -> header
[ci skip]
2026-03-08 23:13:12 +00:00
Mike Egger ae3ae4ba44 windows: support flag RIDEV_INPUTSINK in raw input (#15182) 2026-03-08 16:11:33 -07:00
Ozkan Sezer 31aa18fc1d stb_image: Fix -Wdouble-promotion warning
Upstream PR 1902 by Björn Wahlstrand at https://github.com/nothings/stb
2026-03-09 00:39:50 +03:00
Sanjay Govind e610b85d1c support batteries on 3rd party controllers
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-03-08 11:40:35 -07:00
Sanjay Govind 94f17d6c61 Add support for whammy and tilt on PS4/5 guitars
PS4/5 controllers put device specific data into a specific region in the report, so we have to extract it separately.

No known guitars use the right stick on the guitar, so to keep things working similarly to PS3, i have opted to map whammy and tilt the same way as the PS3 rb guitars.
2026-03-08 11:35:57 -07:00
SDL Wiki Bot b3f4ebad28 Sync SDL3 wiki -> header
[ci skip]
2026-03-08 14:38:51 +00:00
Petar Popovic 67ac0e5eee SDL_InternalGlobDirectory(): set string length of base directory to 1, if it's just one slash
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-03-07 12:43:56 -05:00
Petar Popovic 93e3e8a5fe SDL_InternalGlobDirectory(): keep track of pathlen and reuse it, instead of calling SDL_strlen(path) 2026-03-07 12:43:56 -05:00
Petar Popovic 961a04fa26 SDL_GlobDirectory(): Don't chop off first slash from path, if it's just multiple slashes 2026-03-07 12:43:56 -05:00
SDL Wiki Bot d0a7290689 Sync SDL3 wiki -> header
[ci skip]
2026-03-07 16:20:37 +00:00
Caleb Cornett 12a435e11d gdk: Update Suspend/Resume best practices.
Updated testgdk to demonstrate correct handling of suspend/resume and the new Render APIs, and updated the docs to explain the correct usage of these GDK functions.
2026-03-07 11:19:09 -05:00
Ethan Lee ee5c5cf755 render: Add Suspend/Resume calls for GDK support 2026-03-07 11:19:09 -05:00
Ethan Lee 0c57e99b4a gpu: Fix swapchain texture cycling.
This is actually a 1:1 copy of a patch we wrote for GPU PS5 some time ago!
2026-03-07 10:36:19 -05:00
Ozkan Sezer 6a87abb5b4 undo damage from wiki-commit 4e4493f579
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-03-07 10:05:02 +03:00
Frank Praznik 89393c5519 wayland: Use the built-in names of interfaces to enable protocols
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-03-06 13:29:32 -05:00
Frank Praznik 7605f192d5 wayland: Remove Wayland interface definitions
These are relics from very long ago, before the Wayland protocols lived in-tree and the headers and sources were generated at configure time.
2026-03-06 13:29:32 -05:00
SDL Wiki Bot 4e4493f579 Sync SDL3 wiki -> header
[ci skip]
2026-03-06 18:08:12 +00:00
Ethan Lee c20a058ff4 Revert "render: Added Xbox DXIL for gpu backend".
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Turns out Xbox is okay with the PC DXIL, it just isn't as optimal without the root signature annotations.

This reverts commit f2c4c66429.
2026-03-04 15:52:07 -05:00
ImpDi 89cab56536 Texture2DArray and Compute Pipeline in DirectX12 (#15161)
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Apparently, because PlaneSlice wasn't initialized, we couldn't use SDL_GPU_TEXTURETYPE_2D_ARRAY and SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE together, as the error d3d12:
"ID3D12Device::CreateUnorderedAccessView occurred: The PlaneSlice -858993460 is invalid when the resource format is R8G8B8A8_UNORM and the view format is R8G8B8A8_UNORM. Only Plane Slice 0 is valid when creating a view on a non-planar format. [ STATE_CREATION ERROR #344: CREATEUNORDEREDACCESSVIEW_INVALIDPLANESLICE]"
2026-03-03 19:19:45 -08:00
Tobiasz Laskowski 01bd8b3780 Fix backspace on android with api 30+ 2026-03-03 17:12:01 -08:00
Frank Praznik e7199cad0b Deprecate SDL_INIT_EVERYTHING from SDL2
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Adds SDL_INIT_EVERYTHING to the deprecated symbol list, and renames an internal usage to avoid a warning.
2026-03-03 14:00:40 -05:00
BurstRange d3672b0c3a Fixed typo to "pseudo" 2026-03-03 13:31:13 -05:00
Frank Praznik 5880b8a283 Log failure reasons during early X11 and Wayland initialization
Log the reason for failure during initialization to the debug log to aid in troubleshooting.
2026-03-03 13:29:57 -05:00
SDL Wiki Bot 75c9b082ef Sync SDL3 wiki -> header
[ci skip]
2026-03-03 13:55:57 +00:00
Frank Praznik 8c8efd4ccd wayland: Don't add keys with the super/GUI modifier to the keymap
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
SDL normalizes the super/GUI modifier away, so adding a key with this modifier will overwrite the base, unmodified value.
2026-03-02 18:29:23 -05:00
Void Star Caster 2e3300e872 Functions to bind GPURenderState storage textures, buffers and sampler bindings (#15150) 2026-03-02 12:50:58 -08:00
Qiu Qiang e2a2e2c31e camera: Fix crash when setting frame rate and improve FPS precision
- Use exact numerator/denominator from spec for CMTime to avoid rounding errors.
- Wrap frame rate setting in @try-catch to prevent crashes on strict drivers.
2026-03-02 11:59:17 -08:00
MSRPP-dev 4dbf5811e9 Update SDL_render_sw.c
Fix the bug in the standard scaling path, SDL_RENDERCMD_COPY should follow the same pattern as SW_RenderCopyEx.
2026-03-02 09:49:46 -08:00
Sanjay Govind 34378609bb fix off by one with tilt on ps3 guitars (#15144) 2026-03-02 09:45:44 -08:00
Antonio Lattanzio 4c52cfb495 oldnames: Add missing deprecated SDL2 symbol mappings (#15137) 2026-03-02 09:44:36 -08:00
Sam Lantinga 73b13728de Added surface validation to SDL_DuplicateSurface() 2026-03-02 09:40:53 -08:00
Ethan Lee f2c4c66429 render: Added Xbox DXIL for gpu backend
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-03-01 19:09:55 -05:00
Petar Popovic 77f4a8e2b8 Fix potential memory leak in VULKAN_AcquireCommandBuffer() on error 2026-03-01 14:10:54 -08:00
Petar Popovic fb1d1ab306 Fix memory leak when X11 toolkit window locale SDL_strdup() fails 2026-03-01 11:44:43 -08:00
Sam Lantinga 72d5fe213f Loading PNG files are part of the core SDL library
Don't disable this functionality when defining SDL_LEAN_AND_MEAN, but if you need to, you can define SDL_DISABLE_STB if you want to compile this out.

Fixes https://github.com/libsdl-org/SDL/issues/15139
2026-03-01 11:42:28 -08:00
Petar Popovic 6cf03ca729 Fix potential memory leak in SDL_HIDAPI_HapticOpenFromJoystick() on error 2026-03-01 11:35:58 -08:00