Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed where we set the content scale - it's used by the renderbufferS…
Browse files Browse the repository at this point in the history
…torage:GL_RENDERBUFFER_OES call.
  • Loading branch information
slouken committed Nov 17, 2011
1 parent a5f7ee4 commit cb0ed63
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/video/uikit/SDL_uikitopenglview.m
Expand Up @@ -78,6 +78,11 @@ - (id)initWithFrame:(CGRect)frame
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);
Expand Down Expand Up @@ -115,11 +120,6 @@ - (id)initWithFrame:(CGRect)frame
}
/* 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;
Expand All @@ -144,11 +144,6 @@ - (void)updateFrame
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
Expand Down

0 comments on commit cb0ed63

Please sign in to comment.