[Solved] View problem iOS 4.3

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
User avatar
Brocan
Orc
Posts: 441
Joined: Tue Aug 01, 2006 1:43 am
Location: Spain!!
x 8

[Solved] View problem iOS 4.3

Post by Brocan »

Hi everyone!

I'm trying to put the ogre view in my own view tree. But i've a problem.

To avoid ogre of creating a new uiwindow, i pass the current uiwindow when creating the render window:

Code: Select all

Ogre::String windowHandle = Ogre::StringConverter::toString((size_t)(currentWindow));
Ogre::NameValuePairList viewConfig;
viewConfig["externalWindowHandle"] = windowHandle;
m_pOgreRenderWnd = m_pOgreRoot->createRenderWindow("OgreiOSRenderWindow", windowWidth, windowHeight, false, &viewConfig);
To test my code, first of all i'm trying to detach the ogre view in order to not see it. So, when the RW is created, the ogre view it's automatically attached to the window handle (isn't it?), so i call this code to detach:

Code: Select all

m_pOgreSystemViewController = [(UIViewController*)m_pOgreSystem->getOgreViewController() retain];
[m_pOgreSystemViewController.view removeFromSuperview]; //ogre auto attach the view in the provided window, detach from it
The problem is that when the render starts, the ogre render view appears and i don't know why because i've told for detaching from subviews...

Any idea?

Thanks in advance!

PD: Using iOS 4.3 SDK, XCode 3.2.6, Ogre trunk 1.8 (last checkout around 5 days ago), OpenGLES 2.0
User avatar
Brocan
Orc
Posts: 441
Joined: Tue Aug 01, 2006 1:43 am
Location: Spain!!
x 8

Re: [Solved] View problem iOS 4.3

Post by Brocan »

Solved, i need to set that the rootViewController of my window is my class, not the view controller that ogre creates.

Code: Select all

m_pOgreSystemViewController.view removeFromSuperview];
window.rootViewController = self;