src/video/uikit/SDL_uikitopengles.m
branchiOS-improvements
changeset 9502 933ed557b7c1
parent 9498 d02c27e3f698
child 9506 18e3f94bd860
     1.1 --- a/src/video/uikit/SDL_uikitopengles.m	Wed Jul 23 03:05:31 2014 -0300
     1.2 +++ b/src/video/uikit/SDL_uikitopengles.m	Wed Jul 23 21:55:42 2014 -0300
     1.3 @@ -116,6 +116,7 @@
     1.4      SDL_uikitopenglview *view;
     1.5      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
     1.6      UIWindow *uiwindow = data->uiwindow;
     1.7 +    CGRect frame = UIKit_ComputeViewFrame(window, uiwindow.screen);
     1.8      EAGLSharegroup *share_group = nil;
     1.9      CGFloat scale = 1.0;
    1.10  
    1.11 @@ -124,7 +125,7 @@
    1.12             dimensions of the OpenGL view will match the pixel dimensions of the
    1.13             screen rather than the dimensions in points.
    1.14           */
    1.15 -        scale = [uiwindow screen].scale;
    1.16 +        scale = uiwindow.screen.scale;
    1.17      }
    1.18  
    1.19      if (_this->gl_config.share_with_current_context) {
    1.20 @@ -132,13 +133,6 @@
    1.21          share_group = [view.context sharegroup];
    1.22      }
    1.23  
    1.24 -    CGRect frame;
    1.25 -    if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) {
    1.26 -        frame = [[uiwindow screen] bounds];
    1.27 -    } else {
    1.28 -        frame = [[uiwindow screen] applicationFrame];
    1.29 -    }
    1.30 -
    1.31      /* construct our view, passing in SDL's OpenGL configuration data */
    1.32      view = [[SDL_uikitopenglview alloc] initWithFrame: frame
    1.33                                                  scale: scale
    1.34 @@ -175,7 +169,7 @@
    1.35      }
    1.36  
    1.37      /* Make this window the current mouse focus for touch input */
    1.38 -    if ([uiwindow screen] == [UIScreen mainScreen]) {
    1.39 +    if (uiwindow.screen == [UIScreen mainScreen]) {
    1.40          SDL_SetMouseFocus(window);
    1.41          SDL_SetKeyboardFocus(window);
    1.42      }