Commit Graph

15272 Commits (d51b53ef8f76ee6dc49115fb7981b84e5b0f02b4)

Author SHA1 Message Date
Sam Lantinga d79f865251 Removed incorrect mapping for a HORI controller
This broke support for the Hori Fighting Stick EX2, which gets a good mapping if the automatic mapping is allowed to create one.

If the original controller needs a mapping, it should be added with a crc, since that VID/PID combination is used by several HORI controllers.
2024-03-11 17:11:20 -07:00
Sam Lantinga d78a24a5ce testffmpeg: added verbose logging of ffmpeg messages 2024-03-11 15:48:52 -07:00
Sam Lantinga 7c5f79e7ea testffmpeg: removed redundant enumeration of hardware device types 2024-03-11 15:31:47 -07:00
Anonymous Maarten bee8a95571 Fix SDL_LEAN_AND_MEAN build 2024-03-11 13:46:16 -07:00
Sam Lantinga d4794cc714 Fix crash in SDL_UpdateFullscreenMode calling SetWindowFullscreen with a null display
- This mirrors the check above for fullscreen=true in the unlikely case where there is no primary display detected
2024-03-11 11:17:45 -07:00
Sam Lantinga ab5351f5d6 Fixed leaving the cursor clip set when changing window focus
While the focus change happens, Windows appears to reset the cursor clip rectangle, and then restore it if the application that has focus has the clip rectangle set.

