copy from a texture to an other texture


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:

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

But how can copy from a specific texture ?


ok I got it.

I used ‘glExtensions.glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBOHandle );’ in order to set the FBO as current context.