# HG changeset patch # User Sam Lantinga # Date 1296579274 28800 # Node ID ec13e48ee0d953f013e9462d9712a8211c434702 # Parent 5690ebc772c72549aef3f2c4a6733286d62dc979 Fixed bug #1112 (retina display support) Vittorio Giovara 2011-02-01 02:21:50 PST with the attached patch, the opengles context will always use the maximum screensize available; this is particularly useful for supporting retina display on latest iphone. please note: Apple documentation warns that using the "upscaled" gl context actually uses more memory and bandwitdh, so it might be worth to let the user decide whether to disable it or not, either with a flag or a sdl function... diff -r 5690ebc772c7 -r ec13e48ee0d9 src/video/uikit/SDL_uikitopenglview.m --- a/src/video/uikit/SDL_uikitopenglview.m Tue Feb 01 08:53:22 2011 -0800 +++ b/src/video/uikit/SDL_uikitopenglview.m Tue Feb 01 08:54:34 2011 -0800 @@ -116,6 +116,10 @@ return NO; } /* end create buffers */ + + /* Use the main screen scale (for retina display support) */ + if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) + self.contentScaleFactor = [UIScreen mainScreen].scale; } return self; }