Cocos Creator v2.0.1 版本在 C++ 层面如何获得设备屏幕的像素宽高尺寸？

rohitk
Wed, 27 Feb 2019 07:11:33 +0000

Hi
I am using cocos Creator version 2.1 and need to get openGL reference in AppController.mm file, while writing code
cocos2d::Director::getInstance()->getOpenGLView() , i am not able to find reference , please let me know how to get openGL reference.
I am able to find CCEAGLView reference as follows
glView = (CCEAGLView *)appController->_viewController.view;

How do we get glview as below code is not working for me while building native app using cocosCreator 2.1

auto director = cocos2d::Director::getInstance();
auto glview = director->getOpenGLView();//not working…

阅读整个主题