I'm using a iPhone/ipad app with an empty view set to use my EAGLView class. I initialize the framebuffer with:
self.contentScaleFactor = [[UIScreen mainScreen] scale];
self.layer.contentsScale = [[UIScreen mainScreen] scale]; //this is 1.0
glGenFramebuffersOES(1, &defaultFramebuffer);
glBindFramebufferOES(GL_FRAMEBUFFER_OES, defaultFramebuffer);
glGenRenderbuffersOES(1, &colorRenderbuffer);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer);
[context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)self.layer];
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &framebufferWidth);
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &framebufferHeight);
after that, framebufferWidth is 1568 and framebufferHeight is 1216. My device is reported by [[UIDevice currentDevice] model] as @"ipad", iOS 4.3.5. Xcode 4.5.1, SDK 6, deployment target 4.3.
Anyone has any idea why I got this sizes and not the 1024x768 ?
Thanks.
Later Edit: same code worked perfectly with Xcode 3.x and SDK 4.3, with deployment target 4.0.