Commit Graph

14531 Commits (1143bdc35130e68c90c9b1a3a2069399b7f6143a)

Author SHA1 Message Date
Sam Lantinga 3a9a52fe6c 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
2024-01-06 07:31:10 -08:00
Sam Lantinga e100992c17 Added mapping for the RX Gamepad, e.g. Pandora Box 7
Fixes https://github.com/libsdl-org/SDL/issues/8217
2024-01-06 06:18:13 -08:00
J. Neuschäfer 139a0931a3 Fix memory barriers on ARMv5
The ARM926EJ-S Technical Reference Manual states:

> You can only access CP15 registers with MRC and MCR instructions in a
> privileged mode. CDP, LDC, STC, MCRR, and MRRC instructions, and unprivileged
> MRC or MCR instructions to CP15 cause the Undefined instruction exception to
> be taken.

Furthermore, `MCR p15, 0, <Rd>, c7, c10, 5` (later called Data Memory Barrier)
is not specified for the ARM926. Thus, SDL should not use these cache
instructions on ARMv5.
2024-01-05 09:00:47 -08:00
Sam Lantinga 21c80ac843 Added a practical example of confirm/cancel gamepad button handling 2024-01-04 22:51:43 -08:00
Sam Lantinga 787a15f760 Fix Mac child windows that are created hidden showing if their parent window is shown
- Child windows are added and removed dynamically from the window hierarchy when they're shown/hidden. Adding a hidden child window to a visible
  parent is fine, but adding a hidden child window to a hidden parent will cause the child to show when the parent window is shown as it's still a part of
  the window hierarchy.

- For some reason, not adding the child window to the parent entirely causes the child to not focus correctly the first time it's shown. Adding then immediately
  calling orderOut to remove the child window from the hierarchy does work correctly so we do this to work around the weird issue.
2024-01-04 12:44:57 -08:00
Sam Lantinga d6b1fc9576 Add SDL_MAC_REGISTER_ACTIVATION_HANDLERS hint to allow disabling the normal application startup/activation/deactivation handlers 2024-01-04 12:44:54 -08:00
Sam Lantinga 7c5e694022 Ignore a new warning in Visual Studio 2022 2024-01-04 12:44:48 -08:00
Frank Praznik 73d02184d7 docs: Add Wayland to the SysWM migration example
Wayland will be increasingly encountered going forward and needs to be handled by applications requesting window handles to initialize the Vulkan WSI and such, so include it in the migration example to reflect current best practices.
2024-01-04 14:59:14 -05:00
Sam Lantinga c03c01e9b2 Make sure we get mouse events as soon as possible 2024-01-04 09:12:55 -08:00
Anonymous Maarten 5cbdeab799 Rename SDL_mslibc_x64.asm -> SDL_mslibc_x64.masm
The .masm suffix should give meson sufficient info about the file
being MASM instead of NASM/YASM.
2024-01-04 17:46:07 +01:00
Frank Praznik ed62d6e7de cocoa: Set the titled flag on fullscreen space windows
For some reason, fullscreen space windows won't get any mouse button events unless the NSWindowStyleMaskTitled flag is set when entering fullscreen, even though they successfully become key and receive mouse motion events. Make sure the flag is always set when entering fullscreen space state.
2024-01-03 21:12:34 -05:00
Ozkan Sezer b4b5dbd92f testcontroller.c: fixed warnings. 2024-01-03 14:40:20 +03:00
Sam Lantinga 31851a50d2 Fixed dropping raw input because of mixing GetRawInputBuffer() and WM_INPUT handling
It turns out that when you enable raw input and then process Windows messages, you'll get the currently pending input in GetRawInputBuffer(), and you'll get any new input that occurs while processing messages as WM_INPUT.

The fix for this is to create a dedicated thread to handle raw input and only use GetRawInputBuffer() in that thread. A nice side effect of this is that we'll get mouse input at the lowest latency possible, but raw mouse events will now occur on a separate thread, outside of the normal event loop processing.

Improved fix for https://github.com/libsdl-org/SDL/issues/8756
2024-01-03 02:20:23 -08:00
Nour Fouad 987744aae8 Fix Duplicated includes 2024-01-02 16:34:11 -08:00
Sam Lantinga 2b369a14ab Fixed allocation and alignment of raw input buffers 2024-01-02 09:25:28 -08:00
Vicki Pfau bec1b8f849 Add basic rumble support to Steam Deck 2024-01-01 21:46:38 -08:00
Sam Lantinga 8fe4a45edf Use GetRawInputBuffer() instead processing raw input one at a time
This is a huge performance improvement for high polling rate mice, like the Razer Viper 8K mouse.

Fixes https://github.com/libsdl-org/SDL/issues/8756
2024-01-01 20:41:15 -08:00
Sam Lantinga 87b8f09657 Fixed warning: no previous prototype for function 'SDL_PrivateGetGamepadButtonFromString' [-Wmissing-prototypes] 2024-01-01 14:56:55 -08:00
Sam Lantinga c2951655ff Fixed warning: missing field 'window' initializer [-Wmissing-field-initializers] 2024-01-01 14:55:42 -08:00
Sam Lantinga 5b3ee51c6c Updated copyright for 2024 2024-01-01 13:15:26 -08:00
Sam Lantinga a7b79c483c Remove unused 'window' variable from -[Cocoa_WindowListener windowWillExitFullScreen] 2024-01-01 13:15:39 -08:00
Amir Kadyrov dd2d809407 AndroidShowToast: make OneShotTask members private final 2024-01-01 08:31:34 -08:00
Sam Lantinga 44c2f344d6 Fixed build 2023-12-30 11:47:56 -08:00
Sam Lantinga 2faae8457d The C standard defines a boolean expression as a signed integer value.
Microsoft came to the same conclusion:
https://devblogs.microsoft.com/oldnewthing/20110328-00/?p=11113

