Commit Graph
100 Commits
Author SHA1 Message Date
Sam Lantinga ab17d66884 Make sure the surface used for a software renderer is a valid format
Fixes https://github.com/libsdl-org/SDL/issues/13323
2025-09-07 12:55:33 -07:00
Sam Lantinga 9ccdaa49f4 Removed reference to icon-alpha.bmp
This file was never added, and I believe this just had a 50% alpha channel added to the standard icon.bmp

Fixes https://github.com/libsdl-org/SDL/issues/13394
2025-09-07 12:54:14 -07:00
Sam Lantinga cd6b68a9fb Define the behavior of a negative width or height passed to SDL_RenderFillRect()
The software renderer now matches the 3D renderer behavior by rendering a reversed rectangle (extending width or height in the opposite direction) when width or height is negative. It also now renders no rectangle if the width and height are 0.

Fixes https://github.com/libsdl-org/SDL/issues/13400
2025-09-07 12:28:37 -07:00
Sam Lantinga ec33da05b3 Added SDL_HINT_RENDER_DIRECT3D11_WARP
Fixes https://github.com/libsdl-org/SDL/issues/13002
2025-09-07 11:00:59 -07:00
Sam Lantinga 466f93aee1 Fixed pitch and chroma issues with the Vulkan planar YUV texture update functions
Fixes https://github.com/libsdl-org/SDL/issues/13734
2025-09-07 10:19:00 -07:00
Sam Lantinga 2304047c95 testyuv: enable testing planar YUV texture update functions 2025-09-07 10:19:00 -07:00
Sam Lantinga 25d9096d41 Fixed rumble strength on DualSense Edge and Bluetooth connected controllers
Fixes https://github.com/libsdl-org/SDL/issues/13771
2025-09-06 11:53:32 -07:00
Sam Lantinga fb2daa2f5f Updated the documentation for SDL_GetRenderLogicalPresentation()
Fixes https://github.com/libsdl-org/SDL/issues/13791
2025-09-06 11:21:36 -07:00
Sam Lantinga d03f3e11f6 Change the default YUV colorspace to SDL_COLORSPACE_BT601_LIMITED
This was the default for SDL2 and what people expect, migrating code.

Fixes https://github.com/libsdl-org/SDL/issues/13796
2025-09-06 11:04:25 -07:00
Sam Lantinga 02fc571cfd Fixed build 2025-09-06 10:12:01 -07:00
Sam Lantinga 5605f85d84 Check the return value of SDL_SW_CopyYUVToRGB() 2025-09-06 10:07:09 -07:00
Sam Lantinga d21da8644b Revert "Make sure fast path RGB <-> YUV conversions are using the same color primaries"
This reverts commit ee87132385.

The supported conversions assume correct primaries for YUV converted to SRGB
2025-09-06 10:03:41 -07:00
Sam Lantinga 61e41c61dc Select the shader based on the inputs, not colorspace
Fixes https://github.com/libsdl-org/SDL/issues/13880
2025-09-06 08:58:17 -07:00
Sam Lantinga c573326f11 Fixed double-free in the OpenVR video backend 2025-09-05 14:47:20 -07:00
Sam Lantinga 3572be3998 Improved detection of FlyDigi controllers 2025-09-04 18:21:17 -07:00
Sam Lantinga a9b5a1e785 Simplified the transparent software renderer test 2025-09-04 10:31:22 -07:00
Sam Lantinga f48c20f481 Added testsoftwaretransparent to the CMake build system 2025-09-04 09:25:05 -07:00
Sam Lantinga 9e3d5969e6 Fixed testsoftwaretransparent on platforms using a renderer for window surfaces 2025-09-04 09:24:22 -07:00
Sam Lantinga ea1a769322 Fixed the perspective matrix calculation (thanks @KonkolyTamas!)
Fixes https://github.com/libsdl-org/SDL/issues/13867
2025-09-04 06:04:01 -07:00
Sam Lantinga 637a9b34ab Added a comment explaining the initialization delay 2025-09-03 15:47:21 -07:00
Sam Lantinga b6a55c2856 Wait a bit for initialization to complete before requesting calibration data
Fixes https://github.com/libsdl-org/SDL/issues/13856
2025-09-03 15:36:58 -07:00
Sam Lantinga 9abeeebad5 Fixed warning: no previous prototype for function 2025-09-03 11:23:55 -07:00
Sam Lantinga 437d78499c Don't set SDL_SURFACE_LOCK_NEEDED until a surface is RLE encoded
Reference https://github.com/libsdl-org/sdl2-compat/issues/476
2025-09-02 21:31:51 -07:00
Sam Lantinga fbbc29159a Leave letterbox borders set to the frame clear color
Fixes https://github.com/libsdl-org/sdl2-compat/issues/483
2025-09-02 20:14:34 -07:00
Sam Lantinga ef19c72015 Set the texture scale and address mode when creating a texture
Fixes https://github.com/libsdl-org/sdl2-compat/issues/506
2025-09-02 18:05:31 -07:00
Sam Lantinga 84af0bb53a Updated the 8BitDo Ultimate 2 Wireless Controller dongle update rate
The latest dongle firmware appears to update at 1000Hz
2025-09-02 09:53:09 -07:00
Sam Lantinga a562e40d2c Revert "Disable rumble for the Ultimate 2 Wireless Controller in dongle mode"
This reverts commit 065fdca953.

