[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 » Fri Jan 24, 2014 4:49 pm

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.
0 x

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

Re: [ios] window dimensions incorrect after orientation chan

Post by masterfalcon » Fri Jan 24, 2014 8:26 pm

What version of Ogre?

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

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

Re: [ios] window dimensions incorrect after orientation chan

Post by yvesa » Tue Jan 28, 2014 12:41 pm

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 .
0 x

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

Re: [ios] window dimensions incorrect after orientation chan

Post by masterfalcon » Wed Jan 29, 2014 2:32 am

masterfalcon wrote:How can we reproduce the issue?
0 x

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

Re: [ios] window dimensions incorrect after orientation chan

Post by yvesa » Wed Jan 29, 2014 12:12 pm

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

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

Re: [ios] window dimensions incorrect after orientation chan

Post by masterfalcon » Thu Jan 30, 2014 2:21 am

Are you calling windowMovedOrResized after the orientation changes?

Give me exact steps to reproduce.
0 x

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

Re: [ios] window dimensions incorrect after orientation chan

Post by yvesa » Thu Jan 30, 2014 5:03 pm

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
0 x

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

Re: [ios] window dimensions incorrect after orientation chan

Post by masterfalcon » Fri Jan 31, 2014 12:12 am

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

Post Reply