Sign in to follow this  
hlnsi

Modifying a LPDIRECT3DTEXTURE9

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this