src/video/uikit/SDL_uikitopengles.m
branchiOS-improvements
changeset 9517 dbe19a0cad97
parent 9514 5b56ab9ff5fe
child 9524 9de159f9cefd
--- a/src/video/uikit/SDL_uikitopengles.m	Wed Sep 10 18:10:37 2014 -0300
+++ b/src/video/uikit/SDL_uikitopengles.m	Sun Sep 14 17:04:54 2014 -0300
@@ -121,11 +121,18 @@
         CGFloat scale = 1.0;
 
         if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
-            /* Set the scale to the natural scale factor of the screen - the backing
-               dimensions of the OpenGL view will match the pixel dimensions of the
-               screen rather than the dimensions in points.
+            /* Set the scale to the natural scale factor of the screen - the
+               backing dimensions of the OpenGL view will match the pixel
+               dimensions of the screen rather than the dimensions in points.
              */
-            scale = uiwindow.screen.scale;
+#ifdef __IPHONE_8_0
+            if ([uiwindow.screen respondsToSelector:@selector(nativeScale)]) {
+                scale = uiwindow.screen.nativeScale;
+            } else
+#endif
+            {
+                scale = uiwindow.screen.scale;
+            }
         }
 
         if (_this->gl_config.share_with_current_context) {