1
0
forked from MeloNX/MeloNX

Make SDL Init on the Main Thread

This commit is contained in:
stossy11 2024-11-02 11:42:28 +11:00
parent f632f16449
commit 60cfb86774
2 changed files with 12 additions and 10 deletions

View File

@ -21,6 +21,7 @@ struct ContentView: View {
@State var debugmode: Int = 0 @State var debugmode: Int = 0
init() { init() {
DispatchQueue.main.async {
SDL_SetMainReady() SDL_SetMainReady()
SDL_iPhoneSetEventPump(SDL_TRUE) SDL_iPhoneSetEventPump(SDL_TRUE)
@ -33,6 +34,7 @@ struct ContentView: View {
fatalError("Failed to load Vulkan library: \(String(cString: SDL_GetError()))") fatalError("Failed to load Vulkan library: \(String(cString: SDL_GetError()))")
} }
} }
}
var body: some View { var body: some View {