Commit Graph

14148 Commits (dc1c27885e6a4d1abe64a4076bb19f069c09769a)

Author SHA1 Message Date
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
Sam Lantinga ce329d60e4 Added support for alpha blending using palette alpha
Fixes https://github.com/libsdl-org/SDL_image/issues/409
2023-12-28 09:33:02 -08:00
Frank Praznik 9c3e831e33 uikit: Send fullscreen enter/leave events
Send fullscreen enter/leave events, which will implicitly update the fullscreen flag. Manually setting the flag will suppress attempts to send the events later, as the flag is used for deduplication purposes in the event code.
2023-12-27 17:23:49 -05:00
SDL Wiki Bot 5df3eac925 Sync SDL3 wiki -> header 2023-12-27 20:21:11 +00:00
Sam Lantinga 0dfdf1f3f2 Fixed crash if joystick functions are passed a NULL joystick 2023-12-27 11:25:54 -08:00
Reilly Brogan 4ce935b910 Fix static build with libdecor 0.2.0 2023-12-26 16:29:36 -08:00
Susko3 5d6d149862 Allow passing in `extrainfo` value to `GetMouseMessageSource()`
This saves a syscall in WM_INPUT handling
2023-12-26 13:42:19 -08:00
Susko3 e0df963ef0 Fix wrong bit count in comment
If we're counting bits from 0, then the MSB is bit 31!
2023-12-26 13:42:19 -08:00
Susko3 c2a55cd2c5 Add missing `(void)` in functions params 2023-12-26 13:42:19 -08:00
Susko3 a3c8f2f6cb Consolidate mouse-touch event checking logic
Saves one `GetMessageExtraInfo()` syscall when handling WM_INPUT events.

Will provide consistent results across various event types.
2023-12-26 13:42:19 -08:00
Susko3 d747daf03d Use correct touch check flag
Matches the one in `GetMouseMessageSource()`.
From my testing on Windows 11, the lower 8 bits in touch events cycle
trough the values 0x8c-0x95 in order.
2023-12-26 13:42:19 -08:00
Susko3 a961066d0b Add basic touch/finger support to `testpen.c`
Reuses the pen code as much as possible.

Seems like the right place, see
https://github.com/libsdl-org/SDL/pull/8749#issuecomment-1869671334.
2023-12-26 13:42:19 -08:00
Sam Lantinga a3b5eb07b2 Removed extern "C" linkage from main() declaration
According to the C++ spec, main() should not have any linkage specifier:
https://en.cppreference.com/w/cpp/language/main_function

Fixes https://github.com/libsdl-org/SDL/issues/8738
2023-12-26 10:19:22 -08:00
Sam Lantinga 50e309bb17 Include SDL_events.h in SDL_main.h
Applications shouldn't need to include it separately if they want to process events using the main callbacks.

Fixes https://github.com/libsdl-org/SDL/issues/8746
2023-12-26 10:11:48 -08:00
Alynne cae657140c Add Access Controller 2023-12-26 09:58:09 -08:00
Sam Lantinga 74418e1aa8 Made the cursor list check a compile time assert instead of a runtime one
This will catch this being out of date more quickly in the future
2023-12-26 09:57:11 -08:00
Sam Lantinga d6fb0d91d8 Added testpen to the Visual Studio solution 2023-12-26 09:55:09 -08:00
Susko3 bbdd41f287 Fix windows touch using wrong axis for normalisation
Regressed with 9302d7732d
2023-12-26 09:12:17 -08:00
Susko3 a28ac29aa0 Add missing cursor types
The flowing assert would trip:
    SDL_assert(SDL_arraysize(cursorNames) == SDL_NUM_SYSTEM_CURSORS)
2023-12-26 09:12:17 -08:00
Tyson Whitehead 6daf2e943f Try SDL_UDEV_deviceclass to detect joysticks even if in a container
The udev container issue is mostly to do with device notifications
and netlink. The device classification stuff just pokes file in /sys
and /run/udev. Doesn't hurt to try it first for classifying joysticks
and then fall to the guess heuristics if it fails.
2023-12-24 22:39:16 -08:00
Sam Lantinga 1bf78ed544 We get a resize event when the view enters fullscreen mode on iOS
The call stack is:

We want to use this instead of the desktop mode because the view may be in a different orientation than the device orientation, which the desktop mode is based on.
2023-12-24 17:45:35 -08:00
Sam Lantinga e3b5999bb4 Use the application requested size to determine automatic orientation on iOS
Fixes https://github.com/libsdl-org/SDL/issues/8201
2023-12-24 17:14:16 -08:00
Sam Lantinga 278e3f9184 Whoops, fixed setting fullscreen flag 2023-12-24 17:12:01 -08:00
Sam Lantinga 69e60e0f1b Fixed setting fullscreen mode on iOS
Needed to update the actual window flags based on the requested state (@Kontrabant)
2023-12-24 16:24:22 -08:00
Sam Lantinga 0e5ea3cc4b Fixed infinite recursion when adding an accelerometer as joystick on iOS
Fixes https://github.com/libsdl-org/SDL/issues/8716
2023-12-24 11:19:16 -08:00
Sam Lantinga c3d84c3342 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
2023-12-24 08:12:14 -08:00
Julian Uy 10a8b750a0 Use common generic syscond for platforms with no cond implementation 2023-12-24 06:52:42 -08:00
Julian Uy 4914e5bb78 PS2 use WaitSemaEx for waiting for semaphore with timeout 2023-12-24 06:52:27 -08:00
Sam Lantinga bb0e0ae080 Added a runtime check for BLUETOOTH_CONNECT in addition to BLUETOOTH (thanks @perepujal!)
Fixes https://github.com/libsdl-org/SDL/issues/8731
2023-12-24 06:50:42 -08:00
Sylvain 312f98c2a1 Make sure the string is terminated, fixed invalid read in SDL_PrivateParseGamepadConfigString() 2023-12-23 12:55:21 -08:00
Frank Praznik 199f7cc3b1 x11: Ignore border extents when the border hint is unset
Old extent events can arrive after the border hint has been unset. Ignore the reported values in this case to avoid reporting bogus border sizes.
2023-12-22 12:19:28 -05:00
SDL Wiki Bot 07e9603398 Sync SDL3 wiki -> header 2023-12-22 17:14:22 +00:00
Sylvain ffd82fb7c4 Add scaleMode to SDL_SoftStretch(), remove SDL_SoftStretchLinear(). 2023-12-22 09:13:21 -08:00
Sylvain 5dba04b29b Remove SDL_{Set,Get}SurfaceScale().
Add Scale parameter to SDL_BlitSurfaceScaled() and SDL_BlitSurfaceScaledUnchecked()
(see #8732)
2023-12-22 02:08:49 -08:00