Commit Graph

13103 Commits

Author SHA1 Message Date
Sanjay Govind
34378609bb fix off by one with tilt on ps3 guitars (#15144) 2026-03-02 09:45:44 -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 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
Sam Lantinga
2d9fca46c6 Added surface validation to SDL_ConvertSurfaceRect()
Fixes https://github.com/libsdl-org/SDL/issues/15141
2026-03-01 11:34:34 -08:00
Frank Praznik
0a45525242 wayland: Handle min/max sizes in fixed-size windows with viewports
Wayland is sometimes at-odds with clients that want to enforce an aspect ratio or min/max window size, as certain window states have dimensions that either must be obeyed (maximized), or will give terrible results if they aren't (tiled). Use a viewport and a masking subsurface to handle cases where surfaces are unable to match the exact window size.

The changes made to accommodate this also catches some additional windowing related edge-cases, simplifies synchronization, and prevents commits before a buffer has been attached to the surface.
2026-02-28 12:55:17 -05:00
Brenton Bostick
3ac4e684ab make sure #endif comment matches the macro name 2026-02-28 08:43:42 -08:00
Sam Lantinga
0a1c7b5348 Fixed SDL_GetIOSize() return value
Fixes https://github.com/libsdl-org/SDL/issues/15129
2026-02-28 08:41:47 -08:00
Sam Lantinga
f600c74c80 Don't enable extended features for GameSir controllers over Bluetooth 2026-02-26 09:18:07 -08:00
Sam Lantinga
170e3a81d8 Fixed the GameSir-G7 Pro 8K button mapping 2026-02-26 09:18:07 -08:00
Sam Lantinga
7775bbef9f Fixed the GameSir-G7 Pro 8K accelerometer scale 2026-02-26 09:18:07 -08:00
Sam Lantinga
862e1e8600 Fixed the GameSir-G7 Pro 8K sensor rate
The reports are delivered at 250 Hz both wired and via the wireless dongle.
2026-02-26 09:18:07 -08:00
zuiki_inn
29ca920fdf Add ZUIKI EVOTOP controller support with gyroscope and accelerometer sensor capabilities. (#15034) 2026-02-25 20:24:29 -08:00
rabbit-ecl
230814e85e Use Uint64 instead for tick_numerators in USE_128BIT_MATH 2026-02-25 20:18:51 -08:00
Sam Lantinga
24404d9047 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
2026-02-25 11:41:31 -08:00
Ethan Lee
a4cd62ef93 render: Reduce scope of D3D12 GDK event watcher to Xbox 2026-02-25 09:23:20 -05:00
Ethan Lee
5770e013c2 gdk: Render/GPU can call SuspendX, document when to call SuspendComplete 2026-02-25 09:20:25 -05:00
Sam Lantinga
49a8b4229b Added battery status for newer FlyDigi controllers 2026-02-24 20:49:45 -08:00
Sanjay Govind
0c859452ef Support accelerometers on 3rd party ps3 controllers (#15109) 2026-02-24 18:58:13 -08:00
Sanjay Govind
a7ccd48957 Set joystick_type for known ps3/wii instruments (#15111) 2026-02-24 17:26:46 -08:00
Sanjay Govind
1419bcb6cb deal with controllers that don't have report ids 2026-02-24 15:18:53 -08:00
Frank Praznik
2f38b6a396 x11: Also send key releases when reconciling state 2026-02-24 17:12:00 -05:00
Sanjay Govind
0e4008441f Fix up controller types for various playstation and wii instruments (#15104) 2026-02-24 13:35:45 -08:00
Sam Lantinga
2385dc6297 Added support for the Flydigi Vader 5 Pro in Xbox 360 mode 2026-02-24 10:18:17 -08:00
Brenton Bostick
c259f969f2 fix unknown argument nBufSize 2026-02-24 09:50:17 -08:00
Brenton Bostick
0d0db08b61 fix JNI parameter types 2026-02-24 09:49:42 -08:00
Brenton Bostick
a5889b0e44 make sure #endif comment matches the macro name 2026-02-24 09:48:57 -08:00
Void Star Caster
4a4ae4a79d Fix GetSampler() bug for INDEX8 pixel format (#15099) 2026-02-24 08:05:30 -08:00
Vicki Pfau
ab6dd970ac 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.
2026-02-24 06:54:31 -08:00
Vicki Pfau
8a1684fbbc 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.
2026-02-24 06:52:32 -08:00
Frank Praznik
550394eecd x11: Don't send duplicate key down events when reconciling
Modifier keys shouldn't be repeated.
2026-02-23 15:09:34 -05:00
Sam Lantinga
2e4ac09b1f Fixed cursor mask padding calculation 2026-02-23 09:52:45 -08:00
tmkk
bbcc205de9 Detect steam virtual gamepads more accurately on macOS 2026-02-22 11:11:09 -08:00
tmkk
50d0e2ede2 Bring back support for 360Controller driver on macOS 2026-02-22 11:11:09 -08:00
Sam Lantinga
4f06087b36 Improved support for byte array pixel formats
Fixes https://github.com/libsdl-org/SDL/issues/15082
2026-02-21 12:51:26 -08:00
Alex Threlfo
6583134365 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:10:52 -08:00
Sam Lantinga
67c2f61068 Support an alternate GameSir report format 2026-02-20 09:44:14 -08:00
Ethan Lee
8a3820500d 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:29:26 -05:00
Ethan Lee
fa9bad2e4b vulkan: Only enable KHR_portability_enumeration when available 2026-02-20 11:29:26 -05:00
Ryan C. Gordon
c728e2f044 emscripten: Move some EM_ASM blocks to MAIN_THREAD_EM_ASM.
These blocks reference the `navigator` global, which is not available in
background threads.
2026-02-20 10:27:44 -05:00
Jesse Chounard
a79bd26d28 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:23:47 -05:00
Ryan C. Gordon
3aa531000a 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.
2026-02-20 10:14:05 -05:00
Frank Praznik
be82f316c4 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.
2026-02-19 11:22:03 -05:00
Ryan C. Gordon
28e4269915 include: Added \threadsafety notes to about 60 more functions.
Reference Issue #7140.
2026-02-18 19:49:59 -05:00
Ryan C. Gordon
a3b0403412 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.
2026-02-17 19:41:20 -05:00
Ryan C. Gordon
c9591c515c emscripten: Fix only one mouse button being usable at a time.
Fixes #15056.
2026-02-17 19:00:36 -05:00
Ryan C. Gordon
c043adaeb2 Reapply "MacOS: improve scroll smoothing"
This reverts commit 63c0650321.

This reverts a revert; leaving this in main, where we'll examine it in 3.6.0.

This remains reverted in release-3.4.x

Reference Issue #15058.
2026-02-17 18:51:53 -05:00