Commit Graph

14990 Commits (e19b6c0b95893b4e86737a44e9236d6cddd116f0)

Author SHA1 Message Date
Anonymous Maarten e19b6c0b95 Add releaser script + workflow 2024-03-23 21:41:23 +01:00
Anonymous Maarten c81d11fae4 mingw: add pkg-support files (INSTALL.txt and Makefile) 2024-03-23 21:41:20 +01:00
Anonymous Maarten 4defea47e1 dmg: fix sdl3-config.cmake 2024-03-23 21:41:20 +01:00
Anonymous Maarten 2ed0143425 visualc: fix sdl3-config.cmake 2024-03-23 21:41:20 +01:00
Anonymous Maarten 75a71bde4b cmake: build tests against installed SDL prefix 2024-03-23 21:41:20 +01:00
Anonymous Maarten 7f888f98f7 gles2: only build tests when building SDL3 or when the headers are available 2024-03-23 21:41:20 +01:00
Frank Praznik 297f8e41af wayland: Factor out the general SHM buffer allocation/free functions from the cursor code
It will be necessary for a forthcoming toplevel icon setting protocol that will likely soon call for implementations, and is cleaner in general.
2024-03-23 14:17:13 -04:00
Sam Lantinga 3d96c2426f PSP: improve performance counter res to us granularity (thanks @rofl0r!) 2024-03-23 09:34:07 -07:00
Anonymous Maarten c493b40cc3 testffmpeg_vulkan: fix -Wincompatible-pointer-types warning
```
[1/1] Building C object test/CMakeFiles/testffmpeg.dir/testffmpeg_vulkan.c.o
/src/SDL/test/testffmpeg_vulkan.c: In function ‘BeginVulkanFrameRendering’:
/src/SDL/test/testffmpeg_vulkan.c:787:20: warning: passing argument 1 of ‘vk->lock_frame’ from incompatible pointer type [-Wincompatible-pointer-types]
  787 |     vk->lock_frame(frames, pVkFrame);
      |                    ^~~~~~
      |                    |
      |                    AVHWFramesContext *
/src/SDL/test/testffmpeg_vulkan.c:787:20: note: expected ‘struct AVHWFramesContext *’ but argument is of type ‘AVHWFramesContext *’
/src/SDL/test/testffmpeg_vulkan.c: In function ‘FinishVulkanFrameRendering’:
/src/SDL/test/testffmpeg_vulkan.c:885:22: warning: passing argument 1 of ‘vk->unlock_frame’ from incompatible pointer type [-Wincompatible-pointer-types]
  885 |     vk->unlock_frame(frames, pVkFrame);
      |                      ^~~~~~
      |                      |
      |                      AVHWFramesContext *
/src/SDL/test/testffmpeg_vulkan.c:885:22: note: expected ‘struct AVHWFramesContext *’ but argument is of type ‘AVHWFramesContext *’
```
2024-03-22 11:05:13 -07:00
Marcel Hild 67e425bcf8 Add support for MadCatz Saitek Side Panel Control Deck
Signed-off-by: Marcel Hild <hild@b4mad.net>
2024-03-22 09:15:39 -07:00
Sam Lantinga 05b57f6c2c Simplified SDL_SYS_RemovePath()
If we get ENOENT we call that success. If the parent directory doesn't exist, that's fine, other operations on it will fail if it matters to the application.
2024-03-21 21:16:14 -07:00
Anonymous Maarten 2521ba47fe jack: set error message when failing to open jack client 2024-03-22 01:22:39 +01:00
Mark Delk dd4636e3fd SDL_sysmutex.c: fix void return compile error 2024-03-21 13:25:01 -07:00
Sam Lantinga 917d683811 Moved SDL_JoyBallEvent together with the other joystick events 2024-03-21 12:51:59 -07:00
Ozkan Sezer 888cc29df6 add missing `reserved` field to struct SDL_JoyBallEvent,
Fixes https://github.com/libsdl-org/SDL/issues/9327
2024-03-21 20:10:50 +03:00
Sam Lantinga 70b0d33106 Poll for the initial controller state when using DirectInput
This fixes getting a deflected axis as the first buffered input reading on a generic USB controller (G-Shark GS-GP702)
2024-03-20 10:45:11 -07:00
Frank Praznik 4a7e3beeb9 filesystem: Use high-res file times on more platforms
Some POSIX platforms don't define macros to note the presence of the POSIX.1-2008 st_*tim timespec members of the stat struct, so check if this member exists during CMake configuration and conditionally enable it.

Apple platforms use st_*timespec naming, which is supported as of OSX 10.6. SDL3 requires 10.9+, so no fallback is needed.

Android only supports the POSIX.1-2008 semantics as of API version 26 or higher, so this has to be conditionally enabled in the makefile build via an API version definition check.

