I’m developing an iPad OpenGL ES 2.0 application and require a backing frame buffer of 1024×768. I use GLKView and iOS 5.1 to manage creation of backend frame/render buffers (using code from the autogenerated OpenGL Game template provided by XCode). I get acceptable performance on iPad2, and life is good.
However, during testing I got my hands on a iPad 3 with Retina display, and when my application is recompiled/installed to the iPad3, the backend frame/render buffers are running at 2048×1536, and this is crippling my performance.
Now for my questions:
1) How do I force the GLKView autogenerated frame buffer to default to 1024×768 instead of 2048×1536.
Bonus question:
2) How come I’m not getting the x2 scaling button? Is this because I’ve recompiled the app with the iPad3 attached, and Xcode doing some behind the scenes modifications? If I only compile the app with my iPad2 attached and submit the application to the AppStore, will the end user running an iPad3 actually get the x2 scaling button then?
In order to force a
GLKViewnot to use full retina resolution, just set thecontentScaleFactorto1.0.The
contentScaleFactoris the number of pixels per point. All iPads have a screen resolution of 1024×768 points so a full-screen view with a content scale factor of 1.0 will have 1024×768 pixels. The scale factor will otherwise default to 2.0 on a retina device and 1.0 otherwise.