Sunday, 22 April 2012

Force Landscape framebuffer in OpenGL ES 1.1

I've fixed an orientation bug I had related to the first frame buffer created having incorrect dimensions - as if the app were launched in portrait mode.

Before in my plist:

UISupportedInterfaceOrientations

UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight


Changed to:

UISupportedInterfaceOrientations

UIInterfaceOrientationLandscapeRight
UIInterfaceOrientationLandscapeLeft


In both situations the correct landscape orientation comes through the root view controller but only with the latter array order does it make the initial framebuffer with the correct dimensions!

Please note, the frame buffer is created twice on launch still. The very first time is always portrait dimensions but the second is now landscape (960x640 on iPhone 4). This was not happening until I changed the order of the supported orientation array above.

This bug was in OpenGL ES 1.1 using the now deprecated EAGLView.

No comments:

Post a Comment