What are the necessary steps to update an existing OpenGL ES 1.1 based 2D iPhone game to be compatible w/ the iPhone 4's retina display? I'm still using the Texture2D class that came w/ Apple's CrashLanding (download) sample code.
After reading Apple's documentation, watching the WWDC video (session 134 "Optimize Your iPhone App for the Retina Display"), and looking at Cocos2D sample code I'm still confused.
I believe the required steps include:
[UIImage imageNamed:@"image.png"]
glOrthof
to include the contentScaleFactorglViewport
Please note that I'm relatively new to OpenGL.
Thanks for your help!
You should keep the 320x480 image, and provide the 640x960 image with a different name. Suppose the 320x480 image is called foo.png
, then name the 640x960 one [email protected]
.
The system will then automatically select the higher resolution one on iPhone 4, without any change in code — assuming you were using [UIImage imageNamed:@"foo.png"]
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With