Commit Graph

7654 Commits

Author SHA1 Message Date
Ryan C. Gordon
c0bd18f023 khronos: Fixed a typo in a Vulkan header, to match upstream.
Fixes #7916.
2023-07-03 11:03:20 -04:00
Sam Lantinga
f010411492 Rename SDL_strtokr() to SDL_strtok_r()
Fixes https://github.com/libsdl-org/SDL/issues/7914
2023-07-03 06:20:06 -07:00
Sam Lantinga
3c04be4486 The rectangles passed to SDL_BlitSurfaceUnchecked() and SDL_BlitSurfaceUncheckedScaled() are const.
The destination rectangle passed to SDL_BlitSurface() and SDL_BlitSurfaceScaled() is non-const and filled in with the final destination rectangle after clipping, and now documented as such.

Fixes https://github.com/libsdl-org/SDL/issues/7911
2023-07-02 18:45:11 -07:00
Sam Lantinga
4aee17b039 Resorted symbols alphabetically
This can be be done now, before the ABI is frozen
2023-07-02 00:06:55 -07:00
Sam Lantinga
50b6e5eb7e Implemented SDL_LoadBMP() and SDL_SaveBMP() as functions
Fixes https://github.com/libsdl-org/SDL/issues/7902
2023-07-02 00:00:06 -07:00
Sam Lantinga
e264bb5178 Rename SDL_PIXELFORMAT_RGB888 and SDL_PIXELFORMAT_BGR888 to SDL_PIXELFORMAT_XRGB8888 and SDL_PIXELFORMAT_XBGR8888 for clarity
Fixes https://github.com/libsdl-org/SDL/issues/7903
2023-07-01 17:58:34 -07:00
Ryan C. Gordon
9d39e50f29 rwops: Use SetFilePointerEx on Windows for appending writes.
Fixes #7900.

(cherry picked from commit 769bf2ebcc)
2023-07-01 00:37:18 -04:00
Sam Lantinga
5b9fdc9dd1 Revert "Zenity has deprecated --icon-name in favor of --icon"
This reverts commit 55c3c1b05c.

It turns out many Linux distributions are shipping zenity which doesn't support the new --icon option. We'll need a more robust fix for this.
2023-06-29 23:01:36 -07:00
Sam Lantinga
55c3c1b05c Zenity has deprecated --icon-name in favor of --icon
Fixes https://github.com/libsdl-org/SDL/issues/7895
2023-06-29 22:45:59 -07:00
Sam Lantinga
18ff0d1878 Fixed build 2023-06-29 22:40:57 -07:00
Sam Lantinga
69c7a49990 Fixed build warnings 2023-06-29 22:15:23 -07:00
Sam Lantinga
8da9b22c17 The SDL_WINDOW_SKIP_TASKBAR flag has been replaced by the SDL_WINDOW_UTILITY flag
The SDL_WINDOW_UTILITY flag has the same functionality, and is now implemented on Windows.
2023-06-29 21:43:17 -07:00
Sam Lantinga
675fc8c38f Added Linux mapping for the Logitech Chillstream
Fixes https://github.com/libsdl-org/SDL/issues/7829
2023-06-29 16:10:55 -07:00
Sam Lantinga
ba9e924e57 Added additional debug logging for Linux joysticks 2023-06-29 16:09:55 -07:00
Sam Lantinga
ffa146f0bc On Windows the mouse speed is affected by the content scale
Fixes https://github.com/libsdl-org/SDL/issues/7802
2023-06-29 14:38:26 -07:00
Sam Lantinga
baa9c57581 Added support for the Nintendo Online Famicom controllers 2023-06-28 19:15:43 -07:00
Simon McVittie
10fc3b3db7 evdev: Use time64-friendly accessors for struct input_event
On 32-bit platforms such as i386, if SDL is compiled with -D_TIME_BITS=64
to opt-in to ABIs that will not stop working in 2038, the fields in
this struct change their naming and interpretation.