Fixes https://github.com/libsdl-org/SDL/issues/8761
2023-12-30 11:44:40 -08:00
Sam Lantinga e3d50619f8 Fixed fatal error: SDL_pen.h: No such file or directory 2023-12-29 20:04:40 -08:00
Sam Lantinga dfe1a37bab Fixed error: 'static' is not at beginning of declaration [-Werror=old-style-declaration] 2023-12-29 19:40:45 -08:00
Sam Lantinga 423b1fafcd Fixed warning C4047: 'function': '__x_ABI_CWindows_CGaming_CInput_CIRawGameController **' differs in levels of indirection from '__x_ABI_CWindows_CGaming_CInput_CIRawGameController *'
This warning happens with old and buggy versions of the Windows SDK
2023-12-29 18:07:30 -08:00
Sam Lantinga 7681695875 Revert "Fixed signed/unsigned warnings with Visual Studio when comparing SDL_bool with boolean expressions"
This reverts commit 61db102da9.

This causes the build to fail:
SDL_waylandwindow.c:1876:45: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
            wind->fullscreen_was_positioned = SDL_TRUE;
2023-12-29 17:14:05 -08:00
Frank Praznik 8f94102b04 tests: Use unsigned format specifiers for printing flags 2023-12-29 14:41:38 -05:00
Frank Praznik 5d0c893723 wayland: Remove bitfield specifiers from boolean values
If SDL_bool is no longer unsigned, this won't work as the valid values are only 1 and -1.
2023-12-29 14:18:55 -05:00
Sam Lantinga 530b41d531 Fixed warnings in SDL_pen.c 2023-12-29 10:37:28 -08:00
Sam Lantinga 9906d6d3bc Fixed warning C4244: '=': conversion from 'SDL_bool' to 'Uint8', possible loss of data 2023-12-29 10:37:28 -08:00
Sam Lantinga ebd7f9adbd Fixed warning C4245: 'initializing': conversion from 'int' to 'Uint32', signed/unsigned mismatch in SDL_video.c 2023-12-29 10:37:28 -08:00
Sam Lantinga dc1c27885e Fixed warning C4389: '!=': signed/unsigned mismatch in SDL_blit.c 2023-12-29 09:26:36 -08:00
Sam Lantinga e813c72b3c Fixed warning C4245: 'return': conversion from 'int' to 'SDL_JoystickID', signed/unsigned mismatch 2023-12-29 09:25:57 -08:00
Sam Lantinga dce626f469 Fixed warning C4244: 'function': conversion from 'int' to 'Uint16', possible loss of data 2023-12-29 09:24:52 -08:00
Sam Lantinga 7f376277e5 Fixed warning C4244: 'initializing': conversion from 'SDL_bool' to 'Uint8', possible loss of data 2023-12-29 09:24:22 -08:00
Sam Lantinga 61db102da9 Fixed signed/unsigned warnings with Visual Studio when comparing SDL_bool with boolean expressions 2023-12-29 09:23:47 -08:00
Sam Lantinga d71454da17 Store the surface properties in the reserved pointer of a surface
This prevents us from exposing the properties publicly and allows us to repurpose the pointer later if necessary.

Fixes https://github.com/libsdl-org/SDL/issues/8758
2023-12-29 08:17:06 -08:00
Frank Praznik b6a92c113f wayland: Don't apply old libdecor window dimensions
Don't overwrite the current dimensions unless they've actually changed, or programmatically set dimensions can be overwritten.
2023-12-29 08:59:45 -05:00
Sam Lantinga 39e24e52c8 Fixed example of creating a window with properties 2023-12-28 16:35:31 -08:00
Sam Lantinga dc450ba908 Added an example of creating a window with position 2023-12-28 16:34:13 -08:00
Sam Lantinga ce4fe32ce3 Added documentation for getting the X11 display from an SDL window 2023-12-28 16:26:55 -08:00
Sam Lantinga 327d31a5d9 Added documentation for getting the NSWindow from an SDL window 2023-12-28 16:09:59 -08:00
Sam Lantinga 3976bbef2a Added documentation for getting the X11 window from an SDL window 2023-12-28 15:56:37 -08:00
Sam Lantinga ffb8515c21 Use the Valve code name for the Steam Deck controller 2023-12-28 15:41:02 -08:00
Sam Lantinga 43c40d30a2 Added comment for the BDA Pro Ex controller 2023-12-28 15:22:28 -08:00
Sam Lantinga 61704b5862 Removed an assertion it's possible to hit 2023-12-28 15:22:28 -08:00
Sam Lantinga c24b33d8d9 Fixed building with older Windows SDK 2023-12-28 15:14:34 -08:00
Sam Lantinga 70ba3f2830 Report the D-Pad for HIDAPI gamepads as a hat
This makes it easier for games that don't use the gamepad API to handle D-Pad navigation, and is consistent with many other non-HIDAPI mappings.

Fixes https://github.com/libsdl-org/SDL/issues/8754
2023-12-28 14:14:51 -08:00