Преглед на файлове

Merge pull request #271 from blackberry/next

Next
Sean Paul Taylor преди 13 години
родител
ревизия
0fe9c68083
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      gameplay/src/PlatformiOS.mm

+ 5 - 1
gameplay/src/PlatformiOS.mm

@@ -103,11 +103,15 @@ int getKey(unichar keyCode);
         }
         
         // Configure the CAEAGLLayer and setup out the rendering context
+        CGFloat scale = [[UIScreen mainScreen] scale];
         CAEAGLLayer* layer = (CAEAGLLayer *)self.layer;
         layer.opaque = TRUE;
         layer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
                                    [NSNumber numberWithBool:FALSE], kEAGLDrawablePropertyRetainedBacking, 
                                     kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil];
+        self.contentScaleFactor = scale;
+        layer.contentsScale = scale;
+        
 		context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
         if (!context || ![EAGLContext setCurrentContext:context])
 		{
@@ -122,7 +126,7 @@ int getKey(unichar keyCode);
             
         glBindFramebuffer(GL_FRAMEBUFFER, defaultFramebuffer);
         glViewport(0, 0, framebufferWidth, framebufferHeight);
-        
+
         // Initialize Internal Defaults
         displayLink = nil;
         defaultFramebuffer = 0;