Sign in to follow this  

Drawing without Rendering?

This topic is 3671 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

Is there a cheap method for copying texture information to another texture, such as, Render to: Texture A copy: Texture A -> Texture B I've been looking for this for a while now. I know that: Texture A = Texture B does not work. That just makes it so every time you render to Tex A, Tex B gets it as well. Not the desired effect. So is there some function like memcopy() or possibly a cheaper method that can preform this? I'm trying to avoid a big drop in frame rate here.

Share this post


Link to post
Share on other sites
It depends where your textures are. If you're rendering to texture A, I assume it's in the default pool, in which case the only way to read from it to Lock() the top-level surface (And then Lock() the top-level surface on Texture B and copy the bits), or to use StretchRect() - which requires that the Texture B is in the default pool too. And StretchRect has some other limitations (Like you need to check for driver support for copying between textures).

Share this post


Link to post
Share on other sites
thanks for the quick reply.

yes, they're in D3DPOOL_DEFAULT.

Wouldn't copying the bits on the CPU be horrendously slow? StretchRect() sounds like a good option. I take it its not really suported on older hardware so that won't be an issue. I'm aiming for newer hardware anyway. So how would I go about doing this?

Share this post


Link to post
Share on other sites

This topic is 3671 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this