Commit Graph
100 Commits
Author SHA1 Message Date
Sam Lantinga ad30741a5b Additional clarification on blend mode usage 2026-08-06 10:36:21 -07:00
Sam Lantinga 81afb82f2d Clarify how the draw blend mode is used in the 2D renderer
Fixes https://github.com/libsdl-org/SDL/issues/16109
2026-08-06 08:47:50 -07:00
Sam Lantinga a4340f1187 Clarify supported Apple deployment targets for SDL 3.0 2026-08-02 08:49:49 -07:00
Sam Lantinga 8dc177294b Leave open Xbox devices in the libusb enumerated list on macOS
Fixes https://github.com/libsdl-org/SDL/issues/15961
2026-08-02 08:15:19 -07:00
Sam Lantinga ec4bdfd118 Fixed SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER with IYUV and YV12 pixel buffers 2026-07-31 15:47:28 -07:00
Sam Lantinga b212874def Fixed support for SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER 2026-07-31 15:24:36 -07:00
Sam Lantinga 691571cc57 Moved GameInput into the gameinput folder in the Visual Studio project 2026-07-31 09:28:33 -07:00
Sam Lantinga fe85b4782d Support extended interop with the 2D Metal renderer
Also fixed an issue where an external surface couldn't be used with IYUV and YV12 textures.
2026-07-30 19:28:50 -07:00
Sam Lantinga 6880bed495 Fixed java.lang.ClassNotFoundException: Didn't find class "android.window.OnBackInvokedCallback" on Android 8.0
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-29 19:45:40 -07:00
Sam Lantinga 1457503bd2 Check for the sRGB color primaries rather than the transfer function 2026-07-28 12:29:42 -07:00
Sam Lantinga f4337eded2 Use the render passes we just created when creating a Vulkan render target
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-27 10:56:49 -07:00
Sam Lantinga db84871fdf Allow writing to planar YUV textures from application code in the Vulkan renderer 2026-07-27 10:56:49 -07:00
Sam Lantinga 855cbec702 Set VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT for planar formats
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
This allows creating separate image views for the planes of the image if desired.
2026-07-24 16:22:28 -07:00
Sam Lantinga 0f5f708c5a Better check to see whether HDR10 input will have scaling applied
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-23 12:55:14 -07:00
Sam Lantinga 303113b853 Sorted controller mappings
Also fixed line endings for Retro Fighters D6 mappings
2026-07-23 11:38:24 -07:00
Sam Lantinga 982787979f testcolorspace: added an additional PQ blend color case 2026-07-23 10:50:23 -07:00
Sam Lantinga 413ac5084d testcolorspace: show the blend color when it's incorrect
Also added an additional PQ blend color case
2026-07-23 10:40:20 -07:00
Sam Lantinga 326694de32 Get the correct HDR values under Gamescope
This also switches log messages in SDL_x11modes.c to use SDL_Log()
2026-07-23 10:32:03 -07:00
Sam Lantinga 604fe14b87 Make sure the PQ shader will output the input value before using the simple shader
Note that we don't account for vertex color here. If HDR10 content needs to be tinted by vertex color, it can't use the simple shader. I'm assuming that the use case for this will be video content which generally won't use vertex color and this optimization is fine.
2026-07-23 10:25:25 -07:00
Sam Lantinga 148241117b Define SCRGB_NITS for use in HDR color calculations 2026-07-23 10:25:25 -07:00
Sam Lantinga 9f4a1215e2 testcolorspace: show a reasonable HDR gradient on Wayland
On some Wayland configurations, the SDR white level is 203 nits and the max luminance is 10000 nits, and HDR content in the PQ range is mapped by the compositor into the actual display capabilities. We don't want to show an HDR gradient up to 10000 nits, so let's cap it to ~1000 nits in this case.
2026-07-23 08:01:05 -07:00
Sam Lantinga 2a623fd224 wayland: set the SDR_white_level for HDR capable displays
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-22 15:24:48 -07:00
Sam Lantinga 0d21a1aa7a testcolorspace: add optional cycling of colorspaces
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-22 11:36:32 -07:00
Sam Lantinga e10457d52f testcolorspace: added an HDR10 gradient 2026-07-22 11:36:32 -07:00
Sam Lantinga 23b641070c Added HDR10 display support for the direct3d11, direct3d12, and vulkan renderers 2026-07-22 11:36:32 -07:00
Sam Lantinga ae2301e7a5 Added SDR white point for X11 on Steam Deck
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
Also disabled HDR on X11 for other devices for now, we don't know that they'll be able to display it properly.
2026-07-21 20:24:26 -07:00
Sam Lantinga 75e280618e edid-parse: print the HDR luminance information 2026-07-21 20:24:26 -07:00
Sam Lantinga c70f111295 Corrected the name of the Razer Raiju V3 Pro controller
Fixes https://github.com/libsdl-org/SDL/issues/16028
2026-07-21 07:47:28 -07:00
Sam Lantinga d98661ff7f Decode the monitor EDID to get HDR metadata on X11
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-20 12:25:17 -07:00
Sam Lantinga 08b9c55393 Fixed error: cast from pointer to integer of different size
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-17 22:08:39 -07:00
Sam Lantinga f00052ffe2 testffmpeg: fixed memory leak using DRM frames with the Vulkan renderer
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-17 19:24:46 -07:00
Sam Lantinga 762f4abbd0 Fixed an error with goto crossing variable initialization 2026-07-17 16:56:23 -07:00
Sam Lantinga 332e7a050e testffmpeg: added support for VA-API and DRM frames when using Vulkan rendering 2026-07-17 16:23:48 -07:00
Sam Lantinga 2d7f300783 Don't accidentally switch the Horipad Mini into Switch report mode
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
The PS3 probing switches the HORI Horipad Mini into Nintendo Switch report mode, which we don't recognize since it's still using the Xbox 360 endpoint.
2026-07-14 15:24:49 -07:00
Sam Lantinga 1f188100bc Added an msys build to the priority build list 2026-07-13 09:24:04 -07:00
Sam Lantinga 80be09a804 Fixed error: unknown conversion type character 'z' in format
That apparently isn't supported by the mingw compiler
2026-07-13 09:22:14 -07:00
Sam Lantinga 9149eca207 testffmpeg_vulkan: enable the VK_KHR_video_maintenance1 extension
This is used by ffmpeg, so we'll enable it if it's available
2026-07-10 11:40:30 -07:00
Sam Lantinga 094213b3be testffmpeg_vulkan: fixed goto jump past variable initialization 2026-07-10 10:07:50 -07:00
Sam Lantinga 4a00b98c91 testffmpeg: added a --nodelay command line option 2026-07-10 10:06:48 -07:00
Sam Lantinga 573fc51938 testffmpeg_vulkan: use C++ compatible code structure 2026-07-10 10:06:48 -07:00
Sam Lantinga 6ce3d843fc testffmpeg_vulkan: fixed usage of timeline semaphores 2026-07-10 10:06:48 -07:00
Sam Lantinga c1d4376d3c Fixed Vulkan validation errors when using ffmpeg video decode 2026-07-10 08:09:15 -07:00
Sam Lantinga 782d6bc116 Note that Windows doesn't see mouse button releases when RIDEV_NOLEGACY is active. 2026-07-08 16:08:38 -07:00
Sam Lantinga cf6a235a41 Only skip the Flydigi driver when checking to see if a device is handled by HIDAPI 2026-07-07 09:30:20 -07:00
Sam Lantinga c0efc5862c Use the correct protocol for the PDP Afterglow Wave controller
Third party wireless controllers use the full Switch Pro protocol over Bluetooth and third party wired controllers use the input-only protocol.

