From ef173a2c9cd95e5a72419427c3cb7818b7bf9088 Mon Sep 17 00:00:00 2001 From: romulox_x Date: Wed, 3 Jun 2015 21:57:33 -0700 Subject: improved calculation of screen resolution on ios --- platform/iphone/gl_view.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'platform/iphone') diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index 55185aa49d..3309fd0820 100755 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -352,8 +352,9 @@ static void clear_touches() { // Generate IDs for a framebuffer object and a color renderbuffer UIScreen* mainscr = [UIScreen mainScreen]; printf("******** screen size %i, %i\n", (int)mainscr.currentMode.size.width, (int)mainscr.currentMode.size.height); - if (mainscr.currentMode.size.width == 640 || mainscr.currentMode.size.width == 960) // modern iphone, can go to 640x960 - self.contentScaleFactor = 2.0; + float minPointSize = MIN(mainscr.bounds.size.width, mainscr.bounds.size.height); + float minScreenSize = MIN(mainscr.currentMode.size.width, mainscr.currentMode.size.height); + self.contentScaleFactor = minScreenSize / minPointSize; glGenFramebuffersOES(1, &viewFramebuffer); glGenRenderbuffersOES(1, &viewRenderbuffer); -- cgit v1.2.3