I am having some trouble rendering to textures for later use. Currently, I am generating a framebuffer object, creating two textures (one RGB and one DEPTH_COMPONENT), attaching the two textures, checking the status which is okay, and then drawing while the framebuffer is bound. Inside of gDEBugger I can see that everything is being drawn to the textures just fine.

However, when I try to bind back to default buffer ( glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0) ) the textures get cleared to zero and everything that was drawn to the textures ends up back in the static buffers. Also, I have also tried binding two more empty textures to the framebuffer and everything gets moved to the new textures.

Here is before and after

Any ideas?

Edited: removed code.

TL;DR: Problem was using EXTs (eg. glBindFramebufferEXT instead of glBindFramebuffer, etc).