The PDP Afterglow Wave Controller for Switch uses the same VID/PID for both wired and wireless variants, so we need to look at the connection type to determine what protocol to use.
2026-07-06 18:47:46 -07:00
Sam Lantinga 03f81ab4aa Fixed the 8BitDo Pro 3 controller showing up twice on macOS
Fixes https://github.com/libsdl-org/SDL/issues/15890
2026-07-06 17:03:23 -07:00
Sam Lantinga ce417a40cf Start text input before showing the on-screen keyboard (thanks @sharkwouter!)
Fixes the on screen keyboard not sending an event the first time on PSP

Closes https://github.com/libsdl-org/SDL/pull/15950
2026-07-06 16:44:59 -07:00
Sam Lantinga bd55a6d67d Fixed pressing back paddles and D-pad simultaneously on the GameSir-G7 Pro 8K controller 2026-07-06 16:35:24 -07:00
Sam Lantinga d8d5b7c6c5 Added a slider to manually adjust HDR headroom on visionOS
Ideally the OS would provide a way to query the current headroom, but for now users can manually adjust it.
2026-07-06 13:25:12 -07:00
Sam Lantinga 31caedaf47 video: Fix -Wcomma warnings in miniz
e.g.
SDL3/src/video/miniz.h:1058:19: warning: possible misuse of comma operator here [-Wcomma]
 1058 |       s1 += ptr[0], s2 += s1; s1 += ptr[1], s2 += s1; s1 += ptr[2], s2 += s1; s1 += ptr[3], s2 += s1;
