Commit Graph

12991 Commits

Author SHA1 Message Date
zuiki_inn
6d93ffe923 Add ZUIKI EVOTOP controller support with gyroscope and accelerometer sensor capabilities. (#15034)
(cherry picked from commit 29ca920fdf)
2026-02-25 20:24:50 -08:00
rabbit-ecl
2fad85fa26 Use Uint64 instead for tick_numerators in USE_128BIT_MATH
(cherry picked from commit 230814e85e)
2026-02-25 20:19:30 -08:00
Sam Lantinga
b0414440a3 Fixed timer overflow on some platforms
We have an implementation that uses 128-bit math and one that handles large values without it (thanks @jessechounard and @rabbit-ecl!)

Fixes https://github.com/libsdl-org/SDL/issues/15042

(cherry picked from commit 24404d9047)
2026-02-25 11:43:08 -08:00
Ethan Lee
d5b90fd82f render: Reduce scope of D3D12 GDK event watcher to Xbox
(cherry picked from commit a4cd62ef93)
2026-02-25 07:40:51 -08:00
Ethan Lee
b488c2e4a0 gdk: Render/GPU can call SuspendX, document when to call SuspendComplete
(cherry picked from commit 5770e013c2)
2026-02-25 07:40:51 -08:00
Sam Lantinga
aa9de89232 Added battery status for newer FlyDigi controllers
(cherry picked from commit 49a8b4229b)
2026-02-24 20:50:11 -08:00
Sanjay Govind
645b8e7f6d Support accelerometers on 3rd party ps3 controllers (#15109)
(cherry picked from commit 0c859452ef)
2026-02-24 19:00:11 -08:00
Sanjay Govind
17532fd62e Set joystick_type for known ps3/wii instruments (#15111)
(cherry picked from commit a7ccd48957)
2026-02-24 17:30:07 -08:00
Sanjay Govind
2214522b69 deal with controllers that don't have report ids
(cherry picked from commit 1419bcb6cb)
2026-02-24 15:19:49 -08:00
Frank Praznik
c608ce5acb x11: Also send key releases when reconciling state
(cherry picked from commit 2f38b6a396)
2026-02-24 17:13:04 -05:00
Sanjay Govind
b3adee0720 Fix up controller types for various playstation and wii instruments (#15104)
(cherry picked from commit 0e4008441f)
2026-02-24 13:36:08 -08:00
Sam Lantinga
00c85a0b9e Added support for the Flydigi Vader 5 Pro in Xbox 360 mode
(cherry picked from commit 2385dc6297)
2026-02-24 10:20:29 -08:00
Brenton Bostick
77edb4d5d3 fix unknown argument nBufSize
(cherry picked from commit c259f969f2)
2026-02-24 09:50:34 -08:00
Brenton Bostick
62aea530b4 fix JNI parameter types
(cherry picked from commit 0d0db08b61)
2026-02-24 09:49:57 -08:00
Brenton Bostick
abab2f1181 make sure #endif comment matches the macro name
(cherry picked from commit a5889b0e44)
2026-02-24 09:49:08 -08:00
Void Star Caster
01d8bb5b7c Fix GetSampler() bug for INDEX8 pixel format (#15099)
(cherry picked from commit 4a4ae4a79d)
2026-02-24 08:06:44 -08:00
Vicki Pfau
27439467ce camera: Don't try to fake entire range for FRMIVAL_TYPE_CONTINUOUS
V4L2 is able to advertise that a video device is able to display any frame
interval within a continuous range. SDL does not allow advertising this and
only exposes discrete frame intervals. To work around this, SDL attempted to
generate a subset of the range with a fixed interval. Unfortunately, the way
this was accomplish is inherently broken and led to attempting to allocate a
very large number of formats per resolution and colorspace. With the Magewell
Pro Capture HDMI, which can expose FRMSIZE_TYPE_CONTINUOUS as well, this can
expose a truly astronomical number of formats, exceeding 1 PB of RAM. This will
lead to an OOM kill for any process that tries to initialize the camera
subsystem.

This patch just tests to see if some common frame rates are within the
contiuous range and expose those. SDL still does not handle
FRMSIZE_TYPE_CONTINUOUS in a graceful way so it still uses over a gigabyte of
RAM for each possible combination of sizes, but with this patch it no longer
leads to an OOM kill. The API will need amending for proper support for both
continuous frame sizes and frame intervals.

(cherry picked from commit ab6dd970ac)
2026-02-24 06:55:10 -08:00
Vicki Pfau
399b2b18ce Support SL/SR on Switch 2 controllers, but only in mini-controller mode
It doesn't really make sense to support these in combined mode since they're usually occluded.

(cherry picked from commit 8a1684fbbc)
2026-02-24 06:53:41 -08:00
Frank Praznik
cbee4abdfc x11: Don't send duplicate key down events when reconciling
Modifier keys shouldn't be repeated.

(cherry picked from commit 550394eecd)
2026-02-23 15:10:17 -05:00
Sam Lantinga
7066c6491e Fixed cursor mask padding calculation
(cherry picked from commit 2e4ac09b1f)
2026-02-23 09:53:12 -08:00
Sam Lantinga
74bfc913ac Improved support for byte array pixel formats
Fixes https://github.com/libsdl-org/SDL/issues/15082

(cherry picked from commit 4f06087b36)
2026-02-21 12:52:12 -08:00
Sam Lantinga
d281a080c6 Updated to version 3.4.3 for development 2026-02-20 15:59:20 -08:00
Sam Lantinga
683181b47c Updated to version 3.4.2 for release 2026-02-20 15:12:29 -08:00
Alex Threlfo
a3bfd36665 filesystem: Fix Android asset enumeration
Passes expected relative paths to Android's AssetManager API instead of
absolute ones + fixes some indexing logic with trailing slashes.
2026-02-20 15:09:53 -08:00
Ethan Lee
a056d0f39a cocoa: Don't include KHR_portability_enumeration by default.
This is only useful if the application knows to add the flag introduced by this
extension, and at that point the application can also include the extension
themselves.

Case in point: SDL_gpu_vulkan was already doing this!
2026-02-20 11:35:43 -05:00
Ethan Lee
910d31e56a vulkan: Only enable KHR_portability_enumeration when available 2026-02-20 11:35:37 -05:00
Ryan C. Gordon
7cc9955ae1 emscripten: Move some EM_ASM blocks to MAIN_THREAD_EM_ASM.
These blocks reference the `navigator` global, which is not available in
background threads.

(cherry picked from commit c728e2f044)
2026-02-20 10:28:12 -05:00
Jesse Chounard
76ff74eeab Fix D3D12 DSV creation for array/cube/cube-array depth textures
DSV creation was missing a TEXTURE2DARRAY branch for array, cube, and
cube-array depth textures. It fell through to TEXTURE2D, so
FirstArraySlice was never set and all layers' DSVs targeted layer 0.
This caused incorrect rendering when using depth textures with multiple
layers, such as cubemap shadow maps.
2026-02-20 10:26:32 -05:00
Ryan C. Gordon
dc590257ba n3ds: SDL_SYS_GetPreferredLocales now handles error cases correctly.
Previously it would have reported success but not returned a valid string, and
didn't check for the (probably extremely unlikely) case of overflowing our
locale list array.

(cherry picked from commit 3aa531000a)
2026-02-20 10:14:36 -05:00
Frank Praznik
267f13446d video: Check video backend initialization when querying the grabbed window
SDL_GetGrabbedWindow() can be called when the video system is uninitialized, and, since there is no window parameter, _this must be checked for validity to avoid a segfault.

(cherry picked from commit be82f316c4)
2026-02-19 11:22:55 -05:00
Ryan C. Gordon
4cc96e3506 include: Added \threadsafety notes to about 60 more functions.
Reference Issue #7140.

(cherry picked from commit 28e4269915)
2026-02-18 19:51:25 -05:00
Ryan C. Gordon
13ff9e0818 filesystem: Fix SDL_GlobDirectory on iOS and Android.
It SDL_SYS_EnumerateDirectory was changing the path string and passing it to
the callback, causing chaos in the glob handler, which expected the original
string to pass through.

Fixes #15057.

(cherry picked from commit a3b0403412)
2026-02-18 08:21:48 -08:00
Ryan C. Gordon
42abf69434 emscripten: Fix only one mouse button being usable at a time.
Fixes #15056.

(cherry picked from commit c9591c515c)
2026-02-17 19:05:18 -05:00
Ryan C. Gordon
5d9d966d59 emscripten: Allow resize events on fullscreen windows.
Fixes browsers on phone that change screen orientation during fullscreen not
getting a resize event.

Fixes #15024.

(cherry picked from commit 0f2d415dee)
2026-02-17 18:41:38 -05:00
William Horvath
8df04368b3 gpu_vulkan: Set texture container before transitioning to default barrier state.
Avoids a null dereference of currentRegion->vulkanTexture->container in DefragmentMemory:

} else if (!currentRegion->isBuffer && !currentRegion->vulkanTexture->markedForDestroy) {
...
&currentRegion->vulkanTexture->container->header.info
... (among others)

by not "VULKAN_Submit"ting (and thus adding it to the defrag pool) before setting the container.

Although rare (defrag almost never ran), this crash happened in a real-world application.

(cherry picked from commit 06bf8d1924)
2026-02-17 14:13:03 -08:00
Sam Lantinga
3b4cf41c92 Fixed HIDAPI PS5 Bluetooth report format
(cherry picked from commit 129627068f)
2026-02-17 08:57:28 -08:00
Zack Middleton
65dfdce3df win32: Set error for SDL_GL_GetSwapInterval()
(cherry picked from commit 54de246b4b)
2026-02-17 10:27:45 -05:00
Ryan C. Gordon
3a5d0bac71 Revert "MacOS: improve scroll smoothing"
This reverts commit 5dab2c73f0.

We'll revisit this in the next SDL release.

Reference Issue #15058.

(cherry picked from commit 63c0650321)
2026-02-17 10:25:04 -05:00
Cameron Gutman
29c58245a7 android: Fix scancode for AKEYCODE_CHANNEL_DOWN
(cherry picked from commit f0bda7b655)
2026-02-17 00:27:18 -06:00
Sam Lantinga
1faaa128e5 Treat the D-pad center button as SDL_SCANCODE_RETURN
This fixes handling of the Android TV remote select button sent over CEC.

(cherry picked from commit 089f5e1318)
2026-02-16 12:35:34 -08:00
Sam Lantinga
99e1d9595f Moved mouse/keyboard detection to a separate thread on Windows
Getting device names can hang for a long time on certain devices, so make sure this is done on a separate thread to avoid blocking initialization and the main loop.

Fixes https://github.com/libsdl-org/SDL/issues/12913

(cherry picked from commit bc623d1af6)
2026-02-16 11:27:11 -08:00
Sam Lantinga
8389de757a Don't re-query HID device vendor and product
(cherry picked from commit a98e49409e)
2026-02-16 11:27:11 -08:00
Sam Lantinga
a82660bb76 Added temporary workaround hint "SDL_WINDOWS_DETECT_DEVICE_HOTPLUG"
Some devices with broken drivers hang when their name is queried, so added a workaround for applications that don't need input device details. The long term fix is to move the hotplug detection into a separate thread.

(cherry picked from commit a66988621a)
2026-02-16 11:27:11 -08:00
Ryan C. Gordon
ea2b4f4674 hints: Rename SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE.
It's now SDL_HINT_OPENGL_FORCE_SRGB_FRAMEBUFFER, since it does more than mess
with the srgb-capable context attribute now.

Reference Issue #14898.

(cherry picked from commit 10b524c7cc)
2026-02-16 13:09:24 -05:00
Ryan C. Gordon
febe5dd3bc render: opengl and opengles2 renderers try to disable GL_FRAMEBUFFER_SRGB.
Reference Issue #14898.

(cherry picked from commit fc570a1a1c)
2026-02-16 13:09:18 -05:00
Ryan C. Gordon
8f9dd75ead video: Only set GL_FRAMEBUFFER_SRGB state if the hint requests it.
Reference Issue #14898.

(cherry picked from commit ead67481c0)
2026-02-16 13:08:59 -05:00
Cameron Gutman
a849c4d361 win32: Fix composition UI being displayed when IME is disabled
(cherry picked from commit 8535936401)
2026-02-16 09:00:49 -08:00
NateXS
8973dfd9cc n3ds: Don't put audio thread in system core on Old 3DS systems
(cherry picked from commit 149abe8f85)
2026-02-16 08:44:52 -08:00
Sam Lantinga
2f4919c6ff Use 20 ms as the default audio buffer size on Android
It turns out that Android will not pick a low latency buffer size by default.

(cherry picked from commit c381b2bdfa)
2026-02-13 14:35:25 -08:00
Sam Lantinga
9f0ebbef46 Steam Controller report 0x45 is used for BLE mode
(cherry picked from commit 0b1c592fda)
2026-02-12 15:46:19 -08:00