8BitDo has fixed the rumble issue with dongle firmware update V1.05
2025-09-02 09:53:09 -07:00
Sam Lantinga b47572c9bb Fixed build warning with Visual Studio 2025-09-02 09:53:09 -07:00
Sam Lantinga 1f007ad5cd Added support for the player LED on Nintendo Switch 2 controllers 2025-09-01 21:11:16 -07:00
Sam Lantinga 4b93e7488f Added support for the Switch 2 Joy-Cons with charging grip 2025-09-01 21:11:16 -07:00
Sam Lantinga 7c8df4ea52 Fixed warnings building with Visual Studio 2025-08-30 10:15:58 -07:00
Sam Lantinga 3cf2350f21 Fixed build 2025-08-30 10:15:32 -07:00
Sam Lantinga fa52949529 Added a note that we dynamically load libusb 2025-08-28 09:13:01 -07:00
Sam Lantinga 1a653f7f89 Exported SDL_hid_get_properties() 2025-08-28 09:13:01 -07:00
Sam Lantinga ac5ccbe386 Moved Nintendo Switch 2 Controller initialization from hid.c to SDL_hidapi_switch2.c 2025-08-28 09:10:47 -07:00
Sam Lantinga 65c1fc1b42 Added SDL_hid_get_properties() 2025-08-28 09:10:47 -07:00
Sam Lantinga 09ca7e8f64 Move libusb support into a shared location 2025-08-28 09:10:47 -07:00
Sam Lantinga cdae0d10d1 Fixed button mapping for the Nintendo Switch 2 Pro Controller 2025-08-28 09:10:47 -07:00
Sam Lantinga fb9fcfa37b Fixed controller name when hotplugging the Nintendo Switch 2 Pro Controller 2025-08-28 09:10:47 -07:00
Sam Lantinga 2bb51e1340 Claim the interface before doing bulk transfers 2025-08-28 09:10:47 -07:00
Sam Lantinga 5d9b170a3d Be explicit that SDL_FLIP_HORIZONTAL_AND_VERTICAL combines horizontal and vertical flipping
Closes https://github.com/libsdl-org/SDL/pull/13821
2025-08-28 04:22:31 -07:00
Sam Lantinga 285df94623 Renamed SDL_GPURenderStateDesc to SDL_GPURenderStateCreateInfo for consistency with GPU API conventions
Fixes https://github.com/libsdl-org/SDL/issues/12817
2025-08-27 09:14:19 -07:00
Sam Lantinga da6e9bbf7c Allow building the tray subsystem without the video subsystem
Fixes https://github.com/libsdl-org/SDL/issues/13235
2025-08-27 08:15:24 -07:00
Sam Lantinga 42f634ff7a Added SDL_AddAtomicU32()
Fixes https://github.com/libsdl-org/SDL/issues/13496
2025-08-27 06:44:51 -07:00
Sam Lantinga 5291e9bbbd Minor cleanup 2025-08-26 19:28:59 -07:00
Sam Lantinga 065fdca953 Disable rumble for the Ultimate 2 Wireless Controller in dongle mode
The dongle appears to stop sending input reports with some combination of rumble patterns, easily reproduced with Forza Horizon 5. We'll disable rumble temporarily until @8BitDo can investigate.
2025-08-26 08:39:00 -07:00
Sam Lantinga 66ab91a314 Added SDL_FLIP_HORIZONTAL_AND_VERTICAL
Closes https://github.com/libsdl-org/SDL/pull/13788
2025-08-26 05:50:51 -07:00
Sam Lantinga b13416d74f Fixed relative motion having desktop mouse scale on Wayland
Fixes https://github.com/libsdl-org/SDL/issues/13753
2025-08-25 11:47:56 -07:00
Sam Lantinga 7bbbbb3a1c Fixed build 2025-08-25 09:45:39 -07:00
Sam Lantinga aab95894a6 Fixed crash if mouse functions are used after video quit 2025-08-25 08:54:43 -07:00
Sam Lantinga 5f77da3a50 x11: use raw values for relative mouse motion
Fixes https://github.com/libsdl-org/SDL/issues/13743
2025-08-14 19:30:54 -07:00
Sam Lantinga fe16c620d8 Fix crash when enumerating Steam Controllers
Closes https://github.com/libsdl-org/SDL/pull/13746
2025-08-14 14:49:04 -07:00
Sam Lantinga 2d855e12d2 Fixed style 2025-08-14 14:48:58 -07:00
Sam Lantinga 20df88a85b Fixed spacing 2025-08-14 14:44:56 -07:00
Sam Lantinga e11110400a Fixed crash when reinitializing video on X11
The keyboard keymap was left pointing at a freed keymap after X11_QuitKeyboard()
2025-08-14 13:41:40 -07:00
Sam Lantinga f934b3e066 x11: fixed creating a window when all displays are disconnected
The X server maintains the desktop, but XRandR sends disconnect notifications for all displays. In this case fall back to the generic X11 desktop as a display.
2025-08-13 19:44:13 -07:00
Sam Lantinga eeae48464e Fixed crash if X11 initialization fails 2025-08-13 19:44:13 -07:00
Sam Lantinga 4725213eef Support the "ambient" value for SDL_HINT_AUDIO_CATEGORY
Fixes https://github.com/libsdl-org/SDL/issues/13732
2025-08-12 09:54:20 -07:00
Sam Lantinga 40ec9592f1 Restored text missing during wiki sync (thanks @sezero!) 2025-08-09 22:07:14 -07:00
Sam Lantinga 6981522cd6 Revert "Support Google Play 16 KB Page Size Requirement (#13470)"
This reverts commit dc2c83c383

