RootViewController.mm in lua-template-default and cpp-template-default is different

in this file: https://github.com/cocos2d/cocos2d-x/blob/develop/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];

CGSize s = CGSizeMake([[CCEAGLView sharedEGLView] getWidth], [[CCEAGLView sharedEGLView] getHeight]);

cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height);
}

[CCEAGLView sharedEGLView] nolonger in use,right?

in https://github.com/cocos2d/cocos2d-x/blob/develop/templates/cpp-template-default/proj.ios_mac/ios/RootViewController.mm

cocos2d::GLView *glview = cocos2d::Director::getInstance()->getOpenGLView();
CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView();

can I replace by this?

yes

@chuanwei.zhang
Thanks.
But I think I should check the glview is NULL too.
In iOS 5.x, the iPhone call this function before glview is created.

You can add assert function to ensure create glview is right.

@chuanwei.zhang
yes, and thanks.

You can add assert function to ensure create glview is right.