Sam Lantinga
05f6709617
If the viewport changes the cliprect should be updated
...
The clip rectangle is defined to be viewport relative, so if the viewport changes we need to update it.
Fixes https://github.com/libsdl-org/SDL/issues/9094
(cherry picked from commit d0af01e7d4 )
2024-02-28 08:48:40 -08:00
Sam Lantinga
69fb802a90
Fixed Visual Studio warning 4459
...
(cherry picked from commit d135daad5b )
2024-02-21 23:33:11 +03:00
Sam Lantinga
903d888cc3
Convert mouse wheel coordinates to renderer view
...
Fixes https://github.com/libsdl-org/SDL/issues/9097
2024-02-20 15:44:26 -08:00
Sam Lantinga
120b8d4189
Revert "wayland: Don't initialize OpenGL when the window flags didn't specify it"
...
This reverts commit f522c5380c .
We don't want this change for SDL2, and we're doing further investigation for SDL3.
Fixes https://github.com/libsdl-org/SDL/issues/9035
2024-02-12 16:01:48 -08:00
Sam Lantinga
6669d04ea6
Fixed error: unused variable 'axes' [-Werror,-Wunused-variable]
...
(cherry picked from commit 814a94c349 )
2024-02-12 11:18:41 -08:00
Sam Lantinga
971c5c2610
Explicitly retain and release NSObjects in C structures
...
Fixes https://github.com/libsdl-org/SDL/issues/9021
Fixes https://github.com/libsdl-org/SDL/issues/9042
(cherry picked from commit 42cdbf6b21 )
2024-02-12 10:21:34 -08:00
Sam Lantinga
646cccede7
Guarded ElementAlreadyHandled with #ifdef ENABLE_PHYSICAL_INPUT_PROFILE (thanks @Donione!)
...
Fixes https://github.com/libsdl-org/SDL/issues/9033
(cherry picked from commit 3ebbf0f409 )
2024-02-09 16:12:57 -08:00
Sam Lantinga
93d7b6e50c
Redefine XINPUT_CAPABILITIES_EX as an SDL typedef
...
mingw-w64 has added this from Proton (which added this from SDL), so we need to re-define it as a local symbol to avoid conflicting with mingw-w64 headers.
Fixes https://github.com/libsdl-org/SDL/issues/9031
(cherry picked from commit b7c61569f8 )
2024-02-09 01:28:15 -08:00
Sam Lantinga
40b61b81f1
Added VIDPID for OpenFFBoard wheel (thanks @groybe!)
...
Closes https://github.com/libsdl-org/SDL/pull/7987
(cherry picked from commit 26e947f8ea )
2024-02-07 16:35:49 -08:00
Sam Lantinga
fc787a41dc
vulkan_metal.h: Make compatible with ObjC ARC (thanks @jmroot!)
...
(re)Fixes #6598
We need to remember to apply this again once we update from upstream headers.
(cherry picked from commit e67e0c5d55 )
2024-02-02 18:31:14 -08:00
Sam Lantinga
05bb182a53
Don't test 10-bit pixel format conversion
...
We either need to explicitly test using the sRGB colorspace or update the tests for HDR10 color conversion. We'll just disable them for now, as these formats aren't commonly used in games.
(cherry picked from commit f9c57e16b0 )
2024-02-02 18:26:01 -08:00
Sam Lantinga
8eed915dfa
Don't use the system iconv on Apple mobile platforms
...
Fixes https://github.com/libsdl-org/SDL/issues/8964
(cherry picked from commit d6a48e4958 )
2024-02-01 15:55:00 -08:00
Sam Lantinga
8ce6fb2513
Use the exact motion associated with the warp
...
When Windows DPI scaling is enabled, the warp coordinates will be modified, so make sure we send exactly the coordinates that the warp attempted.
Fixes https://github.com/libsdl-org/SDL/issues/8940
2024-01-30 11:11:10 -08:00
Sam Lantinga
c55bd24827
Fixed testautomation log callback calling convention
...
(cherry picked from commit 9f7eb6c4c1 )
2024-01-27 22:44:55 -08:00
Sam Lantinga
bb30a35364
Fixed Watcom build
2024-01-27 20:28:43 -08:00
Sam Lantinga
11c932bf1d
Fixed build
2024-01-27 20:18:39 -08:00
Sam Lantinga
f0b8fee88f
Added the environment variable SDL_LOGGING to control default log output
...
(cherry picked from commit 12bdb2b4d0 )
2024-01-27 19:46:25 -08:00
Sam Lantinga
6ec3f5a28e
Simplified the default log category logic
...
Now it's much clearer and easier to tweak the defaults
(cherry picked from commit 4fba663368 )
2024-01-27 19:34:24 -08:00
Sam Lantinga
2c11068569
Document that the default log priority is error, not critical
...
(cherry picked from commit a7a98d8bbb )
2024-01-27 19:31:48 -08:00
Sam Lantinga
5297596132
Report out of memory instead of crashing in SDL_LoadFile_RW()
...
Fixes https://github.com/libsdl-org/SDL/issues/8935
2024-01-27 12:15:43 -08:00
Sam Lantinga
332213163c
Fixed N3DS build
2024-01-27 11:56:33 -08:00
Sam Lantinga
4ff3b28273
Enable text input on video initialization without popping up an on-screen keyboard
...
Fixes https://github.com/libsdl-org/SDL/issues/8561
2024-01-27 11:52:58 -08:00
Sam Lantinga
08caafe2f1
Improved timing accuracy of SDL_WaitEventTimeout() on Windows
...
We don't need to use the hack of setting a timer and waiting for a timer message, MsgWaitForMultipleObjects() will allow us to wait for input directly with a timeout.
Before this change, sleeping for 20 ms would actually sleep for around 30 ms, with this change the sleep time is pretty accurate at 20-21 ms.
(cherry picked from commit 2670eb44af )
2024-01-25 06:34:29 -08:00
Sam Lantinga
b16ef14c7c
Make sure we include the matching copy of vk_video headers
...
(cherry picked from commit 1ac9602909 )
2024-01-24 09:41:48 -08:00
Sam Lantinga
0f5a815657
Update to the latest version of the Khronos headers
...
(cherry picked from commit fc74bf8455 )
2024-01-24 09:41:48 -08:00
Sam Lantinga
9196584773
Fixed ambiguity between std::byte and byte in rpcndr.h
...
Fixes https://github.com/libsdl-org/SDL/issues/8911
(cherry picked from commit a71f99c71f )
2024-01-23 09:02:00 -08:00
Sam Lantinga
4845027cad
Updated to version 2.31.0 for development
2024-01-22 09:12:34 -08:00
Sam Lantinga
ef7261bc41
Updated to version 2.29.2 for RC build
2024-01-22 08:43:05 -08:00
Sam Lantinga
12bab1c981
Fixed warning C4244: '=': conversion from 'Sint64' to 'int', possible loss of data
2024-01-22 08:39:22 -08:00
Sam Lantinga
e3203278f4
Updated tests so they'll pass if we enable the C runtime in SDL2.dll
...
This isn't needed here, but will be necessary for sdl2-compat
2024-01-21 11:23:50 -08:00
Sam Lantinga
83f3045ee8
Revert "updated WhatsNew.txt"
...
This reverts commit c3a3f18076 .
2024-01-20 05:28:05 -08:00
Sam Lantinga
cfc22ac7d7
Added patch notes for the SDL 2.30.0 release
2024-01-19 20:11:07 -08:00
Sam Lantinga
b4f99deb9e
Updated to version 2.29.1 for RC build
2024-01-19 19:58:24 -08:00
Sam Lantinga
109bb2f17e
Make sure the render target isn't bound as a resource
...
Fixes https://github.com/libsdl-org/SDL/issues/3380
(cherry picked from commit a73132177d )
2024-01-19 15:18:14 -08:00
Sam Lantinga
f7ab765b84
Fixed crash scaling very large surfaces
...
Fixes https://github.com/libsdl-org/SDL/issues/8878
(cherry picked from commit 09ba55b462 )
2024-01-19 13:06:57 -08:00
Sam Lantinga
87b5bb5840
Fixed potential overflow in software triangle rendering
...
(cherry picked from commit bd5d4d61ed )
2024-01-19 08:33:39 -08:00
Sam Lantinga
11b111e1f8
Fixed types used in documentation (thanks @Dragon-Baroque!)
2024-01-19 05:26:44 -08:00
Sam Lantinga
be576c5fe7
Updated Xcode projects after https://github.com/libsdl-org/SDL/commit/472a415c8fa0a77c26765ce0bee0ca2330f7d179
2024-01-18 17:08:20 -08:00
Sam Lantinga
eae81ec80e
Touchpads already have their right/left buttons swapped in raw input
...
Fixes https://github.com/libsdl-org/SDL/issues/8597
(cherry picked from commit cf5e0637b5 )
2024-01-15 19:46:31 -08:00
Sam Lantinga
f641d91f67
Restore window minimum and maximum size if it is recreated
...
Fixes https://github.com/libsdl-org/SDL/issues/8805
(cherry picked from commit fb2d7ed83e )
2024-01-15 16:35:03 -08:00
Sam Lantinga
b6e97d9ff0
Fixed Xcode warnings
2024-01-13 08:15:41 -08:00
Sam Lantinga
5db6eb7742
Removed reference to deleted header from Xcode project
2024-01-13 08:10:04 -08:00
Sam Lantinga
970ed36de5
Only force X11 if SDL_VIDEO_DRIVER_X11 is available
2024-01-09 11:56:26 -08:00
Sam Lantinga
bd2f1e9ea6
Use the X11 driver if the application uses X11-based graphics frameworks
...
Fixes https://github.com/libsdl-org/SDL/issues/8812
2024-01-09 11:24:10 -08:00
Sam Lantinga
f62d1220ac
Restore the previously initialized subsystems after the Init/Quit test
...
Fixes https://github.com/libsdl-org/SDL/issues/8796
2024-01-08 14:32:52 -08:00
Sam Lantinga
4c11307a4e
Only initialize audio drivers that have been requested
...
If testautomation is running with only a specific audio driver enabled, we shouldn't try to open other ones, as they might fail.
Fixes https://github.com/libsdl-org/SDL/issues/8797
2024-01-08 13:38:29 -08:00
Sam Lantinga
d3c21666de
gamepad: Clarify range and direction of axes
...
It would be easy to assume that all APIs that reference
SDL_JOYSTICK_AXIS_MAX work the same way, but they do not: triggers
generally use the full signed 16-bit range in the lower-level joystick
API, but are normalized to be non-negative by the higher-level gamepad
API.
We also never said explicitly which direction is positive here.
Experimentally, it's right (X), down (Y), and pressed (triggers).
Resolves: https://github.com/libsdl-org/SDL/issues/8793
Signed-off-by: Simon McVittie <smcv@collabora.com >
(cherry picked from commit 059fb560ba )
2024-01-08 09:48:04 -08:00
Sam Lantinga
5e12e4b813
Updated documentation for SDL_HINT_SHUTDOWN_DBUS_ON_QUIT
...
(cherry picked from commit 3deefa6b43 )
2024-01-07 14:24:56 -08:00
Sam Lantinga
ca3b8fe91d
Fixed build
2024-01-06 08:33:30 -08:00
Sam Lantinga
e1c3dcb403
Don't try to send the PS third-party feature request to the Logitech G815 keyboard
...
Fixes https://github.com/libsdl-org/SDL/issues/8373
(cherry picked from commit d3daba791a )
2024-01-06 08:30:20 -08:00
Sam Lantinga
c309546e8c
Fixed warning: no previous prototype for function 'SDL_GetGameControllerTypeFromString' [-Wmissing-prototypes]
2024-01-06 08:23:55 -08:00
Sam Lantinga
0e913a22db
Renamed ShowTextInput/HideTextInput to ShowScreenKeyboard/HideScreenKeyboard on Android
...
This better reflects the actual implementation and makes SDL_HINT_ENABLE_SCREEN_KEYBOARD work on Android.
Fixes https://github.com/libsdl-org/SDL/issues/8652
(cherry picked from commit 014a63b4b5 )
2024-01-06 08:23:11 -08:00
Sam Lantinga
be29ca0189
Use the application requested size to determine automatic orientation on iOS
...
Fixes https://github.com/libsdl-org/SDL/issues/8201
(cherry picked from commit e3b5999bb4 )
2024-01-06 07:39:25 -08:00
Sam Lantinga
f892ae10d6
updateKeyboard should use the SDL window's screen instead of the view window's screen, which may be nil.
...
Fixes https://github.com/libsdl-org/SDL/issues/8200
(cherry picked from commit 3a9a52fe6c )
2024-01-06 07:37:14 -08:00
Sam Lantinga
674e894574
Added mapping for the RX Gamepad, e.g. Pandora Box 7
...
Fixes https://github.com/libsdl-org/SDL/issues/8217
(cherry picked from commit e100992c17 )
2024-01-06 06:19:30 -08:00
Sam Lantinga
0fc3574464
Updated copyright for 2024
2024-01-01 13:19:49 -08:00
Sam Lantinga
d649f95723
Use GNU sed if available
...
Fixes update-copyright.sh on macOS, which doesn't support the -b option.
(cherry picked from commit a357021800 )
2024-01-01 13:18:35 -08:00
Sam Lantinga
4f8dd2d39d
Speed up processing of update-copyright.sh
...
(cherry picked from commit 78ccadd5a2 )
2024-01-01 13:18:35 -08:00
Sam Lantinga
857e5b08c3
Fixed trying to add a game controller mapping for the accelerometer on iOS
...
Fixes https://github.com/libsdl-org/SDL/issues/8716
(cherry picked from commit 0e5ea3cc4b )
2023-12-24 11:22:22 -08:00
Sam Lantinga
49eb375a59
Added SDL2.framework to the embedded frameworks for SDL test programs
...
Fixes https://github.com/libsdl-org/SDL/issues/8737
2023-12-24 09:17:48 -08:00
Sam Lantinga
aeda6a8e6f
Record the initial input report mode and only restore simple mode if that's what we started with
...
Fixes https://github.com/libsdl-org/SDL/issues/8108
Closes https://github.com/libsdl-org/SDL/pull/8115
(cherry picked from commit c3d84c3342 )
2023-12-24 08:23:36 -08:00
Sam Lantinga
fe76c40716
Added a runtime check for BLUETOOTH_CONNECT in addition to BLUETOOTH (thanks @perepujal!)
...
Fixes https://github.com/libsdl-org/SDL/issues/8731
(cherry picked from commit bb0e0ae080 )
2023-12-24 06:51:48 -08:00
Sam Lantinga
eba591a910
Fixed Xcode project
2023-12-20 19:42:43 -08:00
Sam Lantinga
919cd56b20
Use the original manufacturer and product strings for the joystick CRC
...
This allows the most information possible for the CRC string, which is used to differentiate controllers with the same VID/PID.
Fixes https://github.com/libsdl-org/SDL/issues/8724
(cherry picked from commit 1f1ee6f77c )
2023-12-20 19:25:35 -08:00
Sam Lantinga
2fecefce19
Updated Xcode project with Steam Deck controller driver
2023-12-20 13:29:58 -08:00
Sam Lantinga
7bb0e839a6
Added Steam Input API support for game controllers
...
Added support for getting the real controller info, as well as the function SDL_GameControllerGetSteamHandle() to get the Steam Input API handle, from the virtual gamepads provided by Steam.
Also added an event SDL_CONTROLLERSTEAMHANDLEUPDATED which is triggered when a controller's API handle changes, e.g. the controllers were reassigned slots in the Steam UI.
(cherry picked from commit c981a597dc )
2023-12-20 13:29:57 -08:00
Sam Lantinga
91f8b4dea2
Added a controller name for the Steam virtual gamepad
...
(cherry picked from commit 4d5949dcf6 )
2023-12-17 10:08:17 -08:00
Sam Lantinga
2aadef022e
Pass through the name of the controller for the XInput mapping
...
(cherry picked from commit e6d88b254add377743de7bf33a7a4fec8cec79c3)
2023-12-17 09:32:54 -08:00
Sam Lantinga
d622c3c9cc
Verify that the %p format specifier works for 64-bit pointers
...
(cherry picked from commit 7f75178908 )
2023-12-17 08:15:19 -08:00
Sam Lantinga
239b5278bf
Revert "Back out Steam virtual gamepad changes"
...
This reverts commit f0e7f3e7e5 .
2023-12-13 09:46:10 -08:00
Sam Lantinga
7d94121606
You should call present when using a software renderer as well.
...
Fixes https://github.com/libsdl-org/SDL/issues/8676
(cherry picked from commit 581d1cab25 )
2023-12-11 08:44:11 -08:00
Sam Lantinga
79a8e8cf04
Make built-in joystick device lists extendable by using hints
...
Fixes https://github.com/libsdl-org/SDL/issues/8595
(cherry picked from commit 5173b0c2cc )
2023-12-10 22:52:12 -08:00
Sam Lantinga
6526c4d0fc
Refactor VIDPID list loading code
...
(cherry picked from commit d91e96e7f5 )
2023-12-10 09:02:56 -08:00
Sam Lantinga
f0e7f3e7e5
Back out Steam virtual gamepad changes
...
We are planning a different approach to handle these
2023-12-10 08:38:20 -08:00
Sam Lantinga
ddac844034
Fixed build
2023-12-09 21:44:12 -08:00
Sam Lantinga
dd28637947
Use the Steam virtual gamepad slot as the gamepad player index
...
(cherry picked from commit 7529d25b2b )
2023-12-09 21:01:08 -08:00
Sam Lantinga
5b26d4e0ca
Sort Steam virtual gamepads by Steam controller slot
...
This makes sure that games launched by Steam see the first controller first, and the controllers in the game match up with the controllers in the Steam UI.
Fixes https://github.com/libsdl-org/SDL/issues/8672
(cherry picked from commit 17723381da )
2023-12-09 20:35:33 -08:00
Sam Lantinga
8f14dc6998
Corrected comment
...
(cherry picked from commit 45938bbfa5 )
2023-11-28 12:30:10 -08:00
Sam Lantinga
546bab0a8c
Fixed the GameCube HIDAPI controller mapping
...
Fixes https://github.com/libsdl-org/SDL/issues/8617
Closes https://github.com/libsdl-org/SDL/pull/8623
Closes https://github.com/libsdl-org/SDL/pull/7930
2023-11-28 10:26:58 -08:00
Sam Lantinga
98ee4a5292
Removed HIDAPI controller mappings
...
These are already provided internally by SDL
(cherry picked from commit dd984dcd9f )
2023-11-28 10:11:56 -08:00
Sam Lantinga
8d47e3bb82
Added support for the NACON Revolution 5 Pro controller
...
(cherry picked from commit f0e47f8ee0 )
2023-11-27 12:12:25 -08:00
Sam Lantinga
dcd21d042f
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
(cherry picked from commit 0fe5713964 )
Author: Sam Lantinga <slouken@libsdl.org >
Date: Tue Nov 14 12:58:33 2023 -0800
2023-11-21 15:17:53 -08:00
Sam Lantinga
2d81beb819
Show the mapping used when a game controller is opened
2023-11-21 13:49:38 -08:00
Sam Lantinga
4de4b1e7a0
Don't tickle PS4 Bluetooth controllers in simple mode
...
The 8BitDo Zero 2 only sends reports when state changes, so trips the disconnected Bluetooth controller detection. The expected use case is that most people will have official PS4 controllers in enhanced report mode, so disconnected Bluetooth controller detection will still work for those.
Fixes https://github.com/libsdl-org/SDL/issues/8556
(cherry picked from commit 75df4cc5c2 )
2023-11-21 13:25:31 -08:00
Sam Lantinga
cc7c0a2dab
Fixed IOS_SupportedHIDDevice() returning SDL_FALSE before initialization
...
(cherry picked from commit 34392db9c3 )
2023-11-14 10:58:18 -08:00
Sam Lantinga
76cc24e34a
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.
(cherry picked from commit 708f18d49e )
2023-11-14 10:32:52 -08:00
Sam Lantinga
0ec1209eab
Fixed a memory leak at window creation.
...
Windows updates the desktop display mode once at video init (in WIN_InitModes()) and once when creating a window (in WIN_RefreshDisplays())
Fixes https://github.com/libsdl-org/SDL/issues/7982
Fixes https://github.com/libsdl-org/SDL/issues/8189
(cherry picked from commit bea34c5380 )
2023-11-14 09:29:55 -08:00
Sam Lantinga
1de85491e1
Fixed mouse wheel scrolling direction on iOS
...
(cherry picked from commit 15504da0b8 )
2023-11-14 09:25:04 -08:00
Sam Lantinga
cc20d0147e
Revert "Check to make sure the Windows joystick device has buttons and axes"
...
This reverts commit ad0af48883 .
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
(cherry picked from commit 2c1fbe1967 )
2023-11-13 21:37:18 -08:00
Sam Lantinga
8c82b73027
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.
(cherry picked from commit edd044e901 )
2023-11-13 21:37:06 -08:00
Sam Lantinga
c29df1699e
Added shortened name for "Nintendo Co., Ltd."
...
(cherry picked from commit 87794d03ad )
2023-11-10 17:32:34 -08:00
Sam Lantinga
4a0bd06d58
Added support for the GameSir-G7 Controller for Xbox
...
(cherry picked from commit 2e6c48dcb4 )
2023-11-10 17:32:11 -08:00
Sam Lantinga
03f29c19dc
Added support for the Dragonrise GameCube adapter with VID 0x1843
...
(cherry picked from commit fbb6934905 )
2023-11-10 16:45:07 -08:00
Sam Lantinga
dfc38ef460
Implemented VT switching for KMSDRM on Linux
...
Fixes https://github.com/libsdl-org/SDL/issues/3844
(cherry picked from commit f4b61fff30 )
2023-11-08 20:46:13 -08:00
Sam Lantinga
509c70c698
Allow the application to draw while Windows is in a modal move/resize loop
...
SDL will send an SDL_EVENT_WINDOW_EXPOSED event for your window during the modal interaction and you can use an event watcher to redraw your window directly from the callback.
Fixes https://github.com/libsdl-org/SDL/issues/1059
Closes https://github.com/libsdl-org/SDL/pull/4836
2023-11-08 14:01:00 -08:00
Sam Lantinga
3900fca304
Fixed FreeBSD build
...
(cherry picked from commit a4c6b38fef )
2023-11-08 07:46:42 -08:00
Sam Lantinga
76ff25eedf
Fixed FreeBSD build
...
(cherry picked from commit d9e6dcc650 )
2023-11-08 04:45:46 -08:00
Sam Lantinga
5d29f22808
Store the requested muted state
...
(cherry picked from commit 7cc3e94eb2 )
2023-11-08 03:37:09 -08:00
Sam Lantinga
87bb0f5bcb
Don't mute the console input if we can't read the keyboard
...
This makes sure you can hit Ctrl-C if you don't have permission to access the raw keyboard device.
Fixes https://github.com/libsdl-org/SDL/issues/4812
(cherry picked from commit ce9e1bd324 )
2023-11-08 03:29:39 -08:00
Sam Lantinga
7e11bd1ac1
Removed useless branch test
...
Fixes https://github.com/libsdl-org/SDL/issues/8286
(cherry picked from commit e5ccc80aba )
2023-11-08 01:35:57 -08:00