I started with a GLSprite
sample app (source code), then added a UIViewController
by adding
UIViewController *vc = [[UIViewController alloc] init];
vc.view = glView;
self.window.rootViewController = vc;
[window makeKeyAndVisible];
to the end of GLSpriteAppDelegate::applicationDidFinishLaunching.
The controller seems to be working as now I can pop up gamecenter windows, but it has messed up my screen orientation
. The app is fine in portrait
, but in all other rotations
it incorrectly has white bars on the side, like one of the views is rotated 90 degrees.
I was doing [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
in EAGLView::initWithCoder
, I then tried moving it to the end of applicationDidFinishLaunching
but it had the same behavior.
Can anyone help? What can I do to fix or debug this? Thank you!
The issue was the new UIViewController was rotating, when my game expects an always portrait screen. To fix I created a custom viewcontroller and implemented