13879 Commits

Author SHA1 Message Date
Ryan C. Gordon
f2c12fe5f3
Removed TODO.txt
This is obviously not how we track bugs at this point.  :)
2023-11-16 08:47:37 -05:00
Sam Lantinga
d4448fe3d2 Update virtual joystick test now that we're just using abxy for mappings, for compatibility 2023-11-16 00:02:47 -08:00
Sam Lantinga
f40f272107 Fixed build 2023-11-15 23:58:39 -08:00
Sam Lantinga
34bdd321bf Improved navigation while setting up controller mapping
* Moving forward and backward don't clear the current binding
* Use the tertiary face button to delete the current binding
* More small improvements to make navigation more intuitive
2023-11-15 23:46:31 -08:00
Sam Lantinga
57e5c7f6ee We'll just use the legacy names for face buttons in the mappings
This fixes being able to accidentally rebind the face buttons in testcontroller
2023-11-15 22:09:09 -08:00
Sam Lantinga
051ed397d1 Removed testautomation_syswm.c from the Xcode project 2023-11-15 21:51:22 -08:00
Sam Lantinga
fb08c22abf Disable controller state debug messages 2023-11-15 21:46:45 -08:00
Sam Lantinga
2999634f29 Map Siri Remote touchpad to D-Pad for consistency with physicalInputProfile mapping 2023-11-15 21:04:25 -08:00
Sam Lantinga
2ff9255f29 Print the GUID for controllers that don't have a mapping 2023-11-15 21:04:25 -08:00
Sam Lantinga
64939d3586 Switch the menu button on the Apple TV remote to the B button to match UI guidelines 2023-11-15 21:04:25 -08:00
Sam Lantinga
0fe5713964 Improved GCController handling on Apple platforms
Automatically map controllers as gamepads when using the GCController framework and prefer the physicalInputProfile when possible.

Testing with macOS 13.4.1, macOS 14.1.1, iOS 15.7.4, tvOS 17.1:
* iBuffalo Classic USB Gamepad (macOS only)
* Logitech F310 (macOS only)
* Apple TV remote (tvOS only)
* Nimbus MFi controller
* PS4 DualShock controller
* PS5 DualSense controller
* Xbox Series X controller
* Xbox Elite Series 2 controller
* Nintendo Switch Pro controller
* Nintendo Switch Joy-Con controllers
2023-11-15 21:04:25 -08:00
Sam Lantinga
aaf54b09a1 Revert "Cleanup WIN_CreateCursor() code a bit"
This reverts commit 876c97454a954a70da8b8b3d8b09b52674534062.

This caused the blank cursor to be entirely black
2023-11-15 11:32:06 -08:00
Ryan C. Gordon
e923a458ea
audio: Protect against race conditions when closing a physical device.
This specifically deals with two threads closing the same device at the same
time, and a thread trying to reopen the device as it's still in process of
being closed. This can happen in normal usage if a device is disconnected:
the OS might send a disconnect event, while the device thread also attempts
to manage a disconnect as system calls start to report failure.

