DNESS / cocos2d-iphone

Automatically exported from code.google.com/p/cocos2d-iphone
1 stars 0 forks source link

EAGLView messed up on resize #1090

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start with the sample HelloWorld project from 0.99.5
2. Change GAME_AUTOROTATION to UIKit autorotation
3. In shouldAutorotateToInterfaceOrientation for the RootViewController, always 
return YES to support all platforms
4. Run the app on the device (it doesn't matter if you start landscape or 
portrait).  Turn the device 90 degrees.

What is the expected output? What do you see instead?
I expect the that the frame size will change (see 
willRotateToInterfaceOrientation for the RootViewController) and that the 
HelloWorld CCLabelTTF will be rotate properly.  Instead, the rendering is 
messed up.  See the attached photos for the starting view and the rotated view.

What cocos2d version are you using ?
0.99.5
git tip
(also happens on earlier version, but not sure if all of them)

What iOS / Mac SDK are you using ?
XCode 3.2.4 and iOS 4.1

Debug or Release ?
Both

Which target device / target OS are you using ?
2nd gen itouch

iOS only: Does this happens on device ? or on the simulator ? or on both ?
I can only see it on my 2nd gen itouch.  I had someone on IRC check their 
iphone 3GS and this problem doesn't occur, so it may be device specific.

Mac only: x86 or i386 ?

Please provide any additional information below.
I think the real problem lies in changing the cocos2d EAGLView frame.  The 
reason I say this is because if in the cocos2d HelloWorld sample I enable UIKit 
rotation, but comment out the change in frame size at the end of 
willRotateToInterfaceOrientation in the RootViewController, then the CCLabelTTF 
is rotated properly, but it is clear that the EAGLView is still the old size.

One interesting experiment I made was to go back and use one of the Apple 
developer documentation examples to see if it gives the same behavior.  My test 
was done with the PVRTextureLoader example.  I modified this example to use 
UIKit autorotation to rotate the EAGLView (I call this EAGLView the "reference 
EAGLView", as I noticed it is quite a bit different than the EAGLView in 
coco2d). When setting the frame size in willRotateToInterfaceOrientation for 
the UIViewController in the PVRTextureLoader example, things work as expected.

Original issue reported on code.google.com by jpswen...@gmail.com on 20 Jan 2011 at 1:47

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by ricardoq...@gmail.com on 24 Jan 2011 at 2:50

GoogleCodeExporter commented 9 years ago
You can probably close this.  It was still happening with iOS 4.1, but when I 
updated to iOS 4.2.1 the problem went away.  It does still happens for the 
latest cocos2d on iOS 4.1, however.

Original comment by jpswen...@gmail.com on 20 May 2011 at 7:29

GoogleCodeExporter commented 9 years ago
rescheduled for v1.1

Original comment by ricardoq...@gmail.com on 13 Jul 2011 at 9:44