Screenshots:
1) Initial portrait orientation is correc. Portrait upside down is also correct: 2) Rotate to landscape right: 3) Landscape left also wrong: So, my suggestion that viewport dimensions is incorrect.
OrientationChanged event delegate does the following code:
Code: Select all
-(void) receivedRotateEvent: (NSNotification*) notification
{
UIDeviceOrientation interfaceOrientation = [[UIDevice currentDevice] orientation];
if (interfaceOrientation != UIDeviceOrientationUnknown)
{
// mNSRenderingWindow is UIWindow* which represents Ogre rendering window.
// marshalUIOrientationToOgreOrientation translate UIDeviceOrientation enum to Ogre::OrientationMode enum.
mVisualizationContext.updateViewport
(
mUIRenderingWindow.bounds,
marshalUIOrientationToOgreOrientation(interfaceOrientation)
);
}
}
Code: Select all
void OgreVisualizationContext::updateViewport(int windowWidth, int windowHeight, Ogre::OrientationMode orientation)
{
mRenderWindow->resize(windowWidth, windowHeight);
}
Code: Select all
void OgreVisualizationContext::updateViewport(int windowWidth, int windowHeight, Ogre::OrientationMode orientation)
{
mRenderWindow->getViewport(0)->setOrientationMode(orientation, false);
}
Code: Select all
void OgreVisualizationContext::updateViewport(int windowWidth, int windowHeight, Ogre::OrientationMode orientation)
{
mRenderWindow->windowMovedOrResized();
}
Can you point me to correct viewport dimensions update snippet code?
PS: Working with Ogre 1.8.0 from SVN (r2457), iPhone 3GS iOS 4.1.
