I am using Cocos2d-iPhone 2 and I have a CCNode derived class that I am using to clip child nodes using glScissor. In researching my solution I came across a lot of code and comments indicating that the coordinates passed into glScissor needed to be transformed if the iOS device is in any orientation other than portrait since glScissor used raw device coordinates.
However after many hours trying to get something working I found that if I did no transformation regardless of orientation everything worked as expected.
Does anyone know if this API has been changed in the newer versions of iOS? I am a little wary of writing a significant amount of code relying on what I am observing without knowing why I am seeing behavior so much different that what everyone else seems to see.
My development has been targeting iOS 5.1 which as far as I can tell is only supported on 3GS+ and iPads. All of the glScissor internet comments that refer to behavior that conflicts with what I am observing tend to be dated from around early 2011 or earlier and predate iOS 5.x
I was using cocos2d 1.x for my landscape orientated app. I found that
glScissors()was treating its params x, y, width and height as if the device orientation was portrait. I had to swap around the parameters (x with y, width with height) to get the screen correctly clipped in landscape mode.Now I’ve upgraded to cocos2d 2.x I no longer have to do the above as landscape orientation is respected by
glSccissors().