Create Buffer OpenGLES 2 <p>I am having some problem with the creation of frame buffer with opengles. For my application, I create the main frame buffer like this:</p> <pre><code>glGenFramebuffers( 1, &amp;viewFramebuffer ); glGenRenderbuffers( 1, &amp;viewRenderbuffer ); glBindFramebuffer( GL_FRAMEBUFFER, viewFramebuffer ); glBindRenderbuffer( GL_RENDERBUFFER, viewRenderbuffer ); [ Context renderbufferStorage : GL_RENDERBUFFER fromDrawable : ( CAEAGLLayer* )self.layer ]; glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, viewRenderbuffer ); glGetRenderbufferParameteriv( GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &amp;backingWidth ); glGetRenderbufferParameteriv( GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &amp;backingHeight ); if ( itUsesDepthBuffer ) { glGenRenderbuffers( 1, &amp;depthRenderbuffer ); glBindRenderbuffer( GL_RENDERBUFFER, depthRenderbuffer ); glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, backingWidth, backingHeight ); glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthRenderbuffer ); } if ( glCheckFramebufferStatus( GL_FRAMEBUFFER ) != GL_FRAMEBUFFER_COMPLETE ) { NSLog( @"failed to make complete framebuffer object %x", glCheckFramebufferStatus( GL_FRAMEBUFFER ) ); [ self destroyFramebuffer ]; return NO; } </code></pre> <p>But the function glGetRenderbufferParameteriv returns 0 either for GL_RENDERBUFFER_WIDTH and GL_RENDERBUFFER_HEIGHT and eventually the glCheckFramebufferStatus returns an error as framebuffer attachment is incomplete.</p> <p>Do you have any idea why is this happening?</p> <p>Thank you in advance.</p>