Commit Graph

21184 Commits

Author SHA1 Message Date
Ethan Lee
f6a979d7e8 events: Buildfix for targets with C++ build units 2026-01-09 14:51:23 -05:00
Katharine Chui
f4b937adf8 haptic hidapi: maintain effects array for external checking
(cherry picked from commit 2bb463921f)
2026-01-08 14:05:26 -08:00
Ozkan Sezer
6aa227a428 stb_image.h (stbi__start_mem): initialize io.skip and io.eof to NULL
Patch authored by @NBickford-NV: https://github.com/miniupnp/stb/pull/1
c.f.: https://github.com/nothings/stb/pull/1751

(cherry picked from commit ab900a389f)
2026-01-08 23:23:02 +03:00
Sam Lantinga
cc0755881c Fixed crash when the broken EZFRD64.DLL is present
Fixes https://github.com/ppy/osu/issues/13634

(cherry picked from commit f369e804e2)
2026-01-07 20:32:07 -08:00
limb-soup
f1b2fa5b9b pthread: add call to pthread_mutexattr_destroy (#14786)
(cherry picked from commit f805bb53cf)
2026-01-07 10:56:25 -08:00
DarkContact
a4b7a77d70 Add support for GPU ARGB1555 (B5G5R5A1_UNORM) textures with DX11
(cherry picked from commit 044aed1f27)
2026-01-07 10:12:46 -08:00
bubbleguuum
06a6adf2b0 x11: fix compilation failure on older XInput2
Older versions of XInput2 do not declare struct XIGesturePinchEvent
in XInput2.h, causing compilation failure in SDL_x11xinput2.c

Check for XIGesturePinchEvent in the test for enabling
SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_GESTURE

(cherry picked from commit 7690e00f42)
2026-01-06 06:49:53 -08:00
Sam Lantinga
08b2176a80 Fixed conflict when linking both SDL and hidapi statically
Closes https://github.com/libsdl-org/SDL/pull/14772

(cherry picked from commit bc68c1c920)
2026-01-06 06:10:51 -08:00
Anonymous Maarten
99b2344253 cmake: add SDL_FULL_VERSION target property containing full SDL version
(cherry picked from commit d73e74f9bf)
2026-01-06 04:05:04 +01:00
Anonymous Maarten
35a891d0e9 cmake: rpi videocore needs brcmegl as well
(cherry picked from commit cd31381185)
2026-01-05 23:45:59 +01:00
Mathieu Eyraud
0394e2e583 Fix Mouse button index
(cherry picked from commit c9baf208bd)
2026-01-05 16:08:38 -05:00
Frank Praznik
8a418521e1 wayland: Check focus when dispatching relative motion
In rare cases, a leave event can be grouped with relative motion in a frame. Ensure a valid focus window when dispatching relative motion.

(cherry picked from commit fab42a1432)
2026-01-05 13:44:09 -05:00
Katharine Chui
fa894b07be hidapi: Disable hidapi LG4FF on windows (#14762)
hid.dll simply cannot send 7 bytes reports unlike other platforms

It enforces full length repots of 17 from the device's descriptor,
which does not work on the device.

This breaks ffb and led control, so we disable this by default on
windows.

(cherry picked from commit 6c2f9bc41e)
2026-01-05 08:14:45 -08:00
Sam Lantinga
832b2aaf39 Don't call SDL_Gtk_Quit() on private platforms
(cherry picked from commit c742038aa9)
2026-01-05 08:08:51 -08:00
Sam Lantinga
3f58b99b53 Fixed handling status changes in the FlyDigi controller driver
(cherry picked from commit ce6a6d1b39)
2026-01-05 08:00:13 -08:00
Ethan Lee
406cd277d2 render: Add support for private-platform shaders in GPU backend 2026-01-05 09:49:15 -05:00
Lucas Murray
9a5700e9a3 GPU: Add error message to Vulkan buffer creation error path
(cherry picked from commit cced3ce8b9)
2026-01-04 15:18:11 -08:00
Sam Lantinga
2237a8eba2 Fixed building with Xcode 15.4
Fixes https://github.com/libsdl-org/SDL/issues/14740

(cherry picked from commit 504041a1ba)
2026-01-03 08:04:59 -08:00
Qiu Qiang
0bc2296756 Cache CGDisplayPixelsHigh result on macOS to reduce IPC overhead
CGDisplayPixelsHigh(kCGDirectMainDisplay) involves an IPC call to the
Window Server on each invocation. Cache the main display height in
SDL_CocoaVideoData and update it only when display configuration changes,
reducing overhead during high-frequency mouse event processing.

(cherry picked from commit 3ee8d1406c)
2026-01-02 12:29:36 -08:00
Ethan Lee
a85a6364d8 ci: Add steamrt4 workflows 2026-01-02 12:19:08 -05:00
Sam Lantinga
9fbba079b9 Update the iOS Xcode build requirements
(cherry picked from commit 7edcc413e8)
2026-01-02 08:53:40 -08:00
Sam Lantinga
3d651ee403 iOS: if the file doesn't exist in the pref path, use the current directory
Fixes https://github.com/libsdl-org/SDL/issues/14743

(cherry picked from commit a0307589bd)
2026-01-02 08:19:45 -08:00
Joshua Vandaële
8de01986b1 Fix dynamic library handling for LibUSB
`target_get_dynamic_library` should not be called if `SDL_HIDAPI_LIBUSB_SHARED` is set to OFF, it otherwise causes a warning at best, or a build failure if libusb is provided by a parent project and not installed on the system

(cherry picked from commit 4a29b6a651)
2026-01-02 07:39:42 -08:00
Ethan Lee
cbed9bd54d gpu: D3D12 uploads should also factor in block size for height, not just width.
It turns out the reason this function was having so many overread issues was because our row copies were wrong - for compressed images we also need to reduce the row count based on the block size, similar to what we already do for pitch calculation - these copies are byte copies, not pixel copies!

(cherry picked from commit f472f93db8)
2026-01-02 07:37:56 -08:00
Zack Middleton
fd345ae2f9 Improve hint documentation
(cherry picked from commit 6247568a1b)
2026-01-02 07:33:17 -08:00
Kadir
c5dee0feb5 Add ProGuard rule for joystickSetLED method in SDLControllerManager
(cherry picked from commit cbcc565ca9)
2026-01-02 07:31:37 -08:00
Brad Smith
a6ff5646f4 cmake: Enable Vulkan support on OpenBSD
(cherry picked from commit 1d51671cbe)
2026-01-02 00:18:38 +01:00
Sam Lantinga
80c6a5f8d9 Updated copyright for 2026 2026-01-01 09:48:19 -08:00
Sam Lantinga
d15ecb21be Updated to version 3.4.1 for development 2025-12-31 18:18:45 -08:00
Sam Lantinga
a962f40bbb Updated to version 3.4.0 for release release-3.4.0 2025-12-31 16:43:54 -08:00
Frank Praznik
cac2460623 x11: Don't dedup move/size events
The event core will do so automatically, and this may end up dropping events in rare cases when exiting fullscreen if an event with the final bordered window size is sent before the event notifying that the borders have come back on.
2025-12-31 17:55:32 -05:00
Ryan C. Gordon
25e33948af emscripten: Handle mouse button events more correctly.
Don't decide if the button is pressed by the `buttons` bitmask, but rather by
event type. On macOS, the trackpad might produce a mousedown event with taps
instead of full clicks--if tapping is enabled in System Preferences--and in
this case might not set the flag in the bitmask.

Fixes #14640.
2025-12-31 17:23:42 -05:00
Sam Lantinga
9698e20399 gpu renderer: fixed memory leak when resizing the backbuffer
Fixes https://github.com/libsdl-org/SDL/issues/14734
2025-12-31 08:00:26 -08:00
Sam Lantinga
0ac6f972f9 Added enhanced support for the Flydigi Vader 5 Pro controller 2025-12-31 07:46:56 -08:00
Anonymous Maarten
d7a2d007d0 Remove superfluous comma from SDL_missing_dependency calls 2025-12-31 04:23:27 +01:00
Frank Praznik
cb4f33b644 gpu: Use the window event watcher list for Vulkan and D3D12
Events won't be delivered to the regular event watcher list callbacks if a client event filter discards events. Use the special window event watcher list to watch for resizes in the GPU renderers, as events are delivered to this list before a client can potentially discard them.
2025-12-30 22:18:19 -05:00
Ryan C. Gordon
4d8f84f161 timer: Use the emscripten-specific code on Emscripten, even with threading.
Fixes #14640.
2025-12-30 18:57:55 -05:00
dwillbarron
618eb57519 DirectInput FFB: Calculate appropriate update flags (#14570)
Anecdotally, some force-feedback wheels have been reported to experience a
reduced "definition", "texture", "precision", or "je ne sais quoi", which
appears to be caused by sending more update flags than necessary to
DirectInput.

This may be related to the fact that there are two USB PID packets that are
sent when updating a device: One contains the "general" force data, and the
other contains the "type-specific" data. My speculation is that many wheels
expect to only receive the latter, and misbehave when receiving both.

This has been tested and validated anecdotally by others who have received
a hacked-together version of PCSX2 that corrects the flags sent to DirectInput,
who noted a significant improvement in the "feeling" of the FFB effects.

The only way to validate this at a technical level is to grab a wheel that uses
the "generic" DirectInput FFB drivers (which map nearly 1:1 with the USB PID
specification), and inspect the USB packets (e.g. with USBPcap) to check whether
redundant data is being sent.
2025-12-30 14:43:49 -08:00
Sam Lantinga
128b9260ec Added SDL_HINT_HIDAPI_LIBUSB_GAMECUBE
Fixes https://github.com/libsdl-org/SDL/issues/14682
2025-12-30 14:14:51 -08:00
Ryan C. Gordon
1a27b5b838 emscripten: set window->w and ->h when creating with external css sizing.
Fixes #14711.
2025-12-30 16:56:45 -05:00
Ryan C. Gordon
7d66d3271b emscriptenaudio: Don't force reset SDL3.audio_recording/audio_playback.
Otherwise, opening devices for recording and playback at the same time will
cause problems.
2025-12-30 15:40:25 -05:00
Ryan C. Gordon
b681862f14 emscripten: Don't pass an argument to MAIN_THREAD_EM_ASM_INT we don't use.
This upsets things, because you end up calling a javascript function with
more arguments than it expects, and if asserts are enabled, Emscripten notices
this and aborts the program when you hit this code.

Reference Issue #14670.
2025-12-30 15:40:25 -05:00
Eddy Jansson
3d354eeaad Prefer SDL_arraysize()
Replace uses of (sizeof(arr)/sizeof(arr[0]), and similar,
with the SDL_arraysize() macro.
2025-12-30 12:22:03 -08:00
Sam Lantinga
d33642b710 Filter libusb devices early in enumeration
Some device drivers crash if you query things like manufacturer and product name, so make sure we only touch devices that we're really interested in.
2025-12-30 10:52:56 -08:00
Frank Praznik
95ac0ff4d6 wayland: Center non-square icon images
Center icon images instead of scaling to preserve the aspect ratio.
2025-12-29 13:35:18 -05:00
MAJigsaw77
cb04dcd6f8 android: Add RGB LED support for joysticks. 2025-12-29 10:32:02 -08:00
Frank Praznik
4fcb92e0df wayland: Scale non-square icon images
Wayland icons must be square, so scale non-square images to fit a square region instead of failing. This matches X11 behavior.

A warning that the image will be scaled will be logged.
2025-12-29 12:56:42 -05:00
Sam Lantinga
48d6c70f2c Revert "Added note for migrating SDL2 code using SDL_ThreadID()"
This reverts commit becd08f376.
2025-12-29 09:50:18 -08:00
Sam Lantinga
d10fe8bf2f Added a Linux mapping for the Nacon GC100 controller (thanks @elkabyliano!) 2025-12-29 09:43:47 -08:00
Sam Lantinga
becd08f376 Added note for migrating SDL2 code using SDL_ThreadID() 2025-12-29 09:39:59 -08:00