If you need to support the Google Play 16 kiB page size requirement, the recommendation is to use NDK r28c or newer, which automatically aligns binaries correctly.
2025-08-07 11:44:45 -07:00
Sam Lantinga 91be1b054a x11: Fix xsettings pointer not being reset in X11_QuitXsettings 2025-08-06 09:22:33 -07:00
Sam Lantinga 31ba7efa48 x11: Refactor dpi hooks, removing GTK dependency and fixing XSettings watcher
- Removed GTK signal handler in x11settings. XSettings events are now properly dispatched to X11_XsettingsNotify.
  Previously events were not being passed to xsettings-client as no SDL xsettings_window was created. Now all events
  are filtered through xsettings_client_process_event allowing it to process the external window events that are selected.
  Global content scale is updated for changes to any recognized dpi settings.

- X11_GetGlobalContent now reads the current RESOURCE_MANAGER prop off of the root window to ensure it sees the
  current value. XResourceManagerString is now only used if getting the current prop fails as it caches the current resource
  manager value per-display connection.

- Clean up some warnings in SDL_gtk.
2025-08-06 09:22:15 -07:00
Sam Lantinga aae7736ec6 Added additional examples of paddle and misc buttons (thanks @AL2009man!) 2025-08-05 12:01:31 -07:00
Sam Lantinga 293b8b9fd6 x11: Fix regression reading GNOME content scale
- Removed gtk-xft-dpi read from GetGlobalContentScale. Xrm either returns either the same value as gtk-xft-dpi or the integer
  scale value in cases where gtk-xft-dpi is 1.