This fixes resetting the clip rectangle while changing focus between windows in the same application, e.g. the Source 2 editor.
2024-03-11 10:58:40 -07:00
Sam Lantinga b322d27f62 Missed SDL_NumJoystickBalls() rename in SDL_migration.cocci 2024-03-10 21:31:19 -07:00
Sam Lantinga efbbafb3f1 Re-added balls to the SDL joystick API
It turns out these were being used on Linux and at least one virtual driver was making use of them (thanks @mrfixit2001!)
2024-03-10 21:30:14 -07:00
Sam Lantinga 53e86be22f Minor cleanup with the new PS3 driver for windows 2024-03-10 20:12:11 -07:00
Riccardo Marcangelo 6534029691
Add DualShock 3 HIDAPI support on Windows (#9144)
This adds HIDAPI support for DualShock 3 controllers on Windows, addressing the current absence of this feature in SDL. To utilize this functionality, the official Sony driver 'sixaxis.sys' must be installed. HID offers several advantages over DirectInput, including rumble support and the ability to control the LED lights that display the controller number.
2024-03-10 20:08:36 -07:00
r4nx feadbffb67 Destroy properties after applying them to avoid memory leakage 2024-03-10 18:16:40 -07:00
Anonymous Maarten b5eb704fa8 cmake: we only need a C++ compiler for Android, Haiku and UWP
Our CMake script does (currently) not support NGage, Xbox One, or Xbox Series.
2024-03-11 00:27:54 +01:00
Sam Lantinga fde420a645 Revert "Added SDL_FLIP_DIAGONAL"
This reverts commit b9ab326982.

@rainerdeyke pointed out:
"This commit is incorrect. Flipping both horizontally and vertically is not equivalent to flipping diagonally."
2024-03-10 15:20:36 -07:00
Sam Lantinga e3cf2e4794 Turn HIDAPI joystick support off by default on mobile platforms
On Android, HIDAPI prompts for permissions and acquires exclusive access to the device, and on Apple mobile platforms it doesn't do anything except for handling Bluetooth Steam Controllers.

Fixes https://github.com/libsdl-org/SDL/issues/9241
2024-03-10 15:00:49 -07:00
Sam Lantinga ed463b41e1 Unified the software renderer creation path
Previously there were two different paths for renderer creation, and the HDR metadata initialization was missing when creating a software renderer for a surface. Now all the cases are handled in a single path, so regardless of whether you create a software renderer by name, a software renderer for a surface, or fall back to a software renderer, you'll get the correct initialization in all cases.

Fixes https://github.com/libsdl-org/SDL/issues/9221
2024-03-10 11:05:26 -07:00
RPP-dev b9ab326982 Added SDL_FLIP_DIAGONAL
Since SDL_RenderFlip is an enum, SDL_FLIP_HORIZONTAL and SDL_FLIP_VERTICAL can not be OR'ed to get the "SDL_FLIP_DIAGONAL".
Render code is actually able to perform these 3 kind of "flipping" so I just added a new enum called SDL_FLIP_DIAGONAL with the OR'ed value (3) so it can be used.
2024-03-10 09:27:14 -07:00
Anonymous Maarten 7341d5f361 cmake: allow hidapi to use libusb on Windows
When using SDL_HIDAPI_LIBUSB_SHARED=ON, extract the dll file name
from the import library.
2024-03-10 09:07:33 -07:00
Anonymous Maarten 3bc27d3856 hidapi_libusb: use SDL_wcscmp and SDL_wcslcpy from SDL 2024-03-10 09:07:33 -07:00
Anonymous Maarten 0e6fcf947a cmake: find libusb through LibUSB cmake module 2024-03-10 09:07:33 -07:00
Tolik708 2a775cad6f Named typedef-ed structs Gave name to structs that were defined like anonymous struct with name given by typedef. Example 'typedef struct {...} Foo;' -> 'typedef struct Foo {...} Foo;' 2024-03-10 09:04:18 -07:00
Sam Lantinga 37d066b99b Clarify what pitch means (thanks @zlago!) 2024-03-10 09:02:59 -07:00
Frosty-J f9d018c808 Add flag to registerReceiver on Android 2024-03-10 09:01:07 -07:00
Green Sky 4de30a26a2 x11: workaround issues with primary selection and clipboard temporal ignorance 2024-03-10 08:59:44 -07:00
Simon McVittie 76defc5c82 joystick: Remove redundant CHECK_JOYSTICK_MAGIC in SDL_GetJoystickName
Since commit 0dfdf1f3 "Fixed crash if joystick functions are passed a
NULL joystick", we've already done this check by the time we get to
this point.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-03-09 08:40:04 -08:00
a dinosaur 41baf23e44 cmake: fix empty framework prefix on MacOS 2024-03-09 08:18:47 -08:00
Nour Fouad b6c5ad0075 Update hardcoded value of pi to use SDL constant SDL_PI_F for improved consistency and readability. 2024-03-08 20:49:01 -08:00
Sam Lantinga fcb132b8e8 Allow building testffmpeg without Vulkan support 2024-03-08 16:45:27 -08:00
Sam Lantinga 16e0806ced Note that the cursor clip has been cleared even if we didn't do it
This releases the mouse cursor when bringing up the console on Counter Strike in dev mode.
2024-03-08 15:56:49 -08:00
Mingjie Shen 19b3ddac2f Fix TOCTOU race condition
Separately checking the state of a file before operating on it may allow
an attacker to modify the file between the two operations. (CWE-367)
Fix by using fstat() instead of stat().
2024-03-08 15:52:04 -08:00
Sam Lantinga cde793b0f5 Added support for the 6-button SEGA Mega Drive Control Pad for Nintendo Online
Closes https://github.com/libsdl-org/SDL/pull/9225
2024-03-08 12:33:54 -08:00
Ozkan Sezer d86ff6c6c0 remove stale / wrong information from SDL_RWread() documentation 2024-03-08 18:55:40 +03:00
Ozkan Sezer 9e89f093d9 remove stale / wrong information from SDL_RWread() documentation 2024-03-08 18:55:19 +03:00
Sam Lantinga 790cd395f5 Make sure the type in the SDL_Event aligns properly across the union 2024-03-07 06:58:43 -08:00
Sam Lantinga e9ab2d46de Revert "Change `SDL_Keycode` type to an enum"
SDL_Keycode can actually be any printable character on the keyboard, so isn't limited to the enumerated values of SDL_KeyCode.
2024-03-07 06:58:43 -08:00
Sam Lantinga 33eaddc565 Cleaned up various type conversion issues
This makes sure SDL_PixelFormatEnum flows through the internal code correctly, as well as fixing a number of other minor issues.
2024-03-07 06:58:43 -08:00
Sam Lantinga f53bdc9531 The pixel format in SDL_DisplayMode uses SDL_PixelFormatEnum 2024-03-07 03:39:06 -08:00
Sam Lantinga 57a160c9ab Fixed mapping for the Sanwa Supply JY-P76USV controller 2024-03-06 20:53:48 -08:00
Sam Lantinga 5643fd683f Added migration notes for enum type changes 2024-03-06 16:59:28 -08:00
Anonymous Maarten 3cc4705dd2 cmake: build OBJC sources with warning & error flags, ignoring deprecated declarations 2024-03-07 01:58:28 +01:00
SDL Wiki Bot 59ab5c0824 Sync SDL3 wiki -> header 2024-03-07 00:20:27 +00:00
Sam Lantinga c70710cde8 SDL_GetPixelFormatEnumForMasks() returns SDL_PixelFormatEnum 2024-03-06 16:19:08 -08:00
Susko3 01248a99c8 Add `default: break;` to switches on SDL_Event::type
This is just a nice-to-have, as `SDL_Event::type` in an `Uint32`, so there are no
compiler errors about not handling all `SDL_EventType` enum values.
2024-03-06 15:40:05 -08:00
Susko3 722f4104bf Use enums as types in SDL_*Event structures
The main `SDL_Event` union is not using the enum as
valid user events types are not in the enum.
2024-03-06 15:40:05 -08:00
Susko3 641b911d38 Update some internal files to use `SDL_WindowFlags` 2024-03-06 15:08:12 -08:00
Susko3 ce44eff3d2 Use `SDL_WindowFlags` in public headers 2024-03-06 15:08:12 -08:00
Susko3 4f58d18373 Typedef `SDL_WindowFlags`
Window flags were previously an enum with the same name.
See ebd7f9adbd.
2024-03-06 15:08:12 -08:00
Susko3 424616e032 Use SDL_PixelFormatEnum as type 2024-03-06 15:02:13 -08:00
Sam Lantinga 38c54b8e0e More null checks for SDL window operations 2024-03-06 13:33:30 -08:00
Sam Lantinga 6664a089d8 Add missing null check for displaydata during window creation
Found in the wild from minidump reports. Unclear displaydata is null, but according
to the API it is possible for this call to return null so it seems like a valid check.
2024-03-06 13:33:27 -08:00
Sam Lantinga 610e798406 Fix clicking on the titlebar causing mouse input to freeze until esc is pressed
When the titlebar drage region is clicked two actions are triggered:
  * The WM transfers focus to the application
  * The application starts a drag operation because the drag region was clicked

When the drag operation starts before input has been transferred to the application the
window manager gets in a bad state where mouse clicks don't work and the system isn't
actually dragging.

In this CL we delay drag operations until after the application has acquired active focus.
This fixes the problems outlined above.
2024-03-06 13:33:23 -08:00