Page 1 of 1

[ios] window dimensions incorrect after orientation change

Posted: Fri Jan 24, 2014 4:49 pm
by yvesa
Hello,
is there a reason why method EAGL2Window::windowMovedOrResized in OgreEAGL2Window.mm uses [mView frame] instead of [mView bounds] to calculate dimensions?
When I change the orientation of the device to landscape, the frame still returns the portrait width and height.

Tested on IPad 4 device.

Re: [ios] window dimensions incorrect after orientation chan

Posted: Fri Jan 24, 2014 8:26 pm
by masterfalcon
What version of Ogre?

How can we reproduce the issue? It works as expected when using the sample browser for me.

Re: [ios] window dimensions incorrect after orientation chan

Posted: Tue Jan 28, 2014 12:41 pm
by yvesa
Ogre 1.9 taken from bitbucket on 11-Nov-2013.

I've just checked the current version of the file on bitbucket for 1.9 branch and the call to [mView frame] is still there. This seems to be a know issue with frames on iOS, e.g. http://stackoverflow.com/questions/2686 ... -in-iphone .

Re: [ios] window dimensions incorrect after orientation chan

Posted: Wed Jan 29, 2014 2:32 am
by masterfalcon
masterfalcon wrote:How can we reproduce the issue?

Re: [ios] window dimensions incorrect after orientation chan

Posted: Wed Jan 29, 2014 12:12 pm
by yvesa
In my case, it's calling Ogre::RenderWindow::windowMovedOrResized after the orientation has changed.

Re: [ios] window dimensions incorrect after orientation chan

Posted: Thu Jan 30, 2014 2:21 am
by masterfalcon
Are you calling windowMovedOrResized after the orientation changes?

Give me exact steps to reproduce.

Re: [ios] window dimensions incorrect after orientation chan

Posted: Thu Jan 30, 2014 5:03 pm
by yvesa
yes, sorry i should have clarified that

after everything is initialized, when I detect any window size change, I also call windowMovedOrResized manually in my code.

Perhaps I am missing something obvious here, but is the call of windowMovedOrResized in such situation illegal? I noticed that samplebrowser calls it only once when initializing so that's probably why the issue with the frame vs. bounds is not visible there.

Thanks

Re: [ios] window dimensions incorrect after orientation chan

Posted: Fri Jan 31, 2014 12:12 am
by masterfalcon
Have you tried just removing that? The EAGLViewController already takes care of reconfiguring the window on orientation changes.