|
Hey Lockergnome, I am a iOS developer and I am currently using the Cocos2D engine to do all my drawing. The only problem with it is that I have no idea how OpenGLES works. Cocos2D is based on ES 1.1 which is sort-of outdated and the ES 2.0 version isn't stable yet. I want to learn OpenGLES 2.0 myself and it's going ok. Right now I am mostly using the tutorials from www.raywenderlich.com/ and they teach me a lot! The one thing that I just haven't gotten to work yet is the support for a retina display. Whith the iPhone 4+ and iPod Touch 3+ and now coming to the iPad it is very handy to know how to do this. Google hasn't helped me a lot since a lot of method that are shown there don't exist for my projects for some reason (all the methods starting with gl and ending with EOS). Do any of you know this or a place where I can find out? Please share!
This question is marked "community wiki".
|
|
Ignorant me! I somehow thought it was just a single method call that would make my apps support Retina and it was, it just needed to be called on multiple places. My main drawing class is a subclass of the UIView and somewhat converted into a CAEAGLLayer via the + (Class)layerClass; method. On that main view you need to set the contentScaleFactor to 2. On the eaglLayer object you also needed to set the contentScaleFactor to to. Up to this I only got a black screen (which is why I asked the question) because my back-end buffer wasn't twice as big. Simply double the width and height values (only if retina is available!) in glRenderbufferStorage and you're done. |
