Commit graph

418 commits

Author SHA1 Message Date
Petar Popovic
3baec8aab4 Renaming SDLK_QUOTEDBL to SDLK_DBLAPOSTROPHE 2024-05-14 08:46:38 -07:00
Petar Popovic
94cbaaabbf Renaming SDLK_QUOTE and SDLK_BACKQUOTE
Renaming SDLK_QUOTE to SDLK_APOSTROPHE.
Renaming SDLK_BACKQUOTE to SDLK_GRAVE.
This makes them similar to their scancode names.
2024-05-13 11:11:11 -07:00
Sam Lantinga
bcbf09acde Renamed SDL_AttachVirtualJoystickEx() to SDL_AttachVirtualJoystick()
The shorthand version of this function didn't allow specifying a controller name, which seems pretty important. It seems like anyone actually implementing a virtual joystick is going to want to use some of the extended functionality.
2024-05-09 14:05:58 -07:00
Ryan C. Gordon
1d2b00efe1
wikiheaders: A few fixes that the SDL2 branch exposed. 2024-05-07 14:23:19 -04:00
Ryan C. Gordon
353001e077
wikiheaders: Fixed LaTeX chapter list and symbol sorting. 2024-05-05 02:44:45 -04:00
Ryan C. Gordon
b181e7b1ca
wikiheaders: LaTeX output support.
Reference Issue #9440.
2024-05-05 02:03:44 -04:00
Ryan C. Gordon
0768e0e431
wikiheaders: Fixed See Also section in --copy-to-headers.
This broke when the list bullet markdown was fixed, and then the fixed wiki
data was copied back to the headers.
2024-05-05 01:53:37 -04:00
Ryan C. Gordon
a16b76cf80
wikiheaders: Markdown should use '-' for unordered lists, not '*'. 2024-05-05 01:22:45 -04:00
Anonymous Maarten
8f4cab0f83 ci: fix dmg release artifacts
- build-release.py: use absolute paths instead of resolved paths
- xcode: run the shell script with 'set -ex' for extra verbosity +
  failing when an error happens
- On macOS ci, /tmp resolves to /private/tmp, causing the shell script
  to not find the SDL3.xcframework. So don't  use /tmp.
2024-05-05 01:30:07 +02:00
Ryan C. Gordon
77f4ffcc79
wikiheaders: Don't list SDL property #defines below functions.
They will still generate "please refer to" pages, though.
2024-05-03 13:19:27 -04:00
Ryan C. Gordon
92bd7d99dd
wikiheaders: Deal with multiline typedefs.
This happens more than once with function pointer typedefs.

Reference Issue #9440.
2024-05-03 13:01:20 -04:00
Ryan C. Gordon
3348d0caaf
wikiheaders: Deal with SDLMAIN_DECLSPEC functions. 2024-05-03 09:31:27 -04:00
Ryan C. Gordon
9f842e9b5a
wikiheaders: Bind #defines below a function to it, like typedefs.
This effectively adds the property symbols for various functions to the
function's wiki page.
2024-05-02 12:49:30 -04:00
Ryan C. Gordon
eb2c9e9235
wikiheaders: added --report-coverage-gaps to see what we aren't covering! 2024-05-01 19:58:21 -04:00
Sam Lantinga
e52a2474f1 Fixed updating CMakeLists.txt with update-version.sh 2024-05-01 09:33:30 -07:00
Ryan C. Gordon
12b6c17575
wikiheaders: Generate wiki pages for defines under a typedef.
These are just there to handle cases where a user stumbles upon a symbol
and punches it into the wiki, so they don't get a 404 for it, but rather
a pointer to where that symbol is relevant.

These pages are generated in the wiki if they don't exist, and are never
overwritten, in case text has been added to them. They are also not bridged
back to the headers or added to the set of manpages.
2024-04-30 22:47:02 -04:00
Ryan C. Gordon
5481ea4cd4
wikiheaders: manpages See Also sections should specify 3 vs 3type. 2024-04-30 21:46:56 -04:00
Ryan C. Gordon
9210c68c44
wikiheaders: Manpages go in man3 directory, even if they're 3type. 2024-04-30 21:46:56 -04:00
Petar Popovic
7bfecacc02 Removing function macro SDL_TABLESIZE() 2024-04-29 13:52:48 -07:00
Ryan C. Gordon
2ee1c87eb0
wikiheaders: Fixed preprocessor line check to include #endif.
Reference Issue #9557.
2024-04-25 16:46:43 -04:00
Ryan C. Gordon
6b1a98e664
wikiheaders: Allow basic typedefs to pull in some preprocessor logic.
Reference Issue #9557.

