glCheckFramebufferStatusEXT returns GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT for me when I try to create a frame buffer that renders depth to a texture (shadow mapping). Rendering to a color buffer works fine.
The spec does not clearly explain what this error means.
@AlexN: I’m sorry. Actually your comment is a correct solution. I erroneously placed those functions before the bind() call rather than after, which of course didn’t help.
It now does work, or at least the FBO status is ok. Not showing correct results yet, which undoubltly still requires some tinkering.
Is this guaranteed to work on ATI (and other) cards as well? I read some discussions on various forums that offered other solutions as well. Though this is the only one that works on my GeForce 6200.
@yalmar: the code is fine AFAIK, with the two mentioned api calls added.
I believe certain cards do have issues with what precision the depth texture is, though - if you ask for 24-bit precision (DEPTH_COMPONENT24) it probably won’t work on any older ATI cards (only x1600/x1900 and newer). DEPTH_COMPONENT16 should work in that case.