We can update the OpenGL layer binding when we're laying out the views
authorSam Lantinga <slouken@libsdl.org>
Tue, 18 Sep 2012 00:50:41 -0700
changeset 6435 6172658e3ce9
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
--- a/src/video/uikit/SDL_uikitopenglview.m	Mon Sep 17 22:04:48 2012 -0700
+++ b/src/video/uikit/SDL_uikitopenglview.m	Tue Sep 18 00:50:41 2012 -0700
@@ -121,7 +121,8 @@
         }
         /* end create buffers */
 
-        self.autoresizingMask = 0;  // don't allow autoresize, since we need to do some magic in -(void)updateFrame.
+        self.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
+        self.autoresizesSubviews = YES;
     }
     return self;
 }
@@ -198,6 +199,7 @@
 - (void)layoutSubviews
 {
     [EAGLContext setCurrentContext:context];
+    [self updateFrame];
 }
 
 - (void)destroyFramebuffer
--- a/src/video/uikit/SDL_uikitviewcontroller.m	Mon Sep 17 22:04:48 2012 -0700
+++ b/src/video/uikit/SDL_uikitviewcontroller.m	Tue Sep 18 00:50:41 2012 -0700
@@ -145,7 +145,6 @@
 
     [uiwindow setFrame:frame];
     [data->view setFrame:frame];
-    [data->view updateFrame];
     SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h);
 }