Commit Graph

10323 Commits (5ffede35d94e2ba513114996447df9484e195ac6)

Author SHA1 Message Date
Sam Lantinga a547c185ce Fixed crash if uevent info isn't available 2022-08-08 12:21:40 -07:00
Sam Lantinga 7530bd74b3 Fix right, bottom computation in `SDL_GetClosestPointOnRect` which should be exclusive, not inclusive 2022-08-08 11:26:55 -07:00
Sam Lantinga 98bac00dcc Add `SDL_GetPointDisplayIndex` and `SDL_GetRectDisplayIndex` and re-implement `SDL_GetWindowDisplayIndex` in terms of `SDL_GetRectDisplayIndex`
- This allows looking up the display index for an arbitrary location rather than requiring an active window to do so.

- This change also reimplements the fallback display lookup that found the display with center closest to the window's center to instead find the display rect edge
  closest to the window center (this was done in the almost identical display lookup used in SDL_windowsmodes.c, which now uses `SDL_GetPointDisplayIndex`). In
  practice this should almost never be hit as it requires the window's center to not be enclosed by any display rect.
2022-08-08 11:26:52 -07:00
Francisco Javier Trujillo Mata 20f9a1b8a4 Implement SetTextureScaleMode 2022-08-08 09:34:08 -07:00
Sam Lantinga 47ebf0087a Fixed shadow variable warning 2022-08-08 08:36:17 -07:00
Francisco Javier Trujillo Mata d355ea9981 Add a way to avoid IOP reset 2022-08-08 08:32:38 -07:00
Francisco Javier Trujillo Mata c5fe234d53 Improve SDL main adding usb drivers 2022-08-08 08:32:38 -07:00
Francisco Javier Trujillo Mata 0a307628e6 Fix wrong mapping in some ps2 controller keys 2022-08-08 08:32:11 -07:00
Aaron Barany 3f19e36d12 Disable declaration-after-statement warning on Android
External .c files are brought in that don't adhere to this requirement for
pre-C99 code and causes the build to break with the latest NDK.

Fixes #6019
2022-08-08 08:31:40 -07:00
Adam Butcher 0bcbdfe2bd video: dummy: Support evdev psuedo-device with no video. 2022-08-08 08:31:04 -07:00
Sam Lantinga 8f05b4f833 Fixed iOS/tvOS build 2022-08-08 08:26:21 -07:00
Sam Lantinga 878259722f Added SDL_GameControllerType enumeration for Nintendo Switch Joy-Con controllers 2022-08-08 08:22:20 -07:00
Sam Lantinga 4f19421ed8 Fixed build 2022-08-07 20:17:40 -07:00
Sam Lantinga 29265d0738 Use SDL_GetStringBoolean() to parse the hint value 2022-08-07 18:49:30 -07:00
Adam Butcher 8f5932dc2e evdev: Support user-provided devices via SDL_EVDEV_DEVICES in non-udev mode. 2022-08-07 16:37:07 -07:00
Pierre Wendling f790fc4fc0 Add contributing guidelines. 2022-08-07 16:34:52 -07:00
Sam Lantinga 198d62d813 joystick: remove unused Xbox Controller Keyboard VID/PID.
0x045e, 0x0b02 - is actually virtual keyboard that is generated by XboxGip drivers for Xbox One Controllers.

Closes https://github.com/libsdl-org/SDL/pull/5121
2022-08-06 23:53:18 -07:00
Sam Lantinga 2909f63743 Revert "Enable bitcode by default for iOS and tvOS builds"
This reverts commit 59963473ef.

This fixes https://github.com/libsdl-org/SDL/issues/6015

Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14.

Xcode no longer builds bitcode by default and generates a warning message if a project explicitly enables bitcode: “Building with bitcode is deprecated. Please update your project and/or target settings to disable bitcode.” The capability to build with bitcode will be removed in a future Xcode release. IPAs that contain bitcode will have the bitcode stripped before being submitted to the App Store. Debug symbols for past bitcode submissions remain available for download. (86118779)
2022-08-06 23:28:39 -07:00
Frank Praznik dd2e318211 wayland: Use libdecor visibility toggle for hiding/showing the window
The current method of toggling the libdecor window visibility by destroying and recreating the frame results in a race where a use-after-free bug can manifest itself within libdecor when window visibility is toggled quickly. Instead, use the libdecor function for toggling visibility instead of destroying and recreating the frame every time.
2022-08-06 12:12:21 -07:00
Francisco Javier Trujillo Mata fbb440d167 Invalidate texture in the UnlockTextureMethod 2022-08-06 12:11:34 -07:00
Sam Lantinga 52bf5b1de9 Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED to control whether the player LED is set on Nintendo Switch controllers 2022-08-06 10:34:19 -07:00
Sam Lantinga f810dede16 Fixed comment so script processing works correctly 2022-08-06 09:50:13 -07:00
SDL Wiki Bot bdaf9a92a6 Sync SDL wiki -> header 2022-08-06 13:25:12 +00:00
Ryan C. Gordon f600364b8a
wayland: Mark window as MOUSE_CAPTURE while a mouse button is down.
Wayland works like SDL's "auto capture" feature already, tracking the mouse
globally only while a drag is occuring, and this is the only way to get mouse
input outside the window.

