Commit Graph

13488 Commits

Author SHA1 Message Date
Sam Lantinga
fa2a726cc3 Added SDL_CreateSurfaceUninitialized()
Currently this is an internal API, but we can expose it in the future.
2026-06-05 09:14:07 -07:00
Nintorch
2fd15d9e0d Add mappings for NES Switch controllers on Linux 2026-06-05 08:56:15 -07:00
Zizin13
7341f04a12 Fix DirectInput POV handling for devices with extra hats 2026-06-04 12:23:33 -07:00
Thad House
0c8feecce6 Enable extra player LED sets for PS5 Controllers 2026-06-04 08:05:29 -07:00
Sylvain Becker
fc3a96e47a Android: remove pollInputDevice() in favor of InputDeviceListener (#15659) 2026-06-03 20:38:04 -07:00
Sam Lantinga
64def01534 Fixed some Wayland cursor related thread-safety warnings 2026-06-02 16:51:58 -07:00
Sam Lantinga
90756b542f Fixed some log related thread-safety warnings 2026-06-02 16:51:58 -07:00
Sam Lantinga
f9d49358d2 Create a global event lock for hardware that generates events
This prevents ABBA deadlocks caused by taking a hardware resource lock then delivering events at the same time another thread is taking a hardware resource lock from an event watch callback.

Fixes https://github.com/libsdl-org/SDL/issues/15709
2026-06-02 16:51:58 -07:00
Ryan C. Gordon
dc34abc03e pipewire: Add SDL_HINT_AUDIO_DEVICE_STREAM_NAME callback earlier.
Otherwise, it might cause a deadlock, if the output_callback runs in another
thread while the guaranteed initial hint callback fires. One will wait for the
SDL device lock, the other the pipewire thread loop lock, each already holding
what the other needs.

This way, the hint callback fires and we ignore it, since the stream isn't
set up yet...which is good, because we're about to create the stream and set
that exact same state on it directly anyhow. Now there's no chance of this
deadlock happening.

Reference Issue #15075.
2026-06-02 19:04:28 -04:00
Sam Lantinga
cadd67007c Removed k_eControllerType_AndroidController and k_eControllerType_AppleController 2026-06-01 17:55:54 -07:00
Nintorch
96c03dc66e Fix web joystick vibration (again) 2026-05-31 14:13:07 -07:00
Nintorch
e0eb40f65f Fix web joystick vibration on Safari 2026-05-31 08:04:45 -07:00
Cameron Gutman
189877b1d3 joystick: Fix conflicting rumble and LED on Sony PS4 gamepads 2026-05-30 17:20:52 -07:00
Vicki Pfau
687a59f277 joystick: Fix underflow with 0 delta timestamp
Some sensors will occasionally report two identical timestamps in a row.
This leads to the timestamp wrapping calculation to underflow, subtracting
0x80000000 from the timestamp whenever it happens. By adjusting the wrap
test, we can just directly add zero to the timestamp, fixing the underflow.
2026-05-29 21:47:50 -07:00
replicacoil
c43ab978fd Added rumble to Gamecube Adapter PC_Mode (#15431) 2026-05-29 17:28:47 -07:00
Sam Lantinga
2b0df96f25 Send SDL_EVENT_WINDOW_EXPOSED when the GPU renderer swap chain is resized
In this case the current frame being rendered doesn't match the swapchain size and the application should re-render the frame.

Fixes https://github.com/libsdl-org/SDL/issues/15550
2026-05-29 14:37:32 -07:00
Sam Lantinga
e04bfb4c6e render: an empty clip rect should clip all drawing
Added a test to validate this and fixed the Metal renderer

Fixes https://github.com/libsdl-org/SDL/issues/15434
2026-05-29 13:58:34 -07:00
NY00123
ed2c8036a7 Android: Remove unused accelerometer-related code and definitions
That also covers removal of the call `SDLActivity.onNativeAccel`,
plus a change of comment under SDL_android.c.

Definitions were previously used while an accelerometer could be listed as a joystick.
2026-05-29 13:14:09 -07:00
Sam Lantinga
8a701808a6 Fixed Steam Controller not detected on macOS under Steam 2026-05-29 12:07:16 -07:00
Sam Lantinga
ec0066aa0b Fixed detecting the Steam virtual gamepad when HIDAPI is disabled 2026-05-29 10:55:57 -07:00
Sam Lantinga
ed6e03436e Added HIDAPI support for the PDP Afterglow Wave Wireless Controller for Switch 2026-05-29 09:56:15 -07:00
Sam Lantinga
634dff3725 Added DEBUG_STEAM_PROTOCOL for the new Steam Controller 2026-05-28 19:51:34 -07:00
Sam Lantinga
113e97e193 metal: fixed reading textures with format SDL_PIXELFORMAT_RGBA128_FLOAT 2026-05-28 11:50:03 -07:00
Sam Lantinga
f6ffa69890 Add support for new Steam Controller input report on mobile devices 2026-05-28 11:39:58 -07:00
Sam Lantinga
bb3c61390a Fix mistyped output report message for Steam Controller
This caused hiccups in BlueZ BT driver for Linux
2026-05-27 18:20:17 -07:00
Sam Lantinga
f7a8801227 Add support for new Steam Controller input report 2026-05-27 18:19:43 -07:00
Rachel Blackman
a7ecd5f777 OpenVR: Actually quit correctly if we get a close/quit message. 2026-05-27 17:40:30 -07:00
Sam Lantinga
76560f9e47 Revert "android: fixed a possible joystick-related deadlock on application termination"
This reverts commit 6b4ae68460.

It turns out this deadlock is possible for any joystick event delivery combined with an event watcher that locks joysticks. I'm reverting this change for now, and will be working on a better global solution for this problem.
2026-05-27 13:07:46 -07:00
Ryan C. Gordon
d7ba3efe6b filesystem: Implement SDL_GetExeName() for all platforms. 2026-05-27 15:41:51 -04:00
Ryan C. Gordon
6b780c5ff9 gdk: Just use WIN_GetModulePath().
There's no need to use the "A" version of GetModuleFileName on GDK; it returns
a UTF-8 string directly on this platform, but we can still use the UTF-16 "W"
version and cut down on code duplication.

This code runs once and caches the results, so we can take the one-time string
conversion overhead.
2026-05-27 15:22:10 -04:00
Frank Praznik
6a3b0413dc x11: Fix boolean/enum comparison
This could set the pending flag even if there was no state change requested, which would cause errant sync timeouts in certain situations.
2026-05-27 12:15:21 -04:00
Ryan C. Gordon
22fb9edd5c x11: SetupWindowData shouldn't add to videodata->windowlist until success.
Fixes #15676.
2026-05-27 11:43:57 -04:00
zanadoman
d7b1255484 GPU: Return early in SDL_WaitForGPUFences if num_fences is 0 2026-05-27 08:24:34 -07:00
Ryan C. Gordon
59a302e601 xr: Add fallback for SDL_PROP_GPU_DEVICE_CREATE_XR_APPLICATION_NAME_STRING.
It'll use SDL_GetAppMetadataProperty(SDL_PROP_APP_METADATA_NAME_STRING) if
necessary now.
2026-05-26 20:27:22 -04:00
Ryan C. Gordon
a49ba90257 metadata: SDL_GetAppMetadataProperty() now uses SDL_GetExeName().
(for SDL_PROP_APP_METADATA_NAME_STRING if unset. If SDL_GetExeName() returns
NULL, it'll fallback to good ol' "SDL Application", as usual.)

Fixes #15692.
2026-05-26 20:27:22 -04:00
Ryan C. Gordon
7d29ce8e31 filesystem: Added SDL_GetExeName().
core/unix had a more-limited copy of filesystem/unix's implementation, called
SDL_GetExeName(). Replace that with a real implementation in filesystem, and
allow each platform to implement it as appropriate.

Implemented for Unix and Windows; most implementations are currently FIXME
stubs at the moment.

Reference Issue #15692.
2026-05-26 20:27:22 -04:00
Frank Praznik
cd0b796a6e video: Only ignore modes with a lower color depth in SDL_GetClosestFullscreenDisplayMode()
If a mode with a closer refresh was found, but it had the same color depth as the current best match, it was being dropped. Only ignore the new mode if the color depth is below the current best match.
2026-05-26 18:27:25 -04:00
Sam Lantinga
a84dafd5b9 Don't use the HIDAPI driver with Backbone One PlayStation Edition Gen 2
This product doesn't appear to use the DualSense protocol. On Android this shows up as two interfaces that don't send reports that we can parse.
2026-05-26 14:15:43 -07:00
Ryan C. Gordon
6249bac891 dos: Use INT 0x21, operation 0x62 to calculate basepath.
Previously this captured argv[0] and pushed it through searchpath(). It's
probably better to go right to the source to find this info, though.
2026-05-26 14:28:58 -04:00
Gabriel Wang
f2dba2626e SVE2: Improves SVE2 8888 swizzling performance and important fixes (#15662)
* SVE2 was actually disabled in fdfbbce, this issue is fixed
  - The macro __ARM_FEATURE_SVE  is only defined when the compilation target is set as -march=armv8-m+sve2
* Improves 8888 alpha-blending performance
  - Now, in In-Order AArch64 processors, e.g. A520, SVE2 is better than NEON with the 128bit vector width
  - For Out-of-order processors, NEON is still better than SVE2 (We could improve this in the future), the performance is improved from 3.0 to 3.6.
* The 8888 -> RGB565 performance is also improved (from 7.4 to 9.3)
2026-05-26 07:57:44 -07:00
Ozkan Sezer
15dca0766f add GLES headers from Khronos. 2026-05-26 16:56:12 +03:00
Sylvain Becker
d4236dcd85 opengles: Readd an OpenGL ES 1 renderer to SDL3! (#15185)
This readds the "opengles" renderer, updated from SDL2 to work on SDL3.

Fixes #15661.

Co-authored-by: Ryan C. Gordon <icculus@icculus.org>
Co-authored-by: Cameron Cawley <ccawley2011@gmail.com>
2026-05-25 20:41:13 -04:00
Anonymous Maarten
dcf063178c Use pragma to ignore deprecated integer-to-ascii CRT conversion functions 2026-05-25 17:26:09 +02:00
Anonymous Maarten
08e338f45c _uitoa does not exist 2026-05-25 17:26:09 +02:00
Anonymous Maarten
55388abb34 Revert "SDL_itoa(): use _itoa_s(), not _ltoa_s()"
This reverts commit ae07e32269.
This reverts commit 33c9f1a70a.
2026-05-25 17:26:09 +02:00
Ozkan Sezer
29f7f08261 pdate openxr headers from khronos. 2026-05-24 18:40:50 +03:00
Cameron Cawley
f162c49dc1 Use SDL_PIXELFORMAT_INDEX8 for the debug font atlas 2026-05-24 08:00:21 -07:00
Ozkan Sezer
ae07e32269 SDL_itoa(): use _itoa_s(), not _ltoa_s()
typo introduced by commit 33c9f1a70a
2026-05-23 20:11:10 +03:00
Frank Praznik
0a96d47599 wayland: Remove focus references when a pointer capture ends on a subsurface
The core mouse code will unfocus the window when a capture ends outside the window boundaries, but the backend still needs to update the internal focus references.
2026-05-23 12:20:30 -04:00
0xDEADCADE
3626598675 Remove CenterPad and RightStick from Steam Controller (2015) internal state struct
These values are never used for the Steam Controller (2015), as it does not physically have these inputs.
2026-05-23 07:51:03 -07:00