As we all know that, using SDL_UIKitAppDelegate is the only official way to boot SDL on iOS.
However, I have an app based on SwiftUI which doesn’t allow me to do that.
Is there any way to boot it normally?
Now I using such functions, and the sound of game works well.
However there are no SDL_window, and only a black screen present.
Function:
SDL_ClearError()
SDL_AddHintCallback(SDL_HINT_IDLE_TIMER_DISABLED,SDL_IdleTimerDisabledChanged, nil);
SDL_SetMainReady()
SDL_Init(SDL_INIT_VIDEO.magnitude)
FileManager.default.changeCurrentDirectoryPath(tmpURL)
SDL_iPhoneSetEventPump(SDL_TRUE)
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
UIApplication.shared.delegate?.applicationDidBecomeActive?(UIApplication.shared)
}
let existStatus = launcher_main(customArgc, customArgv)
SDL_iPhoneSetEventPump(SDL_FALSE)
return existStatus
There also an error in Xcode log, however I couldn’t understand it.
AddInstanceForFactory: No factory registered for id <CFUUID 0x600000280d20> F8BB1C28-****-11D6-****-00039315CD46