[ios] window dimensions incorrect after orientation change

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
yvesa
Gnoblar
Posts: 10
Joined: Tue Oct 15, 2013 5:18 pm

[ios] window dimensions incorrect after orientation change

Post 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.

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: [ios] window dimensions incorrect after orientation chan

Post by masterfalcon »

What version of Ogre?

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

yvesa
Gnoblar
Posts: 10
Joined: Tue Oct 15, 2013 5:18 pm

Re: [ios] window dimensions incorrect after orientation chan

Post 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 .

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: [ios] window dimensions incorrect after orientation chan

Post by masterfalcon »

masterfalcon wrote:How can we reproduce the issue?

yvesa
Gnoblar
Posts: 10
Joined: Tue Oct 15, 2013 5:18 pm

Re: [ios] window dimensions incorrect after orientation chan

Post by yvesa »

In my case, it's calling Ogre::RenderWindow::windowMovedOrResized after the orientation has changed.

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: [ios] window dimensions incorrect after orientation chan

Post by masterfalcon »

Are you calling windowMovedOrResized after the orientation changes?

Give me exact steps to reproduce.

yvesa
Gnoblar
Posts: 10
Joined: Tue Oct 15, 2013 5:18 pm

Re: [ios] window dimensions incorrect after orientation chan

Post 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

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: [ios] window dimensions incorrect after orientation chan

Post by masterfalcon »

Have you tried just removing that? The EAGLViewController already takes care of reconfiguring the window on orientation changes.

Post Reply