Why, on iOS, is glRenderbufferStorage appearing to fail?

Posted by dugla on Game Development See other posts from Game Development or by dugla
Published on 2011-01-28T14:59:48Z Indexed on 2011/01/28 23:39 UTC
Read the original article Hit count: 357

Filed under:
|
|

On an iOS device (iPad) I decided to change the storage for my renderbuffer from the CAEAGLLayer that backs the view to explicit storage via glRenderbufferStorage. Sadly, the following code fails to result in a valid FBO. Can someone please tell me what I missed?:

glGenFramebuffers(1, &m_framebuffer);
glBindFramebuffer(GL_FRAMEBUFFER, m_framebuffer);

glGenRenderbuffers(1, &m_colorbuffer);
glBindRenderbuffer(GL_RENDERBUFFER, m_colorbuffer);

GLsizei width  = (GLsizei)layer.bounds.size.width;
GLsizei height = (GLsizei)layer.bounds.size.height;
glRenderbufferStorage(m_colorbuffer, GL_RGBA8_OES, width, height);

glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, m_colorbuffer);

Note: The layer size is valid and correct.
This is solid production working rendering code. The only change I am making is the line

glRenderbufferStorage(...)

previously I did:

[m_context renderbufferStorage:GL_RENDERBUFFER fromDrawable:layer]

Thanks,
Doug

© Game Development or respective owner

Related posts about rendering

Related posts about opengl-es