• Advertisement
Sign in to follow this  

copy from a texture to an other texture

This topic is 3510 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have what must be a beginner question. I'm trying to copy a sub-region of a texture, 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.

Share this post


Link to post
Share on other sites
Advertisement
AFAIK you can do this with a PBO. You need to store the source texture in the PBO (or draw it to the PBO), make the PBO's context the current context and then call glCopyTexSubImage2D().

I'm not sure about this however, so you might either try it, google this a bit or wait for someone to prove me wrong or right [smile].

Share this post


Link to post
Share on other sites
I already have the source texture stored in a FBO, could I make the FBO's context current context ?

I tried like this:
glExtensions.glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBOHandle );

and like this

glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, FBOHandle );

but it's not working.

[Edited by - smallfly on July 10, 2008 3:23:12 PM]

Share this post


Link to post
Share on other sites
ok I got it working.

'glExtensions.glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBOHandle );' was in fact working correctly. I had broken something else in my app.

Share this post


Link to post
Share on other sites
Quote:
Original post by smallfly
I already have the source texture stored in a FBO, could I make the FBO's context current context ?


FBO's don't have a context.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement