summaryrefslogtreecommitdiff
path: root/platform/iphone/gl_view.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/iphone/gl_view.mm')
-rwxr-xr-xplatform/iphone/gl_view.mm7
1 files changed, 4 insertions, 3 deletions
diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm
index 3d6c48ffaf..3309fd0820 100755
--- a/platform/iphone/gl_view.mm
+++ b/platform/iphone/gl_view.mm
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -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);