Fixed where we set the content scale - it's used by the renderbufferStorage:GL_RENDERBUFFER_OES call.
authorSam Lantinga
Thu, 17 Nov 2011 00:41:07 -0500
changeset 6085fcffe5fdf54b
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
     1.1 --- a/src/video/uikit/SDL_uikitopenglview.m	Wed Nov 16 05:13:40 2011 -0500
     1.2 +++ b/src/video/uikit/SDL_uikitopenglview.m	Thu Nov 17 00:41:07 2011 -0500
     1.3 @@ -78,6 +78,11 @@
     1.4              return nil;
     1.5          }
     1.6  
     1.7 +        // !!! FIXME: use the screen this is on!
     1.8 +        /* Use the main screen scale (for retina display support) */
     1.9 +        if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
    1.10 +            self.contentScaleFactor = [UIScreen mainScreen].scale;
    1.11 +
    1.12          /* create the buffers */
    1.13          glGenFramebuffersOES(1, &viewFramebuffer);
    1.14          glGenRenderbuffersOES(1, &viewRenderbuffer);
    1.15 @@ -115,11 +120,6 @@
    1.16          }
    1.17          /* end create buffers */
    1.18  
    1.19 -        // !!! FIXME: use the screen this is on!
    1.20 -        /* Use the main screen scale (for retina display support) */
    1.21 -        if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
    1.22 -            self.contentScaleFactor = [UIScreen mainScreen].scale;
    1.23 -
    1.24          self.autoresizingMask = 0;  // don't allow autoresize, since we need to do some magic in -(void)updateFrame.
    1.25      }
    1.26      return self;
    1.27 @@ -144,11 +144,6 @@
    1.28          glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer);
    1.29          glRenderbufferStorageOES(GL_RENDERBUFFER_OES, depthBufferFormat, backingWidth, backingHeight);
    1.30      }
    1.31 -
    1.32 -    // !!! FIXME: use the screen this is on!
    1.33 -    /* Use the main screen scale (for retina display support) */
    1.34 -    if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
    1.35 -        self.contentScaleFactor = [UIScreen mainScreen].scale;
    1.36  }
    1.37  
    1.38  - (void)setCurrentContext