Original Post
Hi, I'm trying to copy the current screen content to a texture. I always used glcopyteximage2d example for that, but now I came accross "glBlitFramebufferEXT". Is this a faster way? This is my situation: 1- Activate FBO, render everything to texture X 2- At halfway, I want to copy the current content from texture X to another texture Y 3- Continue rendering transparent objects on texture X. 4- Disable FBO At step 2 (copying stage), I call:
glBindFramebufferEXT( GL_READ_FRAMEBUFFER_EXT, 0 ); // Set source, current window
glBindFramebufferEXT( GL_DRAW_FRAMEBUFFER_EXT, target.handle ); // Set target
glBlitFramebufferEXT( 0, 0, width , height, // Copy
0, 0, target.width , target.height,
GL_COLOR_BUFFER_BIT, GL_LINEAR );
// Continue normal rendering
// Don't know if this is ok, but I skip the last line the
// final result is messed up, everything that follows is rendered
// on top.
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, handle );
However, the target texture is still black. It has the same resolution and color depth than the source. Maybe I forgot something? Rick