Why, on iOS, is glRenderbufferStorage appearing to fail?
- by dugla
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