Setting this flag ourselves lets SDL_CaptureMouse() work in the most common
use case without actually implementing CaptureMouse for the backend, including
SDL's auto capture feature.

Fixes #6010.
2022-08-06 09:19:52 -04:00
Ryan C. Gordon e2452ede66
include: Added documentation to SDL_CaptureMouse about auto-capture. 2022-08-06 09:19:10 -04:00
Ryan C. Gordon a6179e85c0
wayland: Don't double-free clipboard sources if ours gets cancelled.
Fixes #6007.
2022-08-05 21:25:00 -04:00
Francisco Javier Trujillo Mata 3da131c1c6 Check if port if closed and open it again 2022-08-05 17:44:59 -07:00
Sam Lantinga 5858c7dfce Fixed OpenGL ES Shaders for systems that don't understand precision keywords 2022-08-05 16:17:10 -07:00
Frank Praznik 3685c64ed1 wayland: Round trip after window show/hide operations.
Perform a round trip after showing/hiding the window to avoid protocol errors when ShowWindow() is called immediately after HideWindow().
2022-08-05 15:03:54 -07:00
Anonymous Maarten 17b329d199 cmake: enable disabing hidapi 2022-08-05 13:06:51 -07:00
Anonymous Maarten a4e6f3ca9d cmake: when there are alternatives, don't use libusb by default 2022-08-05 13:06:51 -07:00
Sam Lantinga d6a8b43cf7 Added support for the HORIPAD FPS for Nintendo Switch 2022-08-05 10:37:38 -07:00
Francisco Javier Trujillo Mata a2d3be904b Implement create windows method 2022-08-04 15:41:43 -07:00
Sam Lantinga 4a9ceb7be9 The HORIPAD S uses the Xbox 360 protocol on all platforms and shows up as multiple styles of controller, depending on what model you have. 2022-08-04 11:33:36 -07:00
Sam Lantinga 28c01955bc Fixed button mapping for the HORIPAD S
This controller actually comes in at least two flavors: a GameCube controller and an arcade pad, neither of which should have the face buttons remapped.
2022-08-04 10:46:37 -07:00
Sam Lantinga 40b7143180 Fixed button mapping for the HORIPAD S controller
This controller looks like a GameCube controller, is actually a Nintendo Switch controller, and shows up as an XInput device on Windows with the buttons already in the correct location.
2022-08-04 10:26:10 -07:00
David Carlier 16e699a761 Proposing exposing as public api the various arch dependent
pause instructions so could be used in app infinite loops.
A handful of games do already so we unify it in one place.
2022-08-04 08:47:39 -07:00
Sam Lantinga 43b90484c9 Retry a little longer when writing to the Nintendo Joy-Con Charging Grip 2022-08-04 00:40:38 -07:00
Ozkan Sezer 293d29b78a SDL_x11xinput2.c: fix build for macOS 2022-08-04 10:11:02 +03:00
Ryan C. Gordon 5907db56f1
x11: Attempt to deal with XInput2 devices with absolute coordinates.
This is untested!

Reference Issue #1836.
2022-08-04 02:12:46 -04:00
Sam Lantinga dfd2c574d7 Removed unused variable 2022-08-03 22:27:43 -07:00
Sam Lantinga a2b4f4406f The Nintendo Wii Remote Pro Controller respects the SDL_GAMECONTROLLER_USE_BUTTON_LABELS hint 2022-08-03 22:27:42 -07:00
Sam Lantinga c84dea0943 Fixed detecting the controller type of controllers over USB 2022-08-03 22:12:21 -07:00
Sam Lantinga ba297f12cd Use the Nintendo controller type to determine whether to always use button labels 2022-08-03 21:46:01 -07:00
Sam Lantinga 946f4777f6 Don't set Bluetooth controllers to wired power level 2022-08-03 21:33:38 -07:00
Sam Lantinga 57c3b2c950 Don't rely on the device VID/PID to get the Nintendo controller type
The Nintendo Online Sega Genesis controller reports the SNES VID/PID over Bluetooth. This is a more robust way of handling future controllers as well, so let's go with this instead.

Also use full reports over Bluetooth, and don't report gyro for Nintendo Online classic controllers.
2022-08-03 21:31:12 -07:00
Sam Lantinga b6aadb16b9 Added k_eSwitchDeviceInfoControllerType_N64 to ESwitchDeviceInfoControllerType 2022-08-03 20:38:33 -07:00
Sam Lantinga bdfb32de3c Added some additional Nintendo controller types to ESwitchDeviceInfoControllerType 2022-08-03 20:30:58 -07:00
Sam Lantinga ea7fbf7947 Update in-flight SDL_CONTROLLERDEVICEADDED messages when a device is removed
This fixes the application trying to open the wrong device index when a device is removed and another has just been added
2022-08-03 19:39:37 -07:00
Sam Lantinga 5d50fa52df Fixed timeout opening the Nintendo Joy-Con Charging Grip
Sometimes opening the right Joy-Con takes a little longer for some reason
2022-08-03 19:39:36 -07:00