In other cases, file times fall back to the legacy path with second precision.
2024-03-20 11:39:42 -04:00
Sam Lantinga 18feaa52dd Fixed comment at the top of testtime.c 2024-03-19 17:09:08 -07:00
Sam Lantinga e0ef4dac85 Fixed int to float conversion warnings 2024-03-19 17:07:52 -07:00
Sam Lantinga 3316587113 Fixed warning C4389: '==': signed/unsigned mismatch 2024-03-19 17:04:29 -07:00
Sam Lantinga da027ec3ee Fixed signed/unsigned comparison warning 2024-03-19 17:00:46 -07:00
Pierre Wendling 390fff4ae0 N3DS: Fix locale name and early return.
- The name for simplified Chinese should be `zh_CN`.
- Ensure `cfguExit` is called even if `CFGU_GetSystemLanguage` failed.
2024-03-19 16:54:07 -07:00
Pierre Wendling 8f529d9d16 N3DS: Implement SDL_GetSystemTimeLocalePreferences
The formats are deduced based on the system's current language and region.
2024-03-19 16:52:56 -07:00
Sam Lantinga ed5d2bdda5 Fixed adding duplicate fsops files to CMakeLists.txt 2024-03-19 16:20:55 -07:00
Sam Lantinga 478b965e6c Fixed warning C4702: unreachable code
Also switched SDL_IOFromFile() to use SDL_InvalidParamError()
2024-03-19 16:02:54 -07:00
Sam Lantinga b1215272ad Fixed warning C4244: '=': conversion from '__int64' to 'int', possible loss of data 2024-03-19 16:02:37 -07:00
Sam Lantinga 2265d22f75 Updated Xcode project for time APIs 2024-03-19 14:53:55 -07:00
Sam Lantinga c582a89f78 Fixed build warning 2024-03-19 14:53:49 -07:00
Susko3 b90fed094f Standardise header includes
Changes "SDL_*.h" and "SDL3/SDL_*.h" to <SDL3/SDL_*.h>
2024-03-19 13:41:53 -07:00
Ivan Epifanov 2e45568338 PSVita: fix SDL_GetSystemTimeLocalePreferences 2024-03-19 12:32:51 -07:00
SDL Wiki Bot ba0417db40 Sync SDL3 wiki -> header 2024-03-19 17:58:24 +00:00
Frank Praznik a6fbf0488c Add time and realtime clock functions
Adds functions to query the system's realtime clock, convert time intervals to/from a calendar date and time in either UTC or the local time, and perform time related calculations.

An SDL_Time type (a time interval represented in nanoseconds), and SDL_DateTime struct (broken down calendar date and time) were added to facilitate this functionality.

Querying the system time results in a value expressed in nanoseconds since the Unix epoch (Jan 1, 1970) in UTC +0000. Conversions to and from the various platform epochs and units are performed when required.

Any direct handling of timezones and DST were intentionally avoided. The offset from UTC is provided when converting from UTC to a local time by calculating the difference between the original UTC and the resulting local time, but no other timezone or DST information is used.

The preferred date formatting and 12/24 hour time for the system locale can be retrieved via global preferences.

Helper functions for obtaining the day of week or day or year for calendar date, and getting the number of days in a month in a given year are provided for convenience. These are simple, but useful for performing various time related calculations.

An automated test for time conversion is included, as is a simple standalone test to display the current system date and time onscreen along with a calendar, the rendering of which demonstrates the use of the utility functions (press up/down to increment or decrement the current month, and keys 1-5 to change the date and time formats).
2024-03-19 10:57:36 -07:00
kanjitalk755 b6c9a72740 Add SDL_storage files to Xcode project 2024-03-18 22:52:58 -07:00
SDL Wiki Bot b2682da035 Sync SDL3 wiki -> header 2024-03-19 04:57:27 +00:00
Sam Lantinga 24ec1c09b9 Renamed SDL_PROP_IOSTREAM_STDIO_HANDLE_POINTER to SDL_PROP_IOSTREAM_STDIO_FILE_POINTER 2024-03-18 21:56:11 -07:00
Cameron Gutman d3a785e521 Improve event processing latency when gamepad/sensor is open
By using the SDL_WaitEventTimeout_Device() path even when polling is required,
we can still achieve sub-millisecond latency for non-gamepad/sensor events when
a gamepad or sensor is in use by the application.
2024-03-18 21:52:42 -07:00
Frank Praznik 1eb7b79986 video: Prepend global video property with "SDL" 2024-03-18 21:52:39 -04:00
Sam Lantinga 784311c20e Fixed duplicate SDL_Version change 2024-03-18 13:59:03 -07:00
Anonymous Maarten 009318c5a9 Fix warnings when building with -DSDL_LIBC=OFF on Linux 2024-03-18 21:29:08 +01:00
Anonymous Maarten f59dbf6a12 cmake: add -Wimplicit-fallthrough warning 2024-03-18 20:34:50 +01:00
Sam Lantinga 086a7a4687 Fixed signed/unsigned comparison warning 2024-03-18 09:48:45 -07:00
Sam Lantinga 491f18eea3 Fixed uninitialized signal_id
Also removed unnecessary SDL_OutOfMemory() calls

Fixes https://github.com/libsdl-org/SDL/issues/9300
2024-03-18 09:12:51 -07:00
Sam Lantinga 90e2551c4f Sort the SDL API symbols
API renames are almost complete, let's prepare for a preview release
2024-03-18 09:03:36 -07:00
SDL Wiki Bot 0d0aaa2d75 Sync SDL3 wiki -> header 2024-03-18 15:57:23 +00:00
Sam Lantinga 92d01ef12a You can pass NULL to SDL_GetPathInfo() and SDL_GetStoragePathInfo() to test for the existence of a file. 2024-03-18 08:56:24 -07:00
Frank Praznik ebb6582534 wayland: Handle the toplevel export property as a string
xdg-toplevel export handles are strings, so treat the property as one. Avoids the need to manually manage the string pointer.
2024-03-18 11:41:02 -04:00
Petar Popovic 9072b994f7 src/filesystem/unix/SDL_sysfilesystem.c add <stdio.h> inclusion
gets rid of some warnings
2024-03-18 15:55:40 +03:00
Mathieu Eyraud 6af979975f Add missing break 2024-03-18 15:55:14 +03:00
SDL Wiki Bot fc26d5d328 Sync SDL3 wiki -> header 2024-03-18 04:28:30 +00:00
Sam Lantinga a1a0156756 Renamed SDL_SizeIO() SDL_GetIOSize() 2024-03-18 00:27:18 -04:00