This lets applications choose which scene their windows are being created in. For example one window might be video output in a scene with a session role of UIWindowSceneSessionRoleExternalDisplayNonInteractive, and video controls in a scene with a session role of UIWindowSceneSessionRoleApplication.
Now other projects can use it with their headers, if they provide an options
file with specifics and are willing to follow some SDLish header conventions.
This shouldn't affect SDL satellite projects, etc, since they literally use
the SDL symbols, like `SDLCALL` and such, which are the defaults in the script
if a .wikiheaders-options file doesn't override them.
Grabbing the mouse interrupts touch events in progress, so if someone
enables relative mode while a button is pressed, wait for the button to
be released before grabbing the mouse.
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.
This still had a bunch of text that wasn't updated for SDL3's ability to deal
with pre-user-interaction pages. Same idea, but changed text that suggested
you have to wait to open the audio device.
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.