Skip to main content
gamedev.net
🔒 Locked

IDirect3DTexture8

Started by Abob May 25, 2002 at 8:43 PM 2 replies 650+ views
Original Post
Abob
Abob
Is there a way to create a IDirect3DTexture8 from another one? i.e. I’m trying to write an class to handle Textures and I cant get the copy constructer to work. Do I have to lock both textures and copy the data over? Thanks for any help
Arrg!!
RapidStunna
RapidStunna
Normally, you''re textures point to actual data. IDirect3DTexture* points to a memory location. If you wanted to copy a texture, you could just set them equal to each other because then they will both point to the same data. Microsoft thought that through so that you could do that.

If you actually want to create a new texture, first release the old one. Then create the new one the same sizes and attributes as the copied texture by getting the values using GetLevelDesc. after doing that, use lock, unlock, and copyrects to copy the data.
Abob
Abob
RapidStunna
Could you post sum example code?
I can’t seam to get this to work(how do I deal with mipmaps?)
Arrg!!
IndirectX
IndirectX
If you want to have two identical textures, use AddRef and Release instead of copying the texture data around.
---visit #directxdev on afternet <- not just for directx, despite the name

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.