This effort is necessary because we have to release the device lock during
close to allow the device thread to unblock and cleanly shutdown. But the
good news is that all the places that call ClosePhysicalAudioDevice can now
safely hold the device lock on entry, and that one function will manage the
lock tapdancing.
2023-11-15 14:17:14 -05:00
Ryan C. Gordon
8fa0746d4a
audio: Fix postmix state when migrating to new default devices.
Otherwise buffers might not be allocated, etc.
2023-11-15 14:17:13 -05:00
Frank Praznik
078995bbe0 x11: Set the skip taskbar and skip pager atoms on utility windows
Some compositors apparently still need these set to keep the window out of the taskbar and pager, even with the utility window atom being set.
2023-11-15 04:43:37 -05:00
Ryan C. Gordon
a58af6d0d1
wasapi: Reference devices when proxying to management thread.
Otherwise, a disconnect/default change on another thread may cause the
device pointer to become invalid by the time the management thread runs the
task.
2023-11-14 16:20:14 -05:00
Sam Lantinga
34392db9c3 Fixed IOS_SupportedHIDDevice() returning SDL_FALSE before initialization 2023-11-14 10:57:47 -08:00
Sam Lantinga
708f18d49e Added SDL_HINT_JOYSTICK_IOKIT and SDL_HINT_JOYSTICK_MFI to control whether the IOKit and GCController drivers should be used for joystick support.
This can be used to work around issues where the Apple GCController driver doesn't work for some controllers but there's no way to know which GCController maps to which IOKit device.
2023-11-14 10:28:19 -08:00
Louis M
bd4966999b Replacing SDL_SCANCODE_AUDIOMUTE by SDL_SCANCODE_MUTE on Windows
(cherry picked from commit 925362a2fcf0a7065ade5e9e55572c377d716edd)
2023-11-14 09:27:43 -08:00
Sam Lantinga
15504da0b8 Fixed mouse wheel scrolling direction on iOS 2023-11-14 09:10:56 -08:00
Sam Lantinga
f5600fd9f4 Fall back to using the physical profile for Apple controllers if they don't match a standard profile
We may want to flip this to be the default, but it needs more testing.
2023-11-14 06:29:09 -08:00
Sam Lantinga
924de4df48 Enable transparent windows when using the D3D11 renderer
Note that this will not work with D3D12, as DXGI_SWAP_EFFECT_DISCARD is not available there.
2023-11-14 06:06:51 -08:00
Sam Lantinga
1c64366b80 Added SDL_CreateRendererWithProperties() and SDL_CreateTextureWithProperties() 2023-11-14 06:06:51 -08:00
Sam Lantinga
7203641597 Note that the SDL window properties are read-only 2023-11-14 06:06:51 -08:00
Sam Lantinga
e0c45c6c98 Renamed SDL_WINDOW_FOREIGN to SDL_WINDOW_EXTERNAL 2023-11-14 06:06:51 -08:00
Sam Lantinga
229b7b9d50 SDL_CreateWindowWithPosition() and SDL_CreateWindowFrom() have been replaced with SDL_CreateWindowWithProperties()
This is a more general interface that can be extended in the future as needed.
2023-11-14 06:06:51 -08:00
Sam Lantinga
2c1fbe1967 Revert "Check to make sure the Windows joystick device has buttons and axes"
This reverts commit ad0af488837e44cbea0f0eab3b2f73b50a74bff4.

It turns out the ROG PUGIO II actually enumerates as a gamepad, so this change didn't have any effect anyway. We're getting lots of reports of people's racing pedals and similar devices no longer showing up, so we'll revert this again.

Fixes https://github.com/libsdl-org/SDL/issues/8227
Fixes https://github.com/libsdl-org/SDL/issues/8484
2023-11-13 21:33:09 -08:00
Sam Lantinga
edd044e901 Fixed the ROG PUGIO II showing up as a game controller
This mouse actually enumerates as a gamepad with 2 axes, 8 buttons and a hat.

We'll ignore it like the other ROG mice, unless someone specifically wants to use it as a gamepad.
2023-11-13 21:32:41 -08:00
Frank Praznik
861b1ebd12 properties: Use a mutex instead of an RWLock to guard the hash table
The hash table can be recursively locked from the same thread, which can cause issues with RWLocks, as locking them recursively can result in undefined behavior or deadlocks. Use a mutex instead, as it can be safely recursively locked.
2023-11-13 18:28:24 -05:00
Ryan C. Gordon
dd8ab67bd9
Sync wiki -> headers. 2023-11-13 15:46:29 -05:00
Ryan C. Gordon
91460fc13d
include: Fixed up documentation in SDL_pen.h 2023-11-13 15:40:55 -05:00
Dimitriy Ryazantcev
876c97454a Cleanup WIN_CreateCursor() code a bit
Closes #6476
2023-11-13 11:46:50 -08:00
Ryan C. Gordon
8766aa39d6
Sync wiki -> headers. 2023-11-13 13:03:42 -05:00
Ryan C. Gordon
e5ffd6d8eb
include: Removed \link and \endlink Doxygen tags. 2023-11-13 13:01:25 -05:00
Sam Lantinga
1c4723ac66 SDL_CreateWindowFrom() now takes a set of properties that describe the native window and options. 2023-11-12 21:58:58 -08:00
Sam Lantinga
6afae6681b Allow casting properties of different types 2023-11-12 21:58:58 -08:00
Sam Lantinga
bd269b0f41 Added SDL_SetBooleanProperty() and SDL_GetBooleanProperty() 2023-11-12 21:58:58 -08:00
Ryan C. Gordon
c47ac5b2df
include: Fixed copy/paste error 2023-11-12 23:41:22 -05:00
Ryan C. Gordon
0efb3d90e0
audio: removed a fixed FIXME comment. 2023-11-12 23:41:22 -05:00
nia
69cae07cc1 cpuinfo: Fix detection of physical memory above 2GB on NetBSD
Rework the code to clearly prefer 64-bit sysctls first, then
legacy sysctls, and eliminate a second ifdef.

