Commit Graph

393 Commits (aab7caebf0d8f6a35614785c5a9d4aaf851b4b23)

Author SHA1 Message Date
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
Sam Lantinga d65ae710a1 Renamed SDL_LogGetOutputFunction() and SDL_LogSetOutputFunction() to match SDL 3.0 naming convention 2024-03-17 12:28:11 -07: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 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
Sam Lantinga b322d27f62 Missed SDL_NumJoystickBalls() rename in SDL_migration.cocci 2024-03-10 21:31:19 -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
Anonymous Maarten b5eb704fa8 cmake: we only need a C++ compiler for Android, Haiku and UWP
Our CMake script does (currently) not support NGage, Xbox One, or Xbox Series.
2024-03-11 00:27:54 +01:00
Sam Lantinga c36f773eb4 Fixed "${folder^}Activity: bad substitution" with bash 3.2 on macOS 2024-03-05 13:35:17 -08:00
Anonymous Maarten 4898505f23 cmake: add winres to the list of potential name rc compilers 2024-03-05 20:38:00 +01:00
Sam Lantinga 4189edaeb7 Uppercase the first letter of the class name to match Java conventions
Fixes https://github.com/libsdl-org/SDL/issues/8930
2024-03-03 16:57:02 -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 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 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 f95b7ee4da Renamed SDL_HasWindowSurface to SDL_WindowHasSurface
Fixes https://github.com/libsdl-org/SDL/issues/9034
2024-02-09 17:42:18 -08:00
Xander a3bfd5329c Fix broken mingw i686 buildscript 2024-01-28 17:29:33 -08:00
Xander 59d7dd3615 Fix broken mingw x86_64 buildscript 2024-01-28 17:29:33 -08:00