IOS Content Scale problem
Posted: Fri Sep 19, 2014 1:18 am
Hello ,
I am having some problems when passing externalViewHandle to Ogre's window system under IOS 7.1 . When I use Retina display with externalViewHandle I am getting wrong content scale.
Any ideas ?
Incorrect scale using externalViewHandle

this is the correct scale without using externalViewHandle

Iphone Retina: 640 x 1136
LOG: iOS: Window created 320 x 568 with backing store size 320 x 568 using content scaling factor 0.5
LOG: iOS: Window created 320 x 568 with backing store size 640 x 1136 using content scaling factor 2.0
I am having some problems when passing externalViewHandle to Ogre's window system under IOS 7.1 . When I use Retina display with externalViewHandle I am getting wrong content scale.
Any ideas ?
Incorrect scale using externalViewHandle

this is the correct scale without using externalViewHandle

Iphone Retina: 640 x 1136
Code: Select all
int width = 640;
int height = 1136;
UIView* uiView = [[UIView alloc] initWithFrame:CGRectMake(0,0,width,height)];
params["contentScalingFactor"] = "0.5";
params["externalWindowHandle"] = Ogre::StringConverter::toString((unsigned long)uiWindow);
params["externalViewHandle"] = Ogre::StringConverter::toString((unsigned long)uiView);
m_pRenderWnd = m_pRoot->initialise(false);
m_pRenderWnd = m_pRoot->createRenderWindow("", width, height, false, ¶ms);
Code: Select all
int width = 640/2;
int height = 1136/2;
params["contentScalingFactor"] = "0.5";
params["externalWindowHandle"] = Ogre::StringConverter::toString((unsigned long)uiWindow);
m_pRenderWnd = m_pRoot->initialise(false);
m_pRenderWnd = m_pRoot->createRenderWindow("", width, height, false, ¶ms);