summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpunto- <ariel@okamstudio.com>2015-06-04 02:03:13 -0300
committerpunto- <ariel@okamstudio.com>2015-06-04 02:03:13 -0300
commit8dde67cf706ae6e6a33eefdf69aa6922fac0e909 (patch)
treeac1ff9f6e8f2eb1573d2055d11ea89b983620f94
parentab99671bb835a5fe24a092ec34afe1ad862ac254 (diff)
parentef173a2c9cd95e5a72419427c3cb7818b7bf9088 (diff)
Merge pull request #2030 from romulox-x/iosScreenSize
ios screen resolution
-rwxr-xr-xplatform/iphone/gl_view.mm5
1 files changed, 3 insertions, 2 deletions
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);