This new feature in SDL3 is great, if you're into the real nitty-gritty of how platforms work:
https://github.com/libsdl-org/SDL/pull/8247
And this started in a GitHub issue, where I literally said:
I do not have a solution--there might not be an acceptable solution
And there it sat, until, in casual conversation later in the thread, Sam said:
I wonder if this is an opportunity to beef up the SDL_main functionality. Maybe we provide a header-only library that allows you a few ways to start your main function or set dispatch callbacks, and existing applications can call into SDL functions the way they always have?
And it was like getting hit by lightning. Like, holy shit, it's not impossible, and in fact if you look at it from the right angle, it's actually pretty fucking easy!
This comment actually spawned two significant efforts: SDL_main is no
longer a static library you link to your app, but a "header-only"
library you #include if you need it; Daniel Gibson went
hard on that idea and built out something way better than what we have
in SDL2, and I took a run at the callback idea on top of that, which
landed in revision control tonight.
All this to say: Sam is good at his job in general, to be sure, but he's also good at the offhand comment that hits you like lightning and gets you moving in the right direction. Get yourself a Sam and keep him talking.