Jump to content
  • Advertisement
Sign in to follow this  
r_bewick

textures pointing to eachother directx9 c++

This topic is 3297 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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!