textures pointing to eachother directx9 c++

Started by
2 comments, last by r_bewick 14 years, 7 months ago
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
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.
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.
thanks B_old and sirlemonhead! they both work perfectly.


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

This topic is closed to new replies.

Advertisement