2026-07-03 13:34:41 -07:00
Sam Lantinga 7523eb22a0 cocoa: Fix -Wimplicit-retain-self warning in SDL_cocoawindow
SDL3/src/video/cocoa/SDL_cocoawindow.m:1149:38: error: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Werror,-Wimplicit-retain-self]
 1149 |         SDL_OnWindowLiveResizeUpdate(_data.window);
2026-07-03 13:34:39 -07:00
Sam Lantinga b9d5252dfa hidapi: Ignore enum-enum-conversion warnings in libusb hid.c which requires mixing enum bitmasks
SDL3/src/hidapi/libusb/hid.c:711:62: error: bitwise operation between different enumeration types ('enum libusb_endpoint_direction' and 'enum libusb_request_recipient') [-Werror,-Wenum-enum-conversion]
  711 |         int res = libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_RECIPIENT_INTERFACE, LIBUSB_REQUEST_GET_DESCRIPTOR, (LIBUSB_DT_REPORT << 8), (uint16_t)interface_num, tmp, expected_report_descriptor_size, 5000);
2026-07-03 13:34:36 -07:00
Sam Lantinga 7346311377 cocoa: Fix invalid NSMenuItem selector in SDL_tray
SDL3/src/tray/cocoa/SDL_tray.m:511:98: error: undeclared selector 'menu:' [-Werror,-Wundeclared-selector]
  511 |         nsitem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithUTF8String:label] action:_selector(menu:) keyEquivalent:_""];
2026-07-03 13:34:34 -07:00
Sam Lantinga 5d693d72f8 Fix -Wstrict-prototypes warnings
e.g.
SDL3/src/hidapi/libusb/hid.c:636:31: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
  636 | static void start_event_thread()