- Refactor SDL_x11settings handlers to defer to GetGlobalContentScale

- GetGlobalContentScale is now exported and the XSettings and Gtk signal handlers now use it for consistency. This involves
  a bit of extra work reading from Xrm rather than the setting notification but ensures consistent handling based on signal
  origin and hints enabled.

- Hook both gtk-xft-dpi in SDL_x11settings. This should generally result in only one being called based on which is updated.
  Since both signal handlers defer to X11_GetGlobalContentScale this will cause the same content scale to be applied multiple
  times. The gtk-xft-dpi signal is now only used to trigger content scale updates when the XSettings notification does not occur.
2025-08-04 16:53:09 -07:00
Sam Lantinga 7bb045ca22 Fixed Windows build 2025-08-04 13:04:17 -07:00
Sam Lantinga 9a71e3fd50 Revert "Add SDL_IsTraySupported"
This reverts commit 47d8bdd1c3.

There are runtime reasons why creating a tray can fail, so the correct approach is not to assume that just because a platform supports a tray that trays are available. Instead, you should create a tray at application startup, for the lifetime of the application, and handle failures at that point.

Closes https://github.com/libsdl-org/SDL/pull/13632
2025-08-04 10:42:43 -07:00
Sam Lantinga bba6555bf1 Enable background input when using Microsoft GameInput 2025-08-04 10:21:58 -07:00
Sam Lantinga 8dedf44929 Fixed warning: initialization of pointer of type 'VkSampler' (aka 'struct VkSampler_T *') to null from a constant boolean expression
Fixes https://github.com/libsdl-org/SDL/issues/13628
2025-08-03 07:24:51 -07:00
Sam Lantinga 8796f0a8ed SDL_gtk: Prevent loading GTK-3 if a different version of GTK is already loaded
- gtk_init_check claims it will not terminate the program on failure, however this is does
  not apply to the internal check it performs to see whether another GTK library is already
  loaded, the detection of which triggers a g_error which glib treats as fatal.

- gtk_progress_get_type and gtk_misc_get_type are checked to match the checks done
  by _gtk_module_has_mixed_deps.

- Clean up gtk/gdk loading. There are no library fallbacks so the one option available can
  be loaded rather than iterating through a list of one item.
2025-08-01 17:44:22 -07:00
Sam Lantinga 2989d0c420 Fixed build 2025-07-31 10:18:05 -07:00
Sam Lantinga 88cbe85fe2 Added missing files 2025-07-31 08:57:59 -07:00
Sam Lantinga 26c41f3f9a Fix Android build
- Android defines SDL_PLATFORM_UNIX but does not compile core/unix sources
  so add checks for SDL_PLATFORM_ANDROID where SDL_gtk is used.

- Fix missing void parameter list in SDL_Gtk_EnterContext.

- Remove unneeded SDL_gtk.h include in SDL_events.c
2025-07-31 08:49:40 -07:00
Sam Lantinga bf7b4d4a9e x11: Add GTK signal handler for gtk-xft-dpi and reader in GetGlobalContentScale
- This is to support dynamic updates of content scale when running in XWayland. The GTK signal is
  preferred over the XSettings watcher and Xrm database if supported as it will trigger and update
  for both native X11 and XWayland on changes to Xft.dpi.
2025-07-31 08:49:36 -07:00
Sam Lantinga 3c369aa8b4 unix: Refactor GTK bindings from SDL_tray to separate SDL_gtk module to allow shared usage
- SDL creates and requires usage of a specific glib context. This context is set as the global
  glib context with SDL_Gtk_EnterContext and the previous context is restored with
  SDL_Gtk_ExitContext.

