src/video/uikit/SDL_uikitopengles.m
branchiOS-improvements
changeset 9517 dbe19a0cad97
parent 9514 5b56ab9ff5fe
child 9524 9de159f9cefd
equal deleted inserted replaced
9516:77867123589c 9517:dbe19a0cad97
   119         CGRect frame = UIKit_ComputeViewFrame(window, uiwindow.screen);
   119         CGRect frame = UIKit_ComputeViewFrame(window, uiwindow.screen);
   120         EAGLSharegroup *share_group = nil;
   120         EAGLSharegroup *share_group = nil;
   121         CGFloat scale = 1.0;
   121         CGFloat scale = 1.0;
   122 
   122 
   123         if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
   123         if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
   124             /* Set the scale to the natural scale factor of the screen - the backing
   124             /* Set the scale to the natural scale factor of the screen - the
   125                dimensions of the OpenGL view will match the pixel dimensions of the
   125                backing dimensions of the OpenGL view will match the pixel
   126                screen rather than the dimensions in points.
   126                dimensions of the screen rather than the dimensions in points.
   127              */
   127              */
   128             scale = uiwindow.screen.scale;
   128 #ifdef __IPHONE_8_0
       
   129             if ([uiwindow.screen respondsToSelector:@selector(nativeScale)]) {
       
   130                 scale = uiwindow.screen.nativeScale;
       
   131             } else
       
   132 #endif
       
   133             {
       
   134                 scale = uiwindow.screen.scale;
       
   135             }
   129         }
   136         }
   130 
   137 
   131         if (_this->gl_config.share_with_current_context) {
   138         if (_this->gl_config.share_with_current_context) {
   132             EAGLContext *context = (__bridge EAGLContext *) SDL_GL_GetCurrentContext();
   139             EAGLContext *context = (__bridge EAGLContext *) SDL_GL_GetCurrentContext();
   133             share_group = context.sharegroup;
   140             share_group = context.sharegroup;