Wednesday, December 11, 2013

Use ogre problem on iphone

Ogre in the initialise, creates a window and a view, orientation settings when creating his window, the interface becomes landscape right.
I use the following code into an ogre view created its own view controller inside.

Then the interface will automatically become portrait, and why is it so? How to let it interface remains unchanged landscape right?


- (Void) initWithOgre
{
root = new Ogre :: Root;

/ / Load openGL ES render system plugin
glesPlugin = new Ogre :: GLESPlugin;
root-> installPlugin (glesPlugin);
root-> initialise (true);

UIWindow * ogreWindow;
root-> getAutoCreatedWindow () -> getCustomAttribute ("WINDOW", & ogreWindow);

UIView * ogreView;
root-> getAutoCreatedWindow () -> getCustomAttribute ("VIEW", & ogreView);

ViewController * rootViewController = [[ViewController alloc] init];
[OgreView removeFromSuperview];
[RootViewController.view addSubview: ogreView];
self.window = ogreWindow;
self.window.rootViewController = rootViewController;
}

No comments:

Post a Comment