We can update the OpenGL layer binding when we're laying out the views
authorSam Lantinga
Tue, 18 Sep 2012 00:50:41 -0700
changeset 64356172658e3ce9
parent 6434 334e7dc89adb
child 6436 29a35c72905a
We can update the OpenGL layer binding when we're laying out the views
src/video/uikit/SDL_uikitopenglview.m
src/video/uikit/SDL_uikitviewcontroller.m
     1.1 --- a/src/video/uikit/SDL_uikitopenglview.m	Mon Sep 17 22:04:48 2012 -0700
     1.2 +++ b/src/video/uikit/SDL_uikitopenglview.m	Tue Sep 18 00:50:41 2012 -0700
     1.3 @@ -121,7 +121,8 @@
     1.4          }
     1.5          /* end create buffers */
     1.6  
     1.7 -        self.autoresizingMask = 0;  // don't allow autoresize, since we need to do some magic in -(void)updateFrame.
     1.8 +        self.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
     1.9 +        self.autoresizesSubviews = YES;
    1.10      }
    1.11      return self;
    1.12  }
    1.13 @@ -198,6 +199,7 @@
    1.14  - (void)layoutSubviews
    1.15  {
    1.16      [EAGLContext setCurrentContext:context];
    1.17 +    [self updateFrame];
    1.18  }
    1.19  
    1.20  - (void)destroyFramebuffer
     2.1 --- a/src/video/uikit/SDL_uikitviewcontroller.m	Mon Sep 17 22:04:48 2012 -0700
     2.2 +++ b/src/video/uikit/SDL_uikitviewcontroller.m	Tue Sep 18 00:50:41 2012 -0700
     2.3 @@ -145,7 +145,6 @@
     2.4  
     2.5      [uiwindow setFrame:frame];
     2.6      [data->view setFrame:frame];
     2.7 -    [data->view updateFrame];
     2.8      SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h);
     2.9  }
    2.10