• Advertisement
Sign in to follow this  

Modifying a LPDIRECT3DTEXTURE9

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

I am doing some texture pre-processing and I need to change the attributes of a LPDIRECT3DTEXTURE9, i.e. its dimensions and possibly the pixel format. Is there a way to do this without having to create a new instance of a LPDIRECT3DTEXTURE9? At the moment I'm solving the problem by creating a new texture of the correct dimensions, releasing the old one after processing it and assigning the address of the newly created texture to the old (empty) identifier. This is giving me cleanup problems though, whereas the refcount of the device seems to be non-zero after cleaning everything up during shutdown. Cheers

Share this post


Link to post
Share on other sites
Advertisement
I don't think there is any way to do what you seek on the PC.

You need to properly create the new texture, get the data out of the old one (by locking it etc.) muck with it however you want and then write that data into the new texture.

I can't determine why your refcounts are incorrect without seeing code, but it's most likely there is an AddRef() (explicit or implied by a D3D function call) that isn't getting released appropriately.

-Mezz

Share this post


Link to post
Share on other sites
Thanks for the help!

Turned out that I'd forgotten to release an aquired device pointer I used to create that new texture. :P

problem solved!

Cheers, hlnsi

Share this post


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

  • Advertisement