textures pointing to eachother directx9 c++
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
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement