0
iOS6 4 인치 망막 시뮬레이터에서 실행되는 경우 OpenGL 응용 프로그램에서 CAEAGLLayer에 대한 잘못된 경계 정보가 표시됩니다.iPhone 5 CAEAGLLayer가 잘못된 경계를 반환 함
- (id)initWithCoder:(NSCoder*)coder {
if ((self = [super initWithCoder:coder])) {
// Get the layer
CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
eaglLayer.opaque = YES;
eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil];
printf("layer bounds are: (%f,%f), (%f,%f)\n", eaglLayer.bounds.origin.x, eaglLayer.bounds.origin.y, eaglLayer.bounds.size.width, eaglLayer.bounds.size.height);
context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];
if (!context || ![EAGLContext setCurrentContext:context]) {
[self release];
return nil;
}
animationInterval = 1.0/60.0;
}
return self;
}
이 창 내용이 다음 위로 이동하고, 0,0 올바른 위치에 더 이상 :
CAEAGLLayer 경계는이 코드에서
layer bounds are: (0.000000,0.000000), (320.000000,480.000000)
로 인쇄되지 않습니다.
CAEAGLLayer가 잘못된 너비/높이로 설정되는 이유는 누구나 알 수 있습니까?
덕분에