Hi,
I'm trying to add a custom view to overlay the Orx's view . Interestingly, [none[none[UIApplication] sharedApplication] keyWindow] doesn't seem to retrieve the actual window if called from within the actual game loop. However, if called from within an Input event such as a touch, the call is successful.
I noticed that Orx stores the main window in the variable poWindow in the orxAppDelegate (orxiPhone.m). Is there an easy way to get at it?
Cheers,
Eugene
Comments
I suspect you can't access the keyWindow as orx runs in a separate thread? I don't see why not actually but that's the only remotely plausible reason I can see.
I wasn't expecting any Cocoa/iOS calls to not work so I didn't bake any easy access for the window itself.
Is the issue only with keyWindow or also with the application delegate itself?
If not, you can access it with:
and gets the window from it.
Let me know if you found a way to make it work.
Cheers!
That reminds me of similar issues I encountered when switching to iOS 4.2 and orx kept crashing. Turned out that what was a perfectly valid way of setting up the OGL contexts and the framebuffer on different threads wasn't working anymore.
I had to find some work around by modifying the initialization sequence for the contexts and by using two separate framebuffer for on-screen and off-screen rendering.
I sure hope that switching to iOS 5 won't bring the same kind of surprises.