CCEGLView *tempGL = CCEGLView::sharedOpenGLView();
auto realSize = tempGL->getFrameSize();
float scale = realSize.width/960.0;
if ((realSize.width==800&&realSize.height==480)||(realSize.width==1776&&realSize.height==1080)||(realSize.width==1184&&realSize.height==720)) {
//android主流分别率适配 W?H=1.66666
realSize.width = 1066.6667;
realSize.height =640;
}else if ((realSize.width==854&&realSize.height==480)||(realSize.width==960&&realSize.height==540)||(realSize.width==1920&&realSize.height==1080)||(realSize.width==1280&&realSize.height==720)) {
//android主流分别率适配 W/H=1.7777
realSize.width = 1136;
realSize.height =640;
}else if(realSize.width==1280&&realSize.height==800){
//android主流分别率适配 W?H=1.66666
realSize.width = 1024;
realSize.height =640;
}else if(realSize.width==1024&&realSize.height==768){
//iPad
realSize.width = 1024;
realSize.height =768;
}else if(realSize.width==1136&&realSize.height==640){
//iPhone5
realSize.width = 1136;
realSize.height =640;
}else if(realSize.width==960&&realSize.height==640){
//iPhone
realSize.width = 960;
realSize.height =640;
}else if(realSize.width==2048&&realSize.height==1536){
//iPad retina
realSize.width = 1024;
realSize.height =768;
}
else{
realSize.width /= scale;
realSize.height /=scale;
}
CCLOG("realSize %.2f - %.2f", realSize.width, realSize.height);
tempGL->setDesignResolutionSize(realSize.width, realSize.height, kResolutionShowAll);