iPad retina/regular suport implementation

So i want to implement retina display support and i’ve come across two methods. Is there any advantage one has over another?

  1. Using this line of code CCDirector::sharedDirector()->enableRetinaDisplay(true); which i believe will enable reading the last bit of a png filename to figure out which graphic to use so if retina is enable it would be xxx-ipadhd.png

  2. Using a set of IF statements to determine the screensize and then select the appropriate folder.

The way i see it is that i will still need both otherwise how will i know its a retina display or not? All CCDirector::sharedDirector()->enableRetinaDisplay(true); does is eliminate the need to select a folder.

Can anybody confirm or deny my train of thought?

Also if anybody could expand on how CCDirector::sharedDirector()->enableRetinaDisplay(true); actually looks like in code. Like how would i display a sprite depending on enableRetinaDisplay(). Would i just have my retina and regular graphics named apple-ipadhd.png and apple-ipad.png ? But what i dont understand about that is how you would do a CCSprite::create ("[FILENAME HERE]"); ??

Thanks in advance.

latest versions of cocos2dx avoid using that. So I recommend you to upgrade. Please read this:

http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Multi_resolution_support