IOS Content Scale problem

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
sabotage3d
Gnoblar
Posts: 15
Joined: Sun Jul 20, 2014 10:01 pm

IOS Content Scale problem

Post by sabotage3d »

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

Image

this is the correct scale without using externalViewHandle

Image

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,  &params);
LOG: iOS: Window created 320 x 568 with backing store size 320 x 568 using content scaling factor 0.5

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,  &params);
LOG: iOS: Window created 320 x 568 with backing store size 640 x 1136 using content scaling factor 2.0
pptech
Kobold
Posts: 37
Joined: Mon May 09, 2011 6:14 pm
x 1

Re: IOS Content Scale problem

Post by pptech »

For me I had to use an entry in my ogre.cfg file to get this to work...

Code: Select all

Content Scaling Factor=1