Get screenresolution before configuring mainwindow in AppDelegate

Hello,

I would like to make a resolution independent game and want to set the mainwindow to the size of the screen. Is there a way to get the screen resolution before configuring the mainwindow in the AppDelegate? The code below doesn’t work and returns 0 for width and height.

Is there a good or better way to do something like this?

`CCEGLView * pMainWnd = new CCEGLView();

int w = CCDirector::sharedDirector()->getDisplaySizeInPixels().width;
int h = CCDirector::sharedDirector()->getDisplaySizeInPixels().height;
CCLog(“width %i”,w); // returns 0

CC_BREAK_IF(! pMainWnd|| ! pMainWnd->Create(w, h));`