You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within main function, initialise everything and call SDL_SetiOSAnimationCallback to hand off the game loop to the display link initialised by SDL for correct frame pacing.
Return from the main function.
SDL seems to be aware of this kind of logic already:
Which in turn removes the LifecycleObserver and not listen to any notification regarding the state of the app (i.e. applicationWillResignActive/applicationDidBecomeActive), causing the app to not receive such events.
The text was updated successfully, but these errors were encountered:
I will have to begin by asking why iOS event pumps are disabled after the main function in the first place, and/or why the lifecycle observer is using that as a condition on whether to run.
This is all as well as why the lifecycle observer apparently has a fallback condition wherein if the app was running using SDL's main callbacks then the lifecycle observer is attached regardless of iOS's event pump state.
After further consideration, given our specific use case of SDL on iOS here, I think it may be a better option for us to roll out our own application delegate class and use SDL_SetMainReady instead (albeit we will have to copy certain handlings). This can be closed if it's on the verge of being by-design.
I'm sort of assuming this is a bug in SDL, but I don't know the details of this code at all.
I assume this code path is trying to make it so SDL_PumpEvents does nothing because it would run the CFRunLoop, but setting an animation callback means we basically live in a runloop and don't have to (or shouldn't) manually run it...but I don't know why we turn off the observer.
Also: the iOS-specific main callbacks codepath literally calls SDL_PumpEvents, so it must be safe to do so even with an animation callback...?
Our application generally powers up as follows:
SDL_RunApp
with a main functionSDL_SetiOSAnimationCallback
to hand off the game loop to the display link initialised by SDL for correct frame pacing.SDL seems to be aware of this kind of logic already:
SDL/src/video/uikit/SDL_uikitappdelegate.m
Lines 416 to 419 in 7c5c88a
But going a few lines back, it's doing this right after coming back from our main function:
SDL/src/video/uikit/SDL_uikitappdelegate.m
Line 409 in 7c5c88a
Which in turn removes the
LifecycleObserver
and not listen to any notification regarding the state of the app (i.e.applicationWillResignActive
/applicationDidBecomeActive
), causing the app to not receive such events.The text was updated successfully, but these errors were encountered: