SDL Wiki Bot
7000a112a3
Sync SDL3 wiki -> header
2024-04-15 21:13:12 +00:00
Sam Lantinga
70ce808c09
Changed SDL_KeyCode values to defines
...
This clears up confusion about whether to use SDL_KeyCode or SDL_Keycode and makes it clear that the values aren't the full set of possible keycodes.
Fixes https://github.com/libsdl-org/SDL/issues/9493
2024-04-15 11:08:51 -10:00
Sam Lantinga
2fa4937e1a
Removed obsolete padding
2024-04-15 13:55:01 -07:00
SDL Wiki Bot
35c08c828b
Sync SDL3 wiki -> header
2024-04-15 19:23:27 +00:00
Sam Lantinga
1862a62b5d
Replaced SDL_GetNumTouchFingers() and SDL_GetTouchFinger() with SDL_GetTouchFingers()
...
Fixes https://github.com/libsdl-org/SDL/issues/9484
2024-04-15 09:22:41 -10:00
SDL Wiki Bot
cdcd346575
Sync SDL3 wiki -> header
2024-04-15 19:13:11 +00:00
SDL Wiki Bot
69ee186a1e
Sync SDL3 wiki -> header
2024-04-15 16:56:12 +00:00
Ozkan Sezer
f06f761c2f
remove SDL_quit.h include from SDL.h
2024-04-15 18:47:24 +03:00
Ryan C. Gordon
9c8c254af2
include: Removed SDL_quit.h
...
It only had one (sort of scary) macro in it.
Fixes #9534 .
2024-04-15 11:35:39 -04:00
SDL Wiki Bot
0397d23ed8
Sync SDL3 wiki -> header
2024-04-15 14:36:12 +00:00
Petar Popovic
56e6f05440
SDL_RendererFlip rename fixes
2024-04-15 03:32:23 -10:00
Anonymous Maarten
07b7ec68eb
Add SDLTest_CompareMemory function to compare memory ranges
2024-04-15 03:05:05 -10:00
Petar Popovic
875ddb4969
SDL_atomic.h rename fixes
...
Adding following macro to SDL_oldnames.h:
SDL_atomic_t SDL_atomic_t_renamed_SDL_AtomicInt
2024-04-15 09:02:39 -04:00
SDL Wiki Bot
1731d53d02
Sync SDL3 wiki -> header
2024-04-15 13:01:12 +00:00
SDL Wiki Bot
11de629dd2
Sync SDL3 wiki -> header
2024-04-14 05:50:22 +00:00
Ryan C. Gordon
291edc073c
include: Document SDL_TriggerBreakpoint.
2024-04-14 01:48:52 -04:00
SDL Wiki Bot
59c332e569
Sync SDL3 wiki -> header
2024-04-14 05:35:26 +00:00
Ryan C. Gordon
041de0c2eb
include: Some documentation improvements.
2024-04-14 01:33:56 -04:00
Ryan C. Gordon
21bc72bef1
wikiheaders: Allow parts of the headers to be ignored.
...
The specific cases here were SDL_size_mul_overflow_builtin and
SDL_size_add_overflow_builtin, which are forced-inline symbols in
SDL_stdinc.h that have to exist, but aren't really part of the public API,
and thus shouldn't be exported as documentation.
2024-04-13 22:57:23 -04:00
SDL Wiki Bot
e4f097805b
Sync SDL3 wiki -> header
2024-04-14 00:22:23 +00:00
Ryan C. Gordon
081a94e321
include: Updated a bunch of documentation.
2024-04-13 20:10:13 -04:00
Ryan C. Gordon
239b34d760
docs: Added some notes about iOS and the main callbacks.
2024-04-13 15:14:32 -04:00
SDL Wiki Bot
9c5ae7293f
Sync SDL3 wiki -> header
2024-04-13 18:59:10 +00:00
SDL Wiki Bot
cae90ef489
Sync SDL3 wiki -> header
2024-04-13 18:38:11 +00:00
Ryan C. Gordon
6e1ed94913
ios: Renamed APIs that referred to "iPhone" to refer to "iOS".
...
Macros that papered over this difference in SDL2 have been removed for SDL3.
Fixes #9527 .
2024-04-13 14:30:30 -04:00
Ryan C. Gordon
d252a8fe12
joystick: SDL_VirtualJoystickDesc no longer takes a struct version.
...
If we need to extend this in the future, we'll make a second struct and
a second SDL_AttachVirtualJoystickEx-style function that uses it.
Just zero the struct and don't set a version.
Fixes #9489 .
2024-04-13 14:16:12 -04:00
SDL Wiki Bot
202bd7b0ff
Sync SDL3 wiki -> header
2024-04-13 13:24:25 +00:00
Ryan C. Gordon
f01b34fd8d
include: Removed some SDL2 references in the documentation.
2024-04-13 09:23:37 -04:00
Ryan C. Gordon
98e9f361a8
winrt: Remove SDL_WinRTGetFSPathUNICODE, rename SDL_WinRTGetFSPathUTF8.
...
Fixes #9470 .
2024-04-13 08:24:12 -04:00
SDL Wiki Bot
02da4acf0f
Sync SDL3 wiki -> header
2024-04-13 12:07:27 +00:00
Ryan C. Gordon
3f4ac1a3c7
winrt: Implemented SDL_GetUserFolder() for WinRT/UWP.
2024-04-13 08:05:43 -04:00
SDL Wiki Bot
cbb3c69cb0
Sync SDL3 wiki -> header
2024-04-13 01:10:12 +00:00
anon
03bc53fe31
include: Fixes the improper fix I made before of documentation, SDL_SensorType.
2024-04-12 14:51:52 -04:00
SDL Wiki Bot
935b6502ac
Sync SDL3 wiki -> header
2024-04-11 19:40:25 +00:00
anon
7ab8e4797e
include: Add documentation to SDL_MessageBoxColorType.
2024-04-11 15:39:58 -04:00
anon
1abaacedb2
include: Fix documentation generation for SDL_SensorType.
2024-04-11 15:38:54 -04:00
SDL Wiki Bot
2f4f1f6923
Sync SDL3 wiki -> header
2024-04-11 17:35:27 +00:00
Ryan C. Gordon
0df988389c
include: Add `\since` to all documentation that was missing it.
2024-04-11 13:34:29 -04:00
SDL Wiki Bot
073d2378dc
Sync SDL3 wiki -> header
2024-04-11 12:59:41 +00:00
Ryan C. Gordon
9421a01400
SDL_AudioStreamCallback: Note that there's no _requirement_ to do anything.
...
This is as opposed to something like the SDL2 audio callback, where you
_must_ supply data or disaster occurs.
2024-04-11 08:56:10 -04:00
Ryan C. Gordon
e47f2956cf
include: Documented SDL_bool a little.
2024-04-11 00:48:11 -04:00
Ryan C. Gordon
407e54e188
include: More improved docs for the wikibridge!
2024-04-11 00:37:11 -04:00
Ryan C. Gordon
f121553082
include: Fixed up SDL_AudioFormat documentation.
...
(this is not currently bridged to the wiki, but will be soon!)
2024-04-10 18:45:29 -04:00
SDL Wiki Bot
b2239cb7ba
Sync SDL3 wiki -> header
2024-04-10 19:59:14 +00:00
Ryan C. Gordon
557f26e6f0
include: Fixed up some more documentation.
2024-04-10 15:58:28 -04:00
Anonymous Maarten
06758685a5
stdinc: modify default alloca prototype
...
For compatibilty with TinyCC.
2024-04-10 08:03:46 +00:00
Petar Popovic
132cef91c8
Removing macro SDL_FColour from SDL_pixels.h
2024-04-09 18:20:03 -04:00
SDL Wiki Bot
534c44b156
Sync SDL3 wiki -> header
2024-04-09 22:04:21 +00:00
Ryan C. Gordon
a15a46340f
SDL_revision: Added documentation.
2024-04-09 18:02:30 -04:00
Petar Popovic
f687e0732a
Doxygen comment fixes in SDL_pixels.h
2024-04-09 16:57:34 -04:00
SDL Wiki Bot
196d123c66
Sync SDL3 wiki -> header
2024-04-09 16:36:25 +00:00
David Gow
d321e19ee5
stdinc: Document maths functions
...
SDL_stdinc.h has a documentation comment for SDL_acos(), but nothing else. Expand on
that comment, and add comments for the remaining maths functions.
2024-04-09 12:35:42 -04:00
David Gow
afd91b5e9c
stdinc: Note that these functions match their C runtime equivalents
...
This header basically just consists of C runtime #defines and functions, but with
an SDL_ prefix. Note this in the documentation so people don't waste their time
reading through things they already understand.
2024-04-09 12:35:42 -04:00
Henry Wilson
629c694bd6
Fixed Doxygen comments
...
Added '*' to the start of Doxygen comments for SDL_FlipSurface and SDL_DuplicateSurface so they highlight properly in IDEs
2024-04-09 12:30:13 -04:00
Petar Popovic
9b5944a14f
Removing SDL_Colour macro
2024-04-09 12:25:36 -04:00
SDL Wiki Bot
baf09904b3
Sync SDL3 wiki -> header
2024-04-09 13:59:22 +00:00
Ryan C. Gordon
79dc6af98f
SDL_endian.h: Documented SDL_Swap* macros.
2024-04-09 09:58:01 -04:00
Ryan C. Gordon
e044318a8e
Sync SDL3 wiki -> headers
2024-04-09 00:50:03 -04:00
Ryan C. Gordon
ad090d2444
include: A ton of little documentation tweaks, fixes, and improvements.
...
This is just stuff I noticed while working on the wikiheaders updates. A
thorough pass over all the docs would not be terrible, and maybe a simple
script to check for consistency (does everything have a `\since` on it? etc)
might be nice, too.
2024-04-09 00:50:02 -04:00
Ryan C. Gordon
6906c50e8b
assert: SDL_AssertData::always_ignore should be an SDL_bool, not an int.
2024-04-09 00:50:01 -04:00
Petar Popovic
c8a066019b
Renaming SDL_eventaction to SDL_EventAction
2024-04-08 14:28:52 -04:00
Petar Popovic
1efadcc5d4
Revert renaming SDL_eventaction. adding it again in next commit with
...
scripts
This reverts commit f08c31060a .
2024-04-08 14:28:52 -04:00
Petar Popovic
764fe72449
SDL_time.h: Renaming enums SDL_DATE_FORMAT and SDL_TIME_FORMAT to SDL_DateFormat and SDL_TimeFormat
2024-04-07 23:03:01 -04:00
Petar Popovic
f08c31060a
Renaming SDL_eventaction to SDL_EventAction
2024-04-07 12:04:32 -04:00
Ryan C. Gordon
5c9dbf65a3
SDL_version.h: Fix some whitespace.
2024-04-06 02:09:48 -04:00
Semphris
6ad390fc50
File dialog improvements
...
- Add a globally-accessible function to handle the parsing of filter extensions
- Remove the ability of putting the wildcard ('*') among other patterns; it's either a list of patterns or a single '*' now
- Add a hint to select between portals and Zenity on Unix
2024-04-04 22:07:14 -07:00
Sam Lantinga
5fa87e29e7
Removed SDL_RENDERER_ACCELERATED and SDL_RENDERER_SOFTWARE
...
These flags are unnecessary and have always been a source of confusion.
2024-04-04 13:30:49 -07:00
Petar Popovic
3f8dba3713
Including SD_error.h into headers with error-returning functions
2024-04-04 11:12:58 -07:00
Ryan C. Gordon
e12b8e767a
SDL_filesystem.h: Fixed some whitespace.
2024-04-04 10:44:19 -04:00
SDL Wiki Bot
1a97d1f649
Sync SDL3 wiki -> header
2024-04-04 14:42:26 +00:00
Petar Popovic
de91aaa452
SDL_locale.h - SDL_GetPreferredLocales() - adding SDL_GetError() comment
2024-04-04 07:41:50 -07:00
Petar Popovic
7ae5474305
SDL_quit.h - removing SDL_error.h inclusion
2024-04-04 07:41:50 -07:00
Sam Lantinga
0abdc1a343
Renamed GLOBDIR to GLOB
2024-04-04 07:40:48 -07:00
SDL Wiki Bot
ac372e99fe
Sync SDL3 wiki -> header
2024-04-04 13:41:27 +00:00
Ryan C. Gordon
764207d873
filesystem: Added SDL_GlobDirectory() and SDL_GlobStorageDirectory().
...
Fixes #9287 .
2024-04-04 09:40:13 -04:00
Ryan C. Gordon
9192485746
filesystem: SDL_EnumerateDirectory should return -1 or 0.
...
The callback requesting a non-error stop should not return a special value.
2024-04-04 09:40:13 -04:00
Sam Lantinga
c7787a9191
The hint environment variables don't have the word "HINT" in them
...
Fixes https://github.com/libsdl-org/SDL/issues/9436
2024-04-02 19:24:07 -07:00
Sam Lantinga
17d4f8d699
Updated to version 3.1.1 for the preview release
2024-04-01 17:03:46 -07:00
Sam Lantinga
a82ed82bc7
SDL_QueryTexture() fills in a pointer to SDL_PixelFormatEnum
2024-04-01 15:45:22 -07:00
SDL Wiki Bot
18c8af6e48
Sync SDL3 wiki -> header
2024-04-01 21:00:26 +00:00
Sam Lantinga
8847b35244
Separate joystick power state into battery status and percentage
...
This allows you to see battery percentage while the controller is charging
2024-04-01 13:59:00 -07:00
Susko3
5f763083fc
Use SDL_EventType and fix event name in comment
2024-04-01 11:04:02 -07:00
Susko3
c40e9cc634
Sort includes
2024-04-01 11:04:02 -07:00
Susko3
c96bc8b1a2
Add missing includes for SDL_MouseID
...
Missed in f8844d387c and d1eb4adb16 .
2024-03-31 16:11:23 -07:00
SDL Wiki Bot
96c93d2252
Sync SDL3 wiki -> header
2024-03-29 19:02:25 +00:00
Ryan C. Gordon
49029c8454
stdinc: Document a bunch of ctype/string functions.
...
This is intended to help codify the rules for locale and Unicode in SDL3,
which were less-well defined in SDL2.
2024-03-29 15:01:40 -04:00
Ozkan Sezer
6cf71ca9a9
SDL_stdinc.h: Android passes sizeof(ENUM) == sizeof(int) assertion
...
Reference issue: https://github.com/libsdl-org/SDL/issues/9392 .
2024-03-28 20:28:02 +03:00
Ryan C. Gordon
0d007bbb01
psp: Fixed building with pspdev when not using CMake.
...
(psp-cmake defines `__PSP__` on the command line, but the compiler itself
only defines `__psp__` and some variations.
Fixes #9378 .
2024-03-28 09:27:21 -04:00
Ryan C. Gordon
38e3c6a4aa
main: Add an optional `appstate` param to main callback entry points.
...
This allows apps to maintain state data without using global variables.
Fixes #9377 .
2024-03-27 17:22:08 -04:00
SDL Wiki Bot
05b3605a41
Sync SDL3 wiki -> header
2024-03-27 18:02:23 +00:00
Frank Praznik
5abcfad352
video: Document that renderer lifetimes are tied to their associated windows
2024-03-27 11:01:41 -07:00
Sam Lantinga
823ab13b9c
SDL_CreateTexture() takes a SDL_PixelFormatEnum format parameter
2024-03-26 10:40:40 -07:00
Sam Lantinga
78c7834f90
Added SDL_HINT_WINDOWS_RAW_KEYBOARD to control whether raw keyboard is enabled on Windows
2024-03-25 20:41:05 -07:00
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
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
Ryan C. Gordon
447c29e65c
include: Added missing RWops documentation.
2024-03-14 19:37:07 -04:00
Ryan C. Gordon
cc58da4c63
rwops: Add SDL_GetRWStatus, make the statuses into an enum.
2024-03-14 19:37:06 -04:00
Ryan C. Gordon
e35c304022
rwops: Add properties for some of the internal implementation details.
2024-03-14 19:37:05 -04:00
Ryan C. Gordon
7d4d8ccde0
rwops: Rename everything from SDL_RWxxx to SDL_XxxRW.
2024-03-14 19:37:04 -04:00
Ryan C. Gordon
655ceb3b31
rwops: Renamed SDL_CreateRW and SDL_DestroyRW to SDL_OpenRW and SDL_CloseRW.
2024-03-14 19:37:01 -04:00
Ryan C. Gordon
525919b315
rwops: Reworked RWops for SDL3.
...
- SDL_RWops is now an opaque struct.
- SDL_AllocRW is gone. If an app is creating a custom RWops, they pass the
function pointers to SDL_CreateRW(), which are stored internally.
- SDL_RWclose is gone, there is only SDL_DestroyRW(), which calls the
implementation's `->close` method before freeing other things.
- There is only one path to create and use RWops now, so we don't have to
worry about whether `->close` will call SDL_DestroyRW, or if this will
risk any Properties not being released, etc.
- SDL_RWFrom* still works as expected, for getting a RWops without having
to supply your own implementation. Objects from these functions are also
destroyed with SDL_DestroyRW.
- Lots of other cleanup and SDL3ization of the library code.
2024-03-14 19:36:08 -04:00
SDL Wiki Bot
495e432fb9
Sync SDL3 wiki -> header
2024-03-14 22:41:24 +00:00
Semphris
70c2e15615
Add file dialogs
2024-03-14 15:40:25 -07:00
Sam Lantinga
6c11449cd4
Added a note for the SDL_CommonEvent type
2024-03-14 09:00:47 -07:00
Sam Lantinga
442073f379
Added missing reserved field in SDL_CameraDeviceEvent (thanks @Saalvage!)
2024-03-14 08:51:48 -07:00
Sam Lantinga
9bef331dc8
Note that SDL_UserEvent and SDL_Event type are intentionally Uint32
2024-03-14 08:49:02 -07:00
Sam Lantinga
3875ef4552
Removed duplicated line (thanks @sechshelme!)
...
Fixes https://github.com/libsdl-org/SDL/issues/9264
2024-03-13 13:47:32 -07:00
Sam Lantinga
efbbafb3f1
Re-added balls to the SDL joystick API
...
It turns out these were being used on Linux and at least one virtual driver was making use of them (thanks @mrfixit2001!)
2024-03-10 21:30:14 -07:00
Riccardo Marcangelo
6534029691
Add DualShock 3 HIDAPI support on Windows ( #9144 )
...
This adds HIDAPI support for DualShock 3 controllers on Windows, addressing the current absence of this feature in SDL. To utilize this functionality, the official Sony driver 'sixaxis.sys' must be installed. HID offers several advantages over DirectInput, including rumble support and the ability to control the LED lights that display the controller number.
2024-03-10 20:08:36 -07:00
Sam Lantinga
fde420a645
Revert "Added SDL_FLIP_DIAGONAL"
...
This reverts commit b9ab326982 .
@rainerdeyke pointed out:
"This commit is incorrect. Flipping both horizontally and vertically is not equivalent to flipping diagonally."
2024-03-10 15:20:36 -07:00
RPP-dev
b9ab326982
Added SDL_FLIP_DIAGONAL
...
Since SDL_RenderFlip is an enum, SDL_FLIP_HORIZONTAL and SDL_FLIP_VERTICAL can not be OR'ed to get the "SDL_FLIP_DIAGONAL".
Render code is actually able to perform these 3 kind of "flipping" so I just added a new enum called SDL_FLIP_DIAGONAL with the OR'ed value (3) so it can be used.
2024-03-10 09:27:14 -07:00
Tolik708
2a775cad6f
Named typedef-ed structs Gave name to structs that were defined like anonymous struct with name given by typedef. Example 'typedef struct {...} Foo;' -> 'typedef struct Foo {...} Foo;'
2024-03-10 09:04:18 -07:00
Sam Lantinga
37d066b99b
Clarify what pitch means (thanks @zlago!)
2024-03-10 09:02:59 -07:00
Ozkan Sezer
9e89f093d9
remove stale / wrong information from SDL_RWread() documentation
2024-03-08 18:55:19 +03:00
Sam Lantinga
790cd395f5
Make sure the type in the SDL_Event aligns properly across the union
2024-03-07 06:58:43 -08:00
Sam Lantinga
e9ab2d46de
Revert "Change `SDL_Keycode` type to an enum"
...
SDL_Keycode can actually be any printable character on the keyboard, so isn't limited to the enumerated values of SDL_KeyCode.
2024-03-07 06:58:43 -08:00
Sam Lantinga
33eaddc565
Cleaned up various type conversion issues
...
This makes sure SDL_PixelFormatEnum flows through the internal code correctly, as well as fixing a number of other minor issues.
2024-03-07 06:58:43 -08:00
Sam Lantinga
f53bdc9531
The pixel format in SDL_DisplayMode uses SDL_PixelFormatEnum
2024-03-07 03:39:06 -08:00
SDL Wiki Bot
59ab5c0824
Sync SDL3 wiki -> header
2024-03-07 00:20:27 +00:00
Sam Lantinga
c70710cde8
SDL_GetPixelFormatEnumForMasks() returns SDL_PixelFormatEnum
2024-03-06 16:19:08 -08:00
Susko3
722f4104bf
Use enums as types in SDL_*Event structures
...
The main `SDL_Event` union is not using the enum as
valid user events types are not in the enum.
2024-03-06 15:40:05 -08:00
Susko3
ce44eff3d2
Use `SDL_WindowFlags` in public headers
2024-03-06 15:08:12 -08:00
Susko3
4f58d18373
Typedef `SDL_WindowFlags`
...
Window flags were previously an enum with the same name.
See ebd7f9adbd .
2024-03-06 15:08:12 -08:00
Susko3
424616e032
Use SDL_PixelFormatEnum as type
2024-03-06 15:02:13 -08:00
Susko3
f8cb3c742d
Change `SDL_Keycode` type to an enum
2024-03-06 12:17:53 -08:00
Susko3
f8844d387c
Use specific types in SDL_touch.h
...
Missed when picking 7ff34249c7 from https://github.com/libsdl-org/SDL/pull/9191 .
2024-03-06 10:35:20 -08:00
SDL Wiki Bot
2d0cd90171
Sync SDL3 wiki -> header
2024-03-06 17:52:26 +00:00
Sam Lantinga
860155680d
SDL_RegisterEvents() now returns 0 if it couldn't allocate any user events.
2024-03-06 09:51:15 -08:00
Sam Lantinga
95fbbc6f07
Fixed accidental use of tabs
2024-03-05 16:55:26 -08:00
Susko3
e268cdbec6
Use specific types in public headers ( #9205 )
...
Uses specific typedef'd types instead of generic integral types where applicable.
2024-03-05 16:52:15 -08:00
Sam Lantinga
db24560387
Additional colorspace clarification
...
Note that SDL_MATRIX_COEFFICIENTS_BT470BG is functionally equivalent to SDL_MATRIX_COEFFICIENTS_BT601
2024-03-05 16:47:36 -08:00
Sam Lantinga
b3858ec5f7
BT2020_CL is very different from BT2020_NCL, and not currently supported
2024-03-05 15:49:17 -08:00
Sam Lantinga
9db68f97f9
Reverted SDL_Vulkan_GetInstanceExtensions() API change
...
This function is commonly used with Vulkan structures that use uint32_t, so we should keep the Uint32 signature.
2024-03-05 13:39:42 -08:00
SDL Wiki Bot
0b4a195f4b
Sync SDL3 wiki -> header
2024-03-05 21:32:25 +00:00
Sylvain
cea717e5d3
Removed some uneeded 'unsigned': renderer.num_texture_format and SDL_Vulkan_GetInstanceExtensions() prototype
2024-03-05 13:31:28 -08:00
SDL Wiki Bot
ffef13e1e1
Sync SDL3 wiki -> header
2024-03-04 17:30:25 +00:00
Sam Lantinga
48471f7dbd
Added SDL_AddVulkanRenderSemaphores() for external synchronization with SDL rendering
2024-03-04 09:29:36 -08:00
Sam Lantinga
2c85052966
Removed unused headers from SDL_rect.h
...
Fixes https://github.com/libsdl-org/SDL/issues/8966
2024-03-03 11:33:59 -08:00
Susko3
86d36a2dc2
Add missing include
2024-03-03 09:37:59 -08:00
Nour Fouad
e524e545f2
Add vulkan to SDL_HINT_RENDER_DRIVER
2024-03-02 15:17:09 -08:00
SDL Wiki Bot
27389716ac
Sync SDL3 wiki -> header
2024-03-02 23:05:24 +00:00
Sam Lantinga
7f9ff6277c
Don't assume HDR headroom for HDR10 surfaces
...
Applications that support HDR will set the correct values for their content.
2024-03-02 15:02:17 -08:00
SDL Wiki Bot
8c015cd3b6
Sync SDL3 wiki -> header
2024-03-02 18:02:26 +00:00
Sam Lantinga
8d023f9869
Updated documentation for new property parameters
2024-03-02 09:56:29 -08:00
Sam Lantinga
f2cd361e25
testyuv: added validation of P010 YUV format
...
Also added conversion between RGB and P010, using XRGB2101010 as a bridging format in PQ space
2024-03-01 20:26:52 -08:00
Ryan C. Gordon
1e8b006d43
stdlib: qsort and bsearch changes.
...
- Always use internal qsort and bsearch implementation.
- add "_r" reentrant versions.
The reasons for always using the internal versions is that the C runtime
versions' callbacks are not mark STDCALL, so we would have add bridge
functions for them anyhow, The C runtime qsort_r/qsort_s have different
orders of arguments on different platforms, and most importantly: qsort()
isn't a stable sort, and isn't guaranteed to give the same ordering for
two objects marked as equal by the callback...as such, Visual Studio and
glibc can give different sort results for the same data set...in this
sense, having one piece of code shared on all platforms makes sense here,
for reliabillity.
bsearch does not have a standard _r version at all, and suffers from the
same SDLCALL concern. Since the code is simple and we would have to work
around the C runtime, it's easier to just go with the built-in function
and remove all the CMake C runtime tests.
Fixes #9159 .
2024-03-01 08:28:12 -05:00
Sam Lantinga
af58ed978e
Fixed the documentation for SDL_GetGamepadMappings()
2024-03-01 01:55:56 -08:00
SDL Wiki Bot
7ff9be7398
Sync SDL3 wiki -> header
2024-03-01 01:39:28 +00:00
Sam Lantinga
0454e1fdb4
Vulkan: added support for wrapping existing textures
2024-02-29 17:38:10 -08:00
SDL Wiki Bot
68588b232c
Sync SDL3 wiki -> header
2024-02-28 15:13:26 +00:00
Sam Lantinga
614630df69
Allow using an external Vulkan device with the vulkan renderer
2024-02-28 07:12:15 -08:00
Sam Lantinga
220340e944
Remove SDL_PIXELFORMAT_P010
...
It's not supported by any renderer or pixel conversion path
2024-02-27 12:48:33 -08:00
Semphriss
84aaf63bd3
Fix typo in SDL_filesystem.h
2024-02-27 08:58:45 -08:00
SDL Wiki Bot
fbe7301aba
Sync SDL3 wiki -> header
2024-02-25 23:55:23 +00:00
Sam Lantinga
be51b7acea
Use the maximum potential headroom if EDR content isn't currently being displayed.
...
Also document that the HDR properties can change dynamically at runtime.
2024-02-25 15:54:34 -08:00
Sam Lantinga
276566235c
Removed SDL_ClearHints() from the public API
...
Fixes https://github.com/libsdl-org/SDL/issues/9129
2024-02-24 21:07:50 -08:00
SDL Wiki Bot
dfd8073a8f
Sync SDL3 wiki -> header
2024-02-22 22:59:24 +00:00
Dan Ginsburg
cab20117e6
Vulkan Renderer ( #9114 )
...
This pull request adds an implementation of a Vulkan Render backend to SDL. I have so far tested this primarily on Windows, but also smoke tested on Linux and macOS (MoltenVK). I have not tried it yet on Android, but it should be usable there as well (sans any bugs I missed). This began as a port of the SDL Direct3D12 Renderer, which is the closest thing to Vulkan as existed in the SDL codebase. The shaders are more or less identical (with the only differences being in descriptor bindings vs root descriptors). The shaders are built using the HLSL frontend of glslang.
Everything in the code is pure Vulkan 1.0 (no extensions), with the exception of HDR support which requires the Vulkan instance extension `VK_EXT_swapchain_colorspace`. The code could have been simplified considerably if I used dynamic rendering, push descriptors, extended dynamic state, and other modern Vulkan-isms, but I felt it was more important to make the code as vanilla Vulkan as possible so that it would run on any Vulkan implementation.
The main differences with the Direct3D12 renderer are:
* Having to manage renderpasses for performing clears. There is likely some optimization that would still remain for more efficient use of TBDR hardware where there might be some unnecessary load/stores, but it does attempt to do clears using renderpasses.
* Constant buffer data couldn't be directly updated in the command buffer since I didn't want to rely on push descriptors, so there is a persistently mapped buffer with increasing offset per swapchain image where CB data gets written.
* Many more resources are dependent on the swapchain resizing due to i.e. Vulkan requiring the VkFramebuffer to reference the VkImageView of the swapchain, so there is a bit more code around handling that than was necessary in D3D12.
* For NV12/NV21 textures, rather than there being plane data in the texture itself, the UV data is placed in a separate `VkImage`/`VkImageView`.
I've verified that `testcolorspace` works with both sRGB and HDR linear. I've tested `testoverlay` works with the various YUV/NV12/NV21 formats. I've tested `testsprite`. I've checked that window resizing and swapchain out-of-date handling when minimizing are working. I've run through `testautomation` with the render tests. I also have run several of the tests with Vulkan validation and synchronization validation. Surely I will have missed some things, but I think it's in a good state to be merged and build out from here.
2024-02-22 14:58:11 -08:00
SDL Wiki Bot
2132ba8985
Sync SDL3 wiki -> header
2024-02-22 03:26:22 +00:00
Sam Lantinga
54c2ba6afd
Added the Chrome HDR tonemap operator
...
Also added support for the SDL_PIXELFORMAT_XBGR2101010 pixel format to the D3D12, D3D11, and Metal renderers.
2024-02-21 19:25:49 -08:00
Sam Lantinga
4ba6aeee9d
A second take on HDR support with an SDR white point and HDR headroom
...
This better reflects how HDR content is actually used, e.g. most content is in the SDR range, with specular highlights and bright details beyond the SDR range, in the HDR headroom.
This more closely matches how HDR is handled on Apple platforms, as EDR.
This also greatly simplifies application code which no longer has to think about color scaling. SDR content is rendered at the appropriate brightness automatically, and HDR content is scaled to the correct range for the display HDR headroom.
2024-02-21 19:25:49 -08:00
SDL Wiki Bot
31fe061ab5
Sync SDL3 wiki -> header
2024-02-20 20:57:27 +00:00
Ryan C. Gordon
70b89ab70d
camera: Added SDL_GetCameraDevicePosition.
...
Otherwise, as a property, you have to open each camera device to figure out
which ones are which.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
8db2a3b27a
camera: Add an optional property that reports if a camera is back or front.
...
This is useful for iOS and Android, so an app can find the camera it cares
about in the list of devices.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
99d1337de2
camera: Reenabled macOS/iOS support, with rewritten CoreMedia implementation.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
22dbc0f32f
camera: Patched to compile after rebasing to latest in main.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
67708f9110
camera: Emscripten support!
...
This also adds code to deal with waiting for the user to approve camera
access, reworks testcameraminimal to use main callbacks, etc.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
182f707284
include: Fixed doxygen comments on new camera APIs.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
0b5875825e
camera: framerate support.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
87e7046fca
camera: Public API functions should say "Format" not "Spec" to match audio.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
d3e6ef3cc6
camera: Massive code reworking.
...
- Simplified public API, simplified backend interface.
- Camera device hotplug events.
- Thread code is split up so it backends that provide own threads can use it.
- Added "dummy" backend.
Note that CoreMedia (Apple) and Android backends need to be updated, as does
the testcamera app (testcameraminimal works).
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
cb10c80aaf
camera: Reworked to operate with a driver interface, like other subsystems.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
7ae955ce68
camera: Renamed everything from "video capture" to "camera", wired to CMake.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon
f49ce4a15d
camera: Renamed "video_capture" files to "camera" and moved to own subdir.
2024-02-20 15:56:26 -05:00
Sam Lantinga
8ce786d2b6
Property query functions don't set an error if they return the default value
...
You can call SDL_HasProperty() if you want to check to see if a property exists.
Fixes https://github.com/libsdl-org/SDL/issues/9067
2024-02-17 07:59:04 -08:00
SDL Wiki Bot
317099b01f
Sync SDL3 wiki -> header
2024-02-17 03:51:21 +00:00
Sam Lantinga
cb38649490
Added SDL_PROP_DISPLAY_HDR_WHITE_LEVEL_FLOAT
2024-02-16 19:50:41 -08:00
SDL Wiki Bot
4d4c24acdd
Sync SDL3 wiki -> header
2024-02-13 17:07:23 +00:00
Ryan C. Gordon
bc984f78bf
android: Remove blocking permission request code. Async only in SDL3!
...
(this actually still blocks at our internal points of usage, though, for
replacement at a later time.)
2024-02-13 12:06:51 -05:00
Ryan C. Gordon
af61cfd5e0
android: Added SDL_AndroidRequestPermissionAsync.
2024-02-13 12:06:51 -05:00
Sam Lantinga
ead3cbafd7
Fixed documentation for SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4 (thanks @AntTheAlchemist!)
2024-02-12 18:32:29 -08:00
Sam Lantinga
87c07a79c0
Changed property name from '-' to '_'
2024-02-12 09:55:40 -08:00
SDL Wiki Bot
59f1e66adc
Sync SDL3 wiki -> header
2024-02-12 17:55:23 +00:00
Sam Lantinga
dca2721b91
Removed SDL_HINT_VIDEO_EXTERNAL_CONTEXT
...
This is replaced with SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT in SDL_CreateWindowWithProperties()
2024-02-12 09:54:33 -08:00
Sam Lantinga
2f7c24e4be
Removed SDL_HINT_RENDER_SCALE_QUALITY
...
Textures now default to linear filtering, use SDL_SetTextureScaleMode(texture, SDL_SCALEMODE_NEAREST) if you want nearest pixel mode instead.
2024-02-12 09:54:33 -08:00
Sam Lantinga
20051f805f
Removed SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4
...
Replaced with SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4, defaulting to SDL_TRUE
2024-02-12 09:54:33 -08:00
Sam Lantinga
7cb1ca60ec
Removed SDL_HINT_RENDER_OPENGL_SHADERS
...
Shaders are always used if they are available.
2024-02-12 09:54:33 -08:00
Sam Lantinga
9920e062d5
Removed SDL_HINT_THREAD_STACK_SIZE
...
The stack size can be specified using SDL_CreateThreadWithStackSize()
2024-02-12 09:54:33 -08:00
Sam Lantinga
9e505252c0
Renamed SDL_HINT_PS2_DYNAMIC_VSYNC SDL_HINT_RENDER_PS2_DYNAMIC_VSYNC
2024-02-12 09:54:33 -08:00
Sam Lantinga
a538936821
Renamed SDL_HINT_LINUX_JOYSTICK_DEADZONES to SDL_HINT_JOYSTICK_LINUX_DEADZONES
2024-02-12 09:54:33 -08:00
Sam Lantinga
980c379a0b
Renamed SDL_HINT_LINUX_JOYSTICK_CLASSIC to SDL_HINT_JOYSTICK_LINUX_CLASSIC
2024-02-12 09:54:33 -08:00
Sam Lantinga
1f7936d545
Renamed SDL_HINT_LINUX_HAT_DEADZONES to SDL_HINT_JOYSTICK_LINUX_HAT_DEADZONES
2024-02-12 09:54:33 -08:00
Sam Lantinga
39cfb437ed
Renamed SDL_HINT_LINUX_DIGITAL_HATS to SDL_HINT_JOYSTICK_LINUX_DIGITAL_HATS
2024-02-12 09:54:33 -08:00
Sam Lantinga
b557c15bcf
Renamed SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE to SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE_RUMBLE_BRAKE
2024-02-12 09:54:33 -08:00
Sam Lantinga
4f628b5b62
Renamed SDL_HINT_GDK_TEXTINPUT_DEFAULT to SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT
2024-02-12 09:54:33 -08:00
Sam Lantinga
fd5d761128
Renamed SDL_HINT_DIRECTINPUT_ENABLED to SDL_HINT_JOYSTICK_DIRECTINPUT
2024-02-12 09:54:33 -08:00
Sam Lantinga
a5da7d0dd5
Renamed SDL_HINT_ALLOW_TOPMOST to SDL_HINT_WINDOW_ALLOW_TOPMOST
2024-02-12 09:54:33 -08:00
Sam Lantinga
ef8791cba8
Cleaned up and organized hint documentation
2024-02-12 09:54:33 -08:00
Sam Lantinga
9ce7fe2848
Removed SDL_HINT_ACCELEROMETER_AS_JOYSTICK
...
Sensors are a first-class object in SDL and we haven't gotten any feedback that this feature is useful these days.
Closes https://github.com/libsdl-org/SDL/pull/7879
2024-02-12 09:54:33 -08:00
Zack Middleton
5af7113842
Rename property define names to have a type suffix
...
Renamed the following property define names to have a type suffix to
match other property names.
SDL_PROP_TEXTURE_OPENGL_TEXTURE_TARGET (number)
SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_TARGET (number)
SDL_PROP_WINDOW_CREATE_WAYLAND_SCALE_TO_DISPLAY (boolean)
SDL_PROP_WINDOW_RENDERER (pointer)
SDL_PROP_WINDOW_TEXTUREDATA (pointer)
2024-02-12 09:54:11 -08:00
Sam Lantinga
cacac6cc34
Updated structure and field names for consistency
...
Type names are camel case and field names are snake case except for fields ending in id, which are capitalized.
Fixes https://github.com/libsdl-org/SDL/issues/6955
2024-02-11 08:27:56 -08:00
Sam Lantinga
6f87973b9c
Added a reserved field to the SDL_Event structure
...
This guarantees 64-bit alignment for the timestamp
2024-02-11 08:27:56 -08:00
SDL Wiki Bot
432ce3f167
Sync SDL3 wiki -> header
2024-02-10 15:09:26 +00:00
Sam Lantinga
416803b03b
Clarify the lifetime of the shape surface in SDL_SetWindowShape()
2024-02-10 07:08:28 -08:00