- To avoid changing the behavior of SDL_tray, which is the only consumer of SDL_gtk currently,
  the SDL_UpdateTray function now unconditionally runs a single glib frame iteration and is
  responsible for dispatching glib events for all consumers in SDL_PumpEvents.

- Cleaned up some error handling in SDL_tray.
2025-07-31 08:49:31 -07:00
Sam Lantinga c663b6ec1f Don't leave garbage in output parameters 2025-07-29 20:48:56 -07:00
Sam Lantinga 25cf1a569c Map GameCube controller trigger clicks as misc3 and misc4
This is for consistency with the GC Ultimate controller and allows binding in Steam
2025-07-28 13:11:07 -07:00
Sam Lantinga 72b7fd10b4 Fixed warning: 'break' will never be executed 2025-07-25 16:20:44 -07:00
Sam Lantinga 970234d62d Fixed documentation for aligned structure members 2025-07-25 13:33:49 -07:00
Sam Lantinga e5d57d8ad6 Fixed building with GameInput v1.0 2025-07-24 10:52:09 -07:00
Sam Lantinga 0ee0fe1572 Fixed building with GameInput v1.0 2025-07-24 10:42:28 -07:00
Sam Lantinga 66dad9c21f Added Steam Virtual Gamepad support to the GameInput driver 2025-07-24 10:36:09 -07:00
Sam Lantinga 6babade758 Fixed double SDL_EVENT_GAMEPAD_ADDED for controllers with automatic gamepad mappings 2025-07-24 10:36:09 -07:00
Sam Lantinga 3fdd15adaa Fixed double-release of GameInput at shutdown 2025-07-24 10:36:09 -07:00
Sam Lantinga fc19ae343c Updated SDL_IsJoystickSInputController() to match style in file 2025-07-21 11:38:54 -07:00
Sam Lantinga 86200d1203 Fixed clamp texture address mode in software renderer 2025-07-21 10:20:16 -07:00
Sam Lantinga ad52ebf985 Fixed build 2025-07-17 20:56:41 -07:00
Sam Lantinga e70ecb37c1 Implement the D-pad as a hat for SInput controllers
This lets games that use the joystick API handle the D-pad the same way as other controllers
2025-07-17 20:51:29 -07:00
Sam Lantinga 8f79a6185a Fixed the mapping for the GC Ultimate controller 2025-07-17 19:32:46 -07:00
Sam Lantinga de20b731f2 Removed unnecessary cast 2025-07-17 19:32:29 -07:00
Sam Lantinga ada44eaa10 testcontroller: reverted GameInput test code 2025-07-17 18:41:43 -07:00
Sam Lantinga 3b9db3dd62 Added support for Windows GameInput 2.0 2025-07-17 15:38:39 -07:00
Sam Lantinga 855d28e97a Fixed crash if a clipboard event was sent with video uninitialized
This can happen if you're using SDL on Android without using the video subsystem.
2025-07-17 08:47:32 -07:00
Sam Lantinga 7510a67159 Fixed typo
Fixes https://github.com/libsdl-org/SDL/issues/13373
2025-07-16 19:31:10 -07:00
Sam Lantinga a53eb5221b Added support for the PDP REALMz Wireless Controller for Switch 2025-07-15 17:41:54 -07:00
Sam Lantinga 1b65f25465 testcontroller: use the correct label for face buttons 2025-07-15 15:52:40 -07:00
Sam Lantinga 08e3758e3f Added paddle bindings for the 8BitDo Pro 3 controller 2025-07-15 10:15:52 -07:00
Sam Lantinga d53fcab609 Reordered the 8BitDo Pro 3 controller 2025-07-15 10:09:06 -07:00
Sam Lantinga 277f91c317 Removed the Mayflash GameCube adapter from the PS3 controller list 2025-07-14 11:30:15 -07:00
Sam Lantinga 92e8224d32 Fixed build 2025-07-11 13:05:37 -07:00
Sam Lantinga 0b2e389ee3 Fixed long delay when enumerating the Razer Huntsman keyboard
Fixes https://github.com/libsdl-org/SDL/issues/13236
2025-07-11 12:34:14 -07:00