Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float ver = [[[UIDevice currentDevice] systemVersion] floatValue];
- // You can't detect screen resolutions in pre 3.2 devices, but they are all 320x480
- if (ver >= 3.2f)
- {
- UIScreen* mainscr = [UIScreen mainScreen];
- w = mainscr.currentMode.size.width;
- h = mainscr.currentMode.size.height;
- if (w == 640 && h == 960) // Retina display detected
- {
- // Set contentScale Factor to 2
- self.contentScaleFactor = 2.0;
- // Also set our glLayer contentScale Factor to 2
- eaglLayer.contentsScale=2; //new line
- }
- }
Add Comment
Please, Sign In to add comment