myEAGLLayer = (CAEAGLLayer*)self.layer;
GLuint colorRenderbuffer;
glGenRenderbuffers(1, &colorRenderbuffer);glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer);
[myContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:myEAGLLayer];
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,GL_RENDERBUFFER, colorRenderbuffer);
Note WhentheCoreAnimationlayer’sboundsorpropertieschange,yourapplicationshouldreallocate the renderbuffer’s storage. If you do not reallocate the renderbuffers, the renderbuffersize won’t match the size of the view; in this case, Core Animation may scale the image’s contentsto fit in the view. To prevent this, the Xcode template reallocates the framebuffer and renderbufferwhenever the view layout changes.
版权声明:本文为博主原创文章,未经博主允许不得转载。