Skip to content

Commit

Permalink
closed cocos2d#4607: Fixed project created by template crashes on iOS…
Browse files Browse the repository at this point in the history
…5.1 device.
  • Loading branch information
James Chen committed Apr 15, 2014
1 parent 44d0c98 commit 2fbf94c
Showing 1 changed file with 11 additions and 5 deletions.
Expand Up @@ -70,14 +70,20 @@ - (BOOL) shouldAutorotate {
}

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

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

CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]);
if (glview)
{
CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView();

cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height);
if (eaglview)
{
CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]);
cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height);
}
}
}

//fix not hide status on ios7
Expand Down

0 comments on commit 2fbf94c

Please sign in to comment.