• Advertisement
Sign in to follow this  

textures pointing to eachother directx9 c++

This topic is 3083 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 would like to copy the contents of a LPDIRECT3DTEXTURE9 to another without them pointing to eachother; eg LPDIRECT3DTEXTURE9 texture1; ...//load texture1 LPDIRECT3DTEXTURE9 texture2 = texture1; ...//edit texture2 when I edit texture2, texture1 is also edited. How can I stop this happening? thanks, r_bewick

Share this post


Link to post
Share on other sites
Advertisement
What exactly is it you are trying to do? Depending on the scenario it might be easiest to just load the texture again and then modify it.
Otherwise StretchRect() can be used to copy one surface to another.

Share this post


Link to post
Share on other sites
Look in the DirectX documentation for the function UpdateTexture. It'll allow you to copy from one texture to another and then edit the second without affecting the first.

Share this post


Link to post
Share on other sites
thanks B_old and sirlemonhead! they both work perfectly.


[Edited by - r_bewick on September 13, 2009 12:44:22 AM]

Share this post


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

  • Advertisement