setContentScaleFactor isn't work!

setContentScaleFactor isn’t work!
engine version is cocos2d-x-2.2.2

bool AppDelegate::applicationDidFinishLaunching() {
    CCDirector* pDirector = CCDirector::sharedDirector();
    CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
    pDirector->setOpenGLView(pEGLView);
    pDirector->setDisplayStats(true);
    pDirector->setAnimationInterval(1.0 / 60);
    CCScene *pScene = GameScene::scene();
    
    pDirector->setContentScaleFactor(640.0f / pDirector->getWinSize().height);
    
    pDirector->runWithScene(pScene);
    
    return true;
}

“pDirector->setContentScaleFactor(640.0f / pDirector->getWinSize().height)” is not not work in my Project.

I do not understand the reason at all.
Any thoughts?

@xaver

You should also call the following method

 glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);

along with the setContentScaleFactor method.

@0owen
project work completely!!
Thank you!!!