Commit Graph

2479 Commits

Author SHA1 Message Date
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
Ryan C. Gordon a5c892d2c3 stdlib: Improve Unicode support and consistency in string comparison functions.
SDL_strcasecmp (even when calling into a C runtime) does not work with
Unicode chars, and depending on the user's locale, might not work with
even basic ASCII strings.

This implements the function from scratch, using "case-folding,"
which is a more robust method that deals with various languages. It
involves a hashtable of a few hundred codepoints that are "uppercase" and
how to map them to lowercase equivalents (possibly increasing the size of
the string in the process). The vast majority of human languages (and
Unicode) do not have letters with different cases, but still, this static
table takes about 10 kilobytes on a 64-bit machine.

Even this will fail in one known case: the Turkish 'i' folds differently
if you're writing in Turkish vs other languages. Generally this is seen as
unfortunate collateral damage in cases where you can't specify the language
in use.

In addition to case-folding the codepoints, the new functions also know how
to decode the various formats to turn them into codepoints in the first
place, instead of blindly stepping by one byte (or one wchar_t) per
character.

Also included is casefolding.txt from the Unicode Consortium and a perl
script to generate the hashtable from that text file, so we can trivially
update this if new languages are added in the future.

A simple test using the new function:

```c
 #include <SDL3/SDL.h>

 int main(void)
 {
     const char *a = "α ε η";
     const char *b = "Α Ε Η";
     SDL_Log("    strcasecmp(\"%s\", \"%s\") == %d\n", a, b, strcasecmp(a, b));
     SDL_Log("SDL_strcasecmp(\"%s\", \"%s\") == %d\n", a, b, SDL_strcasecmp(a, b));
     return 0;
 }
```

Produces:

```
INFO:     strcasecmp("α ε η", "Α Ε Η") == 32
INFO: SDL_strcasecmp("α ε η", "Α Ε Η") == 0
```

glibc strcasecmp() fails to compare a Greek lowercase string to its uppercase
equivalent, even with a UTF-8 locale, but SDL_strcasecmp() works.

Other SDL_stdinc.h functions are changed to be more consistent, which is to
say they now ignore any C runtime and often dictate that only English-based
low-ASCII works with them.

Fixes Issue #9313.
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
Daniel Ludwig 4562b41a4d VisualC-GDK: Add missing dialog sources, fix Xbox builds 2024-03-26 07:28:22 -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