Two parts here. I was getting the same error, but you don’t need to change the oF source. Just create your FBO with something like
settings.width = 1024;
settings.height = 1024;
settings.internalformat = GL_RGB;
settings.numSamples = 0;
settings.useDepth = false;
settings.useStencil = false;
scratchFBO = new ofFbo();
That will work fine, but of course there’s still the problem of what to do if you DO want a stencil and depth buffer. I believe the problem is that ofFbo.cpp tries to do separate depth and stencil buffers when building for GLES, but iOS no longer supports that, it wants a single packed depth+stencil buffer. Trouble is, it is setup in a slightly different way to the current non-ES path, there’s no GL_DEPTH_STENCIL_ATTACHMENT in ES.
I’m pretty sure changing ofFbo::allocate(Settings _settings) to include the following is the right fix, but does anyone else want to weigh in? I’m no GL expert.
// If we want both a depth AND a stencil buffer tehn combine them into a single buffer
if( settings.useDepth && settings.useStencil )
stencilBuffer = depthBuffer = createAndAttachRenderbuffer(GL_DEPTH_STENCIL, GL_DEPTH_STENCIL_ATTACHMENT);
stencilBuffer = depthBuffer = createAndAttachRenderbuffer(GL_DEPTH_STENCIL, GL_DEPTH_ATTACHMENT);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, stencilBuffer);