Hi everyone, I’m making a mobile game with SDL2 to put initially on IOS.
Now, to integrate it with Firebase and other tools, I need a pointer to UIViewController.
After reading countless topics, I tried this:
SDL_VERSION (& systemWindowInfo.version);
SDL_GetWindowWMInfo (sdlWindow, & systemWindowInfo))
UIWindow * appWindow = mainWindowWMInfo.info.uikit.window;
UIViewController * rootViewController = appWindow.rootViewController;
But the line “UIViewController * rootViewController = appWindow.rootViewController;” causes this error: “Incomplete definition of type ‘_UIWindow’”
All topics related to this sample code are at least four years old, and I’m trying hard, but I haven’t found any topics talking recently about how to get UIViewController in an SDL2 / ios project.
So, my questions are:
- Is the sample code above still working in the current versions of SDL2 or has something changed in the latest version and this sample code no longer works?
- If the sample code still works, what am I doing wrong to cause this “Incomplete definition of type ‘_UIWindow’” error?
- If this sample code no longer works in SDL2, how can I get a UIViewController pointer in the current version of SDL2?
Any help is welcome because I have been stuck in this problem for days. I’ve been working on this game for ten months and solving this problem is the last task to complete it, so I really need to solve this issue.