It'll usually replace it with `{ "SDL_app", NULL }`, but things like Win32
can query the OS for the original command line arguments.
This allows apps/scripting languages that provide their own entry points to
use SDL_RunApp and not have to worry about how to compose an argv array on
things like Windows, when SDL was going to do it for them anyhow.
Most things won't experience any change with this commit, including apps that
that want extra control but originate in a standard main()-style entry point
and can just pass the existing argc/argv through to SDL_RunApp.
Windows isn't addressed here, since a previous commit already updated it.
GDK has a different fix here, but we'll unify that in a later commit.
Closes#12676.
This, strictly speaking, doesn't _need_ to be public domain any more, since
SDL3 no longer inserts this code into apps via a static SDL_main library; it's
just part of the normal zlib-licensed SDL library and called into through a
well-defined entry point at startup, now.
But removing a public domain notice isn't the done thing, so we'll leave it in.
(To a related point: even if others have rewritten good portions of this code,
they're doing it under the assumption that this specific file has a public
domain license.)
This new implementation only parses the command line into an argv when
the provided argv is NULL. This lets programs that don't want to/can't
include `SDL_main.h` to do their own custom argument processing before
explicitly calling `SDL_RunApp()` without having SDL clobber the argv.
If the user includes `SDL_main.h` as normal, the behavior remains the
same as before (because `SDL_main_impl.h` passes a NULL argv).
In addition, this new implementation performs fewer allocations and no
longer leaks on failure.
Instead of only using it for the side effect of making MsgWaitForMultipleObjects block on the next call.
This has the added benefit of avoiding an extra MsgWaitForMultipleObjects call if there was actually new raw input in the queue already.
Same deal as the current Windows code: this "fixes" proximity but limits you
to a single pen device. But this is probably okay for most reasonable use
cases.
Now everything will attempt to track pens through proximity changes (instead
of removing the pen entirely). testpen.c has been updated to reflect this.
Some platforms and devices are better at this than others, but this seems like
a significant usability improvement across the board.
Fixes#12992.
This reverts commit 964bedfdd9.
The vendorName is more expressive and lets the user distinguish between different controllers of the same type, e.g. "PlayStation VR2 Sense Controller (R)" and "PlayStation VR2 Sense Controller (L)" vs "Spatial Controller"
If the product category is necessary, we can add a property to store that as additional information on the controller.
Normally the gamepad is used for navigation on visionOS, but when the controller subsystem is enabled we want to receive gamepad input as gamepad events instead.
An active cursor being destroyed may still have a frame callback referencing the thread queue, so clean it up before destroying the thread queue to ensure that no references to the queue remain when it is destroyed.
This PR adds support to the cmake build scripts so to allow building SDL with the Tiny C Compiler (tcc).
TinyCC supports the subset of C99 used by SDL and will complete the build once the --version-script linker flag is removed. The changes have been tested with various build configurations, including X11 and Wayland, and using tcc version 0.9.28rc 2025-10-27 mob@f4e01bfc on x86_64 Linux.