PDA

View Full Version : copy from a texture to an other texture



smallfly
07-10-2008, 02:54 PM
Hi,

I have what must be a beginner question.

I'm trying to copy a sub-region of a texture [which is stored in a FBO], into an other texture.

So far I have been able to copy a sub-region of what is displayed on the screen to a texture, by doing so:

glEnable(textureTarget);
glBindTexture(textureTarget, (GLuint)textureName[0]);
glCopyTexSubImage2D(textureTarget, 0,0,0,x,y,w,h);
glDisable(textureTarget);

But how can copy from a specific texture ?

Thanks.

smallfly
07-10-2008, 03:42 PM
ok I got it.

I used 'glExtensions.glBindFramebufferEXT(GL_FRAMEBUFFER_ EXT, FBOHandle );' in order to set the FBO as current context.