I haven’t been able to figure out what SDL does on macOS if you don’t instantiate SDLApplication
(a subclass of NSApplication
), which I don’t. Grepping through the code I haven’t been able to find calls to dispatchMain()
or an obvious NSRunLoop
setup (there are run loops in some HID and audio code, and calls to get the global dispatch queue, but nothing obvious).
The event handling for Cocoa (which I’m not at all sure is what’s at play in a macOS build) calls [NSApp nextEventMatchingMask:…]
, and [NSApp sendEvent:]
, but since I'm not instantiating NSApplication
, I don't think that’s involved. Not at all sure, though.
I’ve thought of a way to just call dispatchMain()
in Linux-only portions of my code, looping on SDL_WaitEvent()
on a separate queue and dispatching those back to the main queue. I haven’t tried it yet, but I think it’ll work.