This lets SDL_AudioFormat have the `#if byteorder == lilendian` section.
2024-04-25 16:44:09 -04:00
Ryan C. Gordon
d29b861a76
wikiheaders: Allow blank lines in post-typedef #define blocks.
Reference Issue #9557.
2024-04-25 14:26:49 -04:00
Ryan C. Gordon
2fb024ab8e
wikiheaders: Defines directly following a non-struct typedef are documented.
The idea is that if you have a `typedef Uint32 MyFlags` that has a bunch of
defines that are meant to be bitflags, you can pack them into the same wiki
page automatically.

This only works with `typedef`s that are _not_ struct/union/enums, and it
only pulls in `#define` lines that immediately follow the typedef line.
Even a blank line or a comment will signal to stop including lines for
this page!
2024-04-25 03:02:27 -04:00
Ryan C. Gordon
093160904d
SDL_Keymod: Removed SDL_KMOD_RESERVED.
Fixes #9481.
2024-04-17 17:30:10 -04:00
Brick
8f6f9cadc4 Rewrote audio resampler using cubic filter interpolation
This allows using a much smaller (1.5 KB) lookup table, in exchange for a small amount of extra work per frame.

The extra work (a few extra loads/mul/adds) is negligible, and can execute in parallel.
The reduction in cache misses almost certainly outweighs any added cost.

The table is generated at runtime, and takes less than 0.02ms on my computer.
2024-04-15 11:47:18 -10:00
Petar Popovic
56e6f05440 SDL_RendererFlip rename fixes 2024-04-15 03:32:23 -10: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
Ryan C. Gordon
3c86af5901
wikiheaders: Add support for SDL_FORCE_INLINE functions. 2024-04-13 20:08:14 -04: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
98e9f361a8
winrt: Remove SDL_WinRTGetFSPathUNICODE, rename SDL_WinRTGetFSPathUTF8.
Fixes #9470.
2024-04-13 08:24:12 -04:00
Ryan C. Gordon
1e369b7f33
build-scripts/fnsince.pl: Remove SDL2-specific fixup. 2024-04-13 08:05:43 -04:00
Ryan C. Gordon
0df988389c
include: Add \since to all documentation that was missing it. 2024-04-11 13:34:29 -04:00
Ryan C. Gordon
db39de7f63
build-scripts/fnsince.pl: Updated to use Markdown instead of MediaWiki format. 2024-04-11 13:29:04 -04:00
Ryan C. Gordon
af6a4a9e38
wikiheaders: Fixed a silly logic bug. 2024-04-11 08:57:50 -04:00
Ryan C. Gordon
6ccdfffe26
wikiheaders: Fixes to manpage output for datatypes vs functions. 2024-04-11 01:03:07 -04:00
Ryan C. Gordon
5a58b3d97a
wikiheaders: Bridge basic typedefs to the wiki! 2024-04-11 00:37:11 -04:00
Petar Popovic
9b5944a14f Removing SDL_Colour macro 2024-04-09 12:25:36 -04:00
Ryan C. Gordon
645073961d
wikiheaders: Don't mangle Markdown tables in wordwrap. 2024-04-09 00:50:02 -04:00
Ryan C. Gordon
a25d49c162
wikiheaders: Bridge structs, unions, and enums to the wiki! 2024-04-09 00:50:02 -04:00
Ryan C. Gordon
125bbc5e61
wikiheaders: Fixed usage of die().
(if there's a newline in the output, it won't print the line in the Perl
script where the failure happened, so fix this in places where it's used
more like an assert than error reporting.)
2024-04-09 00:50:02 -04:00
Ryan C. Gordon
34f4484f48
wikiheaders: Renamed "Related Functions" section to "See Also"
It's not all functions now!
2024-04-09 00:50:01 -04:00
Ryan C. Gordon
dd2780f9fb
wikiheaders: Remove trailing whitespace from "brief" description. 2024-04-09 00:50:01 -04:00
Ryan C. Gordon
a26ec343c3
wikiheaders: Bridge macros to the wiki! 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
Ryan C. Gordon
e055a9fc2d
wikiheaders.pl: Report a function's header file name. 2024-03-31 12:56:00 -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
Sam Lantinga
96fbd10de0 Added a script to trigger the release workflow 2024-03-24 07:22:58 -07:00
Sam Lantinga
675c9f01ff Renamed releaser.py to build-release.py 2024-03-23 16:56:26 -07:00
Anonymous Maarten
e19b6c0b95 Add releaser script + workflow 2024-03-23 21:41:23 +01:00
Sam Lantinga
784311c20e Fixed duplicate SDL_Version change 2024-03-18 13:59:03 -07:00