2026-07-03 13:34:30 -07:00
Sam Lantinga efce7ca4b1 Added HDR support on visionOS 2026-07-03 13:33:27 -07:00
Sam Lantinga 9123f69cdd Added testcolorspace to the Apple test Xcode project 2026-07-03 13:33:27 -07:00
Sam Lantinga 1be08afec5 Added support for several Turtle Beach Nintendo Switch 2 controllers
* Turtle Beach Afterglow Wired Controller for Nintendo Switch 2
* Turtle Beach Afterglow Wave Wired Controller for Nintendo Switch 2
* Turtle Beach Afterglow Wireless RGB Gaming Controller for Nintendo Switch 2
* Turtle Beach Rematch Wired Controller for Nintendo Switch 2
* Turtle Beach Rematch Wireless RGB Gaming Controller for Nintendo Switch 2
2026-07-03 09:17:34 -07:00
Sam Lantinga 7dd7c7607f Removed unused code in UIKit_AddDisplay() 2026-07-02 14:05:06 -07:00
Sam Lantinga bd7c9e467b Removed helpCursor and cellCursor NSCursor selectors
These don't actually exist and we don't have a better fallback.
2026-07-01 15:54:00 -07:00
Sam Lantinga dfefce62e2 Get the physical device properties when using an external Vulkan device
Fixes `testffmpeg --sprites 100` when using the Vulkan renderer
2026-06-30 12:53:17 -07:00
Sam Lantinga 2069d5f6bc Fixed formatting 2026-06-30 12:53:17 -07:00
Sam Lantinga 464b90b475 Issue a batch when changing render targets in the Vulkan renderer
Otherwise we get rendering artifacts that look like drawing is being applied to the wrong render target
2026-06-30 09:00:09 -07:00
Sam Lantinga e0b12bbcea Added a workaround for a crash in NVIDIA drivers when rendering YUV with Vulkan
Fixes https://github.com/libsdl-org/SDL/issues/13878
2026-06-29 14:09:24 -07:00
Sam Lantinga 92c3150859 Fixed OpenVR build 2026-06-29 13:14:33 -07:00
Sam Lantinga f0e99e7c7f Removed unnecessary assert in WIN_SetWindowOpacity()
Fixes https://github.com/libsdl-org/SDL/issues/15896
2026-06-27 21:10:19 -07:00
Sam Lantinga 089b862732 Added SDL_HINT_WINDOWS_RAW_MOUSE_NOLEGACY 2026-06-24 12:45:36 -07:00
Sam Lantinga 7be5990089 Removed redundant check for VK_SUCCESS
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Fixes https://github.com/libsdl-org/SDL/issues/15157
2026-06-23 08:59:16 -07:00
Sam Lantinga 284afc2c9a Set SDL_PROP_TEXTURE_GPU_TEXTURE_V_POINTER to the correct texture
Fixes https://github.com/libsdl-org/SDL/issues/15157
2026-06-23 08:57:49 -07:00
Sam Lantinga a45ef5dc64 Added RIDEV_NOLEGACY to improve performance in mouse relative mode (thanks @whrvt!)
This change also makes it so relative mode doesn't kick in until the mouse enters the window client area. This prevents relative mode from kicking in while clicking and dragging on the title bar, etc.
2026-06-23 07:10:25 -07:00
Sam Lantinga 07ecc125cf Added SDL_PIXELFORMAT_P408 and SDL_PIXELFORMAT_P416 2026-06-22 17:01:54 -05:00
Sam Lantinga c9b6581210 Added SDL_HINT_ENABLE_STEAM_SCREEN_KEYBOARD 2026-06-17 16:48:54 -07:00
Sam Lantinga 54e672ec0d Added a note about where to set global platform properties 2026-06-16 16:50:33 -07:00
Sam Lantinga ca66808c80 Reduce log message verbosity when shutting down KMSDRM
Fixes https://github.com/libsdl-org/SDL/issues/13569
2026-06-16 09:18:13 -07:00
Sam Lantinga 9c30a7cc82 Revert "Add an invalid #define for SDL_ThreadID() to SDL_oldnames.h (#15801)"
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
This reverts commit b04d026458.

