1

Hello I am writing an example OpenGLES app, if I setup openGL via the view's initWithCode:(NSCoder *) coder method, the call of glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &_backingWidth); returns 960x480 for iPad air.

But if I setup openGL in the view's -(void) layoutSubviews method, it will return 2048x1536,

I can not understand why they return different. can any expert explain?

4

2 回答 2

0

您需要在所有 openGL 操作之前添加 [EAGLContext setCurrentContext:_context]。就我而言,它是固定的。祝你好运!

于 2016-10-24T09:44:43.407 回答
0

这是我的错误。原始尺寸来自故事板

于 2015-12-30T15:13:44.547 回答