Fixed where we set the content scale - it's used by the renderbufferStorage:GL_RENDERBUFFER_OES call.
authorSam Lantinga <slouken@libsdl.org>
Thu, 17 Nov 2011 00:41:07 -0500
changeset 6085 fcffe5fdf54b
parent 6080 eb0e11b096ab
child 6086 45d22791e77c
Fixed where we set the content scale - it's used by the renderbufferStorage:GL_RENDERBUFFER_OES call.
src/video/uikit/SDL_uikitopenglview.m
--- a/src/video/uikit/SDL_uikitopenglview.m	Wed Nov 16 05:13:40 2011 -0500
+++ b/src/video/uikit/SDL_uikitopenglview.m	Thu Nov 17 00:41:07 2011 -0500
@@ -78,6 +78,11 @@
             return nil;
         }
 
+        // !!! FIXME: use the screen this is on!
+        /* Use the main screen scale (for retina display support) */
+        if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
+            self.contentScaleFactor = [UIScreen mainScreen].scale;
+
         /* create the buffers */
         glGenFramebuffersOES(1, &viewFramebuffer);
         glGenRenderbuffersOES(1, &viewRenderbuffer);
@@ -115,11 +120,6 @@
         }
         /* end create buffers */
 
-        // !!! FIXME: use the screen this is on!
-        /* Use the main screen scale (for retina display support) */
-        if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
-            self.contentScaleFactor = [UIScreen mainScreen].scale;
-
         self.autoresizingMask = 0;  // don't allow autoresize, since we need to do some magic in -(void)updateFrame.
     }
     return self;
@@ -144,11 +144,6 @@
         glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer);
         glRenderbufferStorageOES(GL_RENDERBUFFER_OES, depthBufferFormat, backingWidth, backingHeight);
     }
-
-    // !!! FIXME: use the screen this is on!
-    /* Use the main screen scale (for retina display support) */
-    if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
-        self.contentScaleFactor = [UIScreen mainScreen].scale;
 }
 
 - (void)setCurrentContext