Commit Graph

2342 Commits (a65982e15dca1820a1a0c50652bb8ec3b910e3ca)

Author SHA1 Message Date
Sam Lantinga b9a88bbecb Removed SDL_TextInputShown()
This was only implemented on Windows and often confused with SDL_ScreenKeyboardShown()
2024-03-25 13:26:23 -07:00
Sam Lantinga 6443c75eda Removed SDL_TEXTINPUTEVENT_TEXT_SIZE 2024-03-25 13:26:23 -07:00
Cameron Gutman f14fb979c1 Remove legacy SDL2 input grab API 2024-03-24 16:53:23 -07:00
Sam Lantinga 36e73bdda4 Updated to version 3.1.0 for the preview release 2024-03-24 06:16:02 -07:00
Anonymous Maarten 1d0e5286aa Limit CPU features through a hint 2024-03-23 16:36:44 -07:00
SDL Wiki Bot 675216e81b Sync SDL3 wiki -> header 2024-03-23 23:32:24 +00:00
Sam Lantinga 72fc6f86e5 Text input is no longer automatically enabled when initializing video.
Fixes https://github.com/libsdl-org/SDL/issues/9309
Fixes https://github.com/libsdl-org/SDL/issues/9268
2024-03-23 16:31:00 -07:00
Sam Lantinga 9eb87ca325 Note that many things are considered mice and keyboards that you might not expect 2024-03-23 16:31:00 -07:00
Sam Lantinga c0f4565552 Added SDL_GetKeyboardName() and SDL_GetMouseName() 2024-03-23 16:31:00 -07:00
Sam Lantinga d1eb4adb16 Be explicit about the event mouse and keyboard ID 2024-03-23 16:31:00 -07:00
Sam Lantinga 2fe1a6a279 Initial support for hotplugging mice and keyboards 2024-03-23 16:31:00 -07:00
Sam Lantinga 171ff041d0 Removed invalid ascii from headers 2024-03-23 16:31:00 -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
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 2265d22f75 Updated Xcode project for time APIs 2024-03-19 14:53:55 -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
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
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
Frank Praznik 1eb7b79986 video: Prepend global video property with "SDL" 2024-03-18 21:52:39 -04: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
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
Sam Lantinga df0f5deddf Added SDL_IOFromDynamicMem() 2024-03-18 00:27:18 -04:00
Sam Lantinga 747300b356 SDL file times are 64-bit integers representing nanoseconds since the Unix epoch 2024-03-17 13:21:04 -07:00
SDL Wiki Bot e7b9f75e62 Sync SDL3 wiki -> header 2024-03-17 19:29:22 +00:00
Sam Lantinga d65ae710a1 Renamed SDL_LogGetOutputFunction() and SDL_LogSetOutputFunction() to match SDL 3.0 naming convention 2024-03-17 12:28:11 -07:00
Sam Lantinga d8a54cd4f8 Updated "see also" references to be more consistent
Fixes https://github.com/libsdl-org/SDL/issues/9282
2024-03-17 12:28:11 -07:00
SDL Wiki Bot a206e1e3c0 Sync SDL3 wiki -> header 2024-03-17 15:40:25 +00:00
Sam Lantinga f460f42e70 Added filesystem operations to SDL_Storage 2024-03-17 08:39:43 -07:00
Sam Lantinga 7a088527c1 Removed the reserved parameter from SDL_EnumerateDirectoryCallback
If someone needs to, say, include an SDL_Storage object, they can simply point userdata at a structure that includes the the storage and any other data needed in enumeration.
2024-03-17 08:39:43 -07:00
Sam Lantinga ec3ba387d1 Added SDL_OpenFileStorage() for local file storage 2024-03-17 08:39:43 -07:00
Sam Lantinga db0c1d7aeb Added portable file and directory operations (thanks @icculus!) 2024-03-17 08:39:43 -07:00
Sam Lantinga fe5c34d4bd Renamed storage functions to match SDL 3.0 naming convention 2024-03-17 08:39:43 -07:00
SDL Wiki Bot 9ccde0def4 Sync SDL3 wiki -> header 2024-03-16 14:20:24 +00:00
Ethan Lee 744227e6ab Add SDL_storage 2024-03-16 07:19:50 -07:00
Frank Praznik 19764ffcc8 wayland: Add the xdg-foreign-unstable-v2 protocol
Add the xdg-foreign-unstable-v2 protocol and use it to create export handles for toplevel windows, which will be used when an external component, such as the file chooser portal, requires it.
2024-03-15 18:30:05 -04:00
Petar Popovic 2b45452dd5 Adding comments to init-flags SDL_INIT_AUDIO and SDL_INIT_SENSOR that they imply SDL_INIT_EVENTS
When initializing SDL with the flag SDL_INIT_AUDIO or SDL_INIT_SENSOR the event subsystem also gets initialized(SDL_INIT_EVENTS). This isn't mentioned in the comments.
This commit adds these two comments.
2024-03-15 13:10:49 -07:00
SDL Wiki Bot fa7ec59ecd Sync SDL3 wiki -> header 2024-03-15 19:59:26 +00:00
Ryan C. Gordon b7cda16613
iostream: Final fixes before merging.
- SDL_GetRWProperties -> SDL_GetIOProperties
- SDL_GetRWStatus -> SDL_GetIOStatus
- Some documentation corrections and improvements.
2024-03-15 15:37:03 -04:00
Ryan C. Gordon c175eb488c
iostream: Note that the new name has nothing to do with C++'s iostream class. 2024-03-15 01:16:31 -04:00
Ryan C. Gordon 5a21d87e69
rwops: Changed filenames that reference "rwops" to "iostream". 2024-03-14 23:30:59 -04:00
Ryan C. Gordon 6776b6108a
iostream: "free*" params should be "closeio". 2024-03-14 23:14:46 -04:00
Ryan C. Gordon 3a344cf877
rwops: Fixed some SDL2 symbols that got missed. 2024-03-14 21:57:21 -04:00
Ryan C. Gordon fc7afa9cbf
rwops: Renamed SDL_RWops to SDL_IOStream, and other related symbols. 2024-03-14 19:38:12 -04:00
Ryan C. Gordon fe33b2a81b
rwops: Give implementations access to status value. 2024-03-14 19:37:07 -04:00