This caused problems building sdl2-compat:
https://github.com/libsdl-org/sdl2-compat/actions/runs/27378527337/job/81120423041
2026-06-12 14:59:22 -07:00
Sam Lantinga 0d971b1372 Use GetTempPathW() instead of GetTempPath2W()
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
GetTempPath2() is only available on Windows 11 and Windows 10 systems with full updates. We want to be compatible back to earlier versions of Windows and the only difference between the two calls is the behavior for processes running as SYSTEM, which we don't expect for SDL applications using notifications.
2026-06-11 13:31:12 -07:00
Sam Lantinga e0a935d910 Fixed warning: a function declaration without a prototype is deprecated in all versions of C 2026-06-10 14:33:49 -07:00
Sam Lantinga 3ccd484bad Weak link the UserNotifications framework
Fixes https://github.com/libsdl-org/SDL/issues/15803
2026-06-10 14:17:53 -07:00
Sam Lantinga df294acbae Fixed error C2440: 'function': cannot convert from 'int (__cdecl *)(libusb_context *,libusb_device *,libusb_hotplug_event,void *)' to 'libusb_hotplug_callback_fn' 2026-06-10 13:29:23 -07:00
Sam Lantinga 1475239328 Added hotplug detection when using libusb
Also switched to a single thread for libusb read operations instead of one thread per device
2026-06-10 13:07:47 -07:00
Sam Lantinga 18fc4d931a Added support for Xbox controllers via libusb on macOS
A number of third party Xbox controllers are not supported by macOS, but work with libusb and the SDL HIDAPI driver.
2026-06-10 13:07:47 -07:00
Sam LantingaandGitHub 36f621842b Use the Microsoft provided GameInputCreate() function (#15797)
It does better version checking and has better compatibility.

This also fixes a crash in GameInputRedist.dll when attempting to load v3 when v2 is installed on the system. In this case, a thread is created in GameInputCreate() which is not cleaned up when the object is released, and can crash later with a NULL pointer dereference.
2026-06-10 12:57:43 -07:00
Sam Lantinga 64998d2bc8 Fixed a hang reading the Xbox report descriptor on macOS 2026-06-09 11:12:52 -07:00
Sam Lantinga c62cc657a2 Fixed the Xbox 360 Controller showing as a Steam Virtual Gamepad on macOS
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-06-09 10:33:51 -07:00
Sam Lantinga 47403eccd2 Fixed the Xbox 360 wireless adapter showing up as a controller 2026-06-08 21:31:20 -07:00
Sam Lantinga bef72ab488 Don't treat the IR receiver on the NVIDIA Shield TV as a joystick
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-06-08 14:45:26 -07:00
Sam Lantinga acc06bce35 android: fixed crash adding joysticks before joysticks are initialized
Fixes https://github.com/libsdl-org/SDL/issues/15777
2026-06-08 14:35:42 -07:00
Sam Lantinga 63a322cdd1 android: fixed ANR if we lose focus at startup
If we lose focus during startup, we need to unlock the activity mutex before waiting for the focus lifecycle event, otherwise it will never be delivered.

Reproduced using testcontroller with a DualSense controller attached and the "Allow the app to access the USB device?" dialog popped up.
2026-06-08 13:51:12 -07:00
Sam Lantinga f7a0ab3bbf Fixed ABBA deadlock on Android
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
This fixes a deadlock when a call comes in from Java that takes the activity lock and then tries to send an event, which takes the event lock, at the same time the application thread takes the event lock and then calls SDL_RequestAndroidPermission(), which takes the activity lock.

Fixes https://github.com/libsdl-org/SDL/issues/15772
Fixes https://github.com/libsdl-org/SDL/issues/15771
2026-06-08 09:16:51 -07:00
Sam Lantinga 55908f14f8 Added SDL_aligned_alloc_zero()
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-06-05 13:55:32 -07:00
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
Sam Lantinga 8549aae829 Make initializeDeviceListener() and shutdownDeviceListener() public 2026-06-04 09:26:33 -07:00
Sam Lantinga 36c5809b09 Added SDLControllerManager::shutdownDeviceListener() 2026-06-04 09:19:53 -07:00
Sam Lantinga e5bbef0dbc Fixed detecting PS4 controllers on Android 2026-06-04 09:19:28 -07:00
Sam Lantinga 42fc082b5e Fixed java.lang.NullPointerException
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
From @AntTheAlchemist:
This is an interesting one, on a Xiaomi MiTV. Caused by a camera device, full stack:
android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args -> org.libsdl.app.HIDDeviceManager$1.onReceive -> handleUsbDeviceAttached -> connectHIDDeviceUSB -> getSerialNumber -> android.hardware.usb.UsbDevice.getSerialNumber -> android.hardware.usb.IUsbSerialReader$Stub.onTransact -> com.android.server.usb.UsbSerialReader.getSerial -> UsbUserPermissionManager.checkPermission -> hasPermission -> isCameraDevicePresent
2026-06-02 16:51:58 -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
Sam Lantinga 75270a4264 Handle java.util.ConcurrentModificationException while unregistering sensor listeners
We're still seeing this frequently when unregistering PlayStation controller sensors. We don't know what else is modifying the sensor list, but if we end up getting this exception we'll retry after a short sleep.
2026-06-02 16:51:58 -07:00
Sam Lantinga 5ede4fbd08 Revert "vfork() isn't functional on DOS"
This reverts commit 91173aba25.

As @icculus mentioned: I'd rather we not get into the business of making fixes by tweaking values in the Preseed files. Were there no preseed file, CMake would correctly record that the vfork function exists, so if we're really hitting the vfork() codepath on DOS, we should stop that in either CMakeLists.txt itself, or in src/process.
2026-06-02 14:16:31 -07:00
Sam Lantinga 91173aba25 vfork() isn't functional on DOS 2026-06-02 12:23:14 -07:00