The Linux header <linux/input.h> defines macros input_event_sec and
input_event_usec which resolve to the right struct field to look at.
The actual field names and types are an implementation detail,
historically signed 32-bit time.tv_sec and time.tv_usec on 32-bit
platforms, but becoming unsigned __sec and __usec when using 64-bit
time (which makes them able to represent times up to 2106).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-28 12:35:12 -07:00
Frank Praznik
e7327b6c73 wayland: Flush cached themes on a theme change
Flush the cached themes when the system cursor theme changes so that the stale cached value won't be used.
2023-06-28 14:53:11 -04:00
capehill
8315a00a01 Fix crash in AudioConvertByteswap 2023-06-28 14:47:10 -04:00
Frank Praznik
fd6cb4dc86 wayland: Add a DBus message handler for the cursor size and theme properties.
Add a DBus message handler to watch and respond to changes to the system cursor size and theme properties. Upon these settings being changed, a cursor refresh will be triggered so the new changes will take effect immediately, without the cursor having to leave and re-enter the window surface.
2023-06-28 13:58:05 -04:00
Sam Lantinga
e643d28d9c Set the hint value before calling hint callbacks
This allows the hint callbacks to perform more complicated logic involving multiple hints without worrying about which hint has been changed.
2023-06-28 08:53:48 -07:00
Sam Lantinga
cc5e9ffe70 Don't crash if SDL_MapRGB() and SDL_MapRGBA() are passed a NULL format 2023-06-27 16:08:19 -07:00
Sam Lantinga
9ee1200e6f Fixed Nintendo Switch Pro controllers that don't have readable user calibration 2023-06-27 07:48:42 -07:00
Sam Lantinga
c065a9b128 Fix some issues caught by check_stdlib_usage.py 2023-06-27 06:19:06 -07:00
Frank Praznik
9ab2025127 wayland: Don't initialize OpenGL when the window flags didn't specify it
Applications that don't specify a rendering flag are likely handling Vulkan/GL themselves, so SDL loading OpenGL by default in this case is unnecessary overhead, and if a render backend requires it, the window will be recreated with the appropriate flags when the renderer is initialized.
2023-06-26 13:57:48 -04:00
Narr the Reg
425062c123 hidapi: switch: Handle MCU input reports 2023-06-26 10:01:49 -07:00
Ozkan Sezer
02398a8f11 Allow building against old Linux kernels. 2023-06-26 18:01:50 +03:00
Sam Lantinga
fd062657dd Fixed build 2023-06-26 07:43:44 -07:00
meyraud705
6cc21af900 Don't keep sensor file open while sensors are disabled 2023-06-26 07:32:40 -07:00
meyraud705
9cfac88054 Improve sensor detection for Linux gamepad 2023-06-26 07:32:40 -07:00
meyraud705
000277060c Add support for sensor to joystick on Linux (evdev) 2023-06-26 07:32:40 -07:00
Sylvain
95727b5c7d use of SDL functions 2023-06-25 15:50:23 -07:00
Sam Lantinga
87e916dd21 SDL_FindFreePlayerIndex() will always return the next available player index
Fixes https://github.com/libsdl-org/SDL/issues/7868
2023-06-24 15:38:38 -07:00
Sam Lantinga
267fdd7daa Removed Bluetooth connection detection now that we get it from hidapi 2023-06-23 15:50:07 -07:00
Sam Lantinga
44bae1e8a9 Corrected the Victrix FS Pro as a PS4 controller instead of a PS3 controller 2023-06-23 14:27:21 -07:00
Sam Lantinga
6b12fbc6b7 Re-add the simpler SDL_DBus_AppendDictWithKeyValue() function 2023-06-23 07:28:05 -07:00
Sylvain
6f344f29b8 After using SDL_qsort, mark sort_entries() as SDLCALL 2023-06-23 12:52:05 +02:00
Sylvain
6cde3835f0 Remove some use of C runtime functions (strlen, qsort) 2023-06-23 10:51:15 +02:00
Sam Lantinga
a807b14957 Greatly improved Xbox One controller initialization sequence 2023-06-22 17:15:35 -07:00
Sylvain
8b86e3073d Revert "Android: also protect Hat/Joy/PadDown,Up so there are not sent without window"
This reverts commit 8f83ccd750.
2023-06-22 23:30:41 +02:00
Sylvain
8f83ccd750 Android: also protect Hat/Joy/PadDown,Up so there are not sent without window 2023-06-22 16:25:22 +02:00
Sylvain
4339113072 SDL_DBus_AppendDictWithKeyValue: allows several key/value for other PRs 2023-06-22 10:50:35 +02:00
Sam Lantinga
8aee6908bb Make sure we send update complete events for delayed guide buttons 2023-06-21 18:42:25 -07:00
Sam Lantinga
4c9fb3e169 Added the events SDL_EVENT_JOYSTICK_UPDATE_COMPLETE and SDL_EVENT_GAMEPAD_UPDATE_COMPLETE
This allows the application to tell when a joystick polling cycle is complete and can process state changes as a single atomic update. It is disabled by default, at least for now.
2023-06-21 13:59:53 -07:00
Sam Lantinga
214d5daa3c Removed 100 ms hitch when querying third party Nintendo Switch controllers that don't respond to request for info
Also take advantage of the fact that we know whether the device is connected over Bluetooth now.
2023-06-21 12:14:50 -07:00
Sam Lantinga
3694dabe7c Use default sensor calibration if we can't read it from the Nintendo Switch controller
Fixes https://github.com/libsdl-org/SDL/issues/7830
2023-06-21 10:28:45 -07:00
Sam Lantinga
5f3213eb0e Added support for gamepad sensor fusion with the Razer Kishi 2023-06-20 08:41:15 -07:00
Simon McVittie
91198baed4 ibus: Handle error when getting the D-Bus machine ID
It is possible for retrieving the machine ID to fail, either because
dbus was installed incorrectly (machine ID absent or corrupt), or in
32-bit builds, because stat() on the machine ID fails with EOVERFLOW
if it has an out-of-range timestamp or inode number.

dbus has historically treated this as a faulty installation, raising
a warning which by default causes the process to crash. Unfortunately,
dbus_get_local_machine_id() never had a way to report errors, so it has
no alternative for that (bad) error handling.

In dbus >= 1.12.0, we can use dbus_try_get_local_machine_id() to get
the same information, but with the ability to cope gracefully with
errors. ibus won't work in this situation, but that's better than
crashing.

Mitigates: https://github.com/ValveSoftware/steam-for-linux/issues/9605
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-20 06:46:33 -07:00
Sam Lantinga
3ddbeab88f Moved Android sensor event handling to a separate thread
This makes it so you can interact with sensors on multiple threads, as long as only one thread initializes and cleans up the sensor subsystem.

This also has the benefit that sensor data is available as soon as possible.
2023-06-20 01:17:44 -07:00
Sam Lantinga
329e1b8b6a Update the sensors before the joysticks so the gamepad code gets fresh sensor readings 2023-06-19 19:42:01 -07:00