Signed-off-by: Nia Alarie <nia@NetBSD.org>
2023-11-12 18:12:18 -08:00
Ozkan Sezer
45fc828c95 move SDL_EVENT_WINDOW_PEN_ENTER and SDL_EVENT_WINDOW_PEN_LEAVE down
... to preserve compatibility with sdl2-compat.
2023-11-12 12:22:43 -08:00
Sam Lantinga
0907f345cb Added property types: pointer, string, number, float 2023-11-12 10:48:38 -08:00
Christoph Reichenbach
7c80ac6df7 API for pressure-sensitive pens + XInput2/Wayland
This patch adds an API for querying pressure-
sensitive pens, cf. SDL_pen.h:
- Enumerate all pens
- Get pen capabilities, names, GUIDs
- Distinguishes pens and erasers
- Distinguish attached and detached pens
- Pressure and tilt support
- Rotation, distance, throttle wheel support
  (throttle wheel untested)
- Pen type and meta-information reporting
  (partially tested)

Pen event reporting:
- Three new event structures: PenTip, PenMotion, and
  PenButton
- Report location with sub-pixel precision
- Include axis and button status, is-eraser flag

Internal pen tracker, intended to be independent
of platform APIs, cf. SDL_pen_c.h:
- Track known pens
- Handle pen hotplugging

Automatic test:
- testautomation_pen.c

Other features:
- XInput2 implementation, incl. hotplugging
- Wayland implementation, incl. hotplugging
- Backward compatibility: pen events default to
  emulating pens with mouse ID SDL_PEN_MOUSEID
- Can be toggled via SDL_HINT_PEN_NOT_MOUSE
- Test/demo program (testpen)
- Wacom pen feature identification by pen ID

Acknowledgements:
- Ping Cheng (Wacom) provided extensive feedback
  on Wacom pen features and detection so that
  hopefully untested Wacom devices have a
  realistic chance of working out of the box.
2023-11-12 09:52:02 -08:00
Sam Lantinga
d3e43668d0 Revert "Sync SDL3 wiki -> header"
This reverts commit 43571769f16b45ddcb9d7dd1d4c6e21cd39e691e.
2023-11-12 09:02:22 -08:00
SDL Wiki Bot
43571769f1 Sync SDL3 wiki -> header 2023-11-12 15:55:10 +00:00
Sam Lantinga
843873626c Handle window resizing on the render thread in D3D11 and D3D12
This prevents crashing when a separate thread is being used for rendering

Discussion and sample code in https://github.com/libsdl-org/SDL/issues/8528
2023-11-11 12:49:53 -08:00
Sam Lantinga
f66f61de01 Fixed missing "0" in the button list 2023-11-11 08:30:13 -08:00
Sylvain Becker
04b6b2979f
Re-add SDL_assert() with non boolean ptr syntax (#8530) 2023-11-11 12:28:24 +03:00
Sam Lantinga
b374105975 Replaced SDL_GetTextureDXGIResource() with texture properties
Fixes https://github.com/libsdl-org/SDL/issues/8529
2023-11-10 20:38:13 -08:00
Sam Lantinga
09d1e9defb Only update the battery status for Bluetooth Switch Pro controllers
Controllers that are plugged in are in the wired state
2023-11-10 17:09:39 -08:00