From cb2d5f506566a6c8f7a31ec18c8b76ead6ac55a7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 1 Feb 2011 08:54:34 -0800 Subject: [PATCH] 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... --- src/video/uikit/SDL_uikitopenglview.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video/uikit/SDL_uikitopenglview.m b/src/video/uikit/SDL_uikitopenglview.m index 31c6c9ddd..eeb79d275 100644 --- a/src/video/uikit/SDL_uikitopenglview.m +++ b/src/video/uikit/SDL_uikitopenglview.m @@ -116,6 +116,10 @@ - (id)initWithFrame:(CGRect)frame \ 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; }