This topic is now archived and is closed to further replies.

c t o a n

Copying Textures

Recommended Posts

Cheers I''m trying to make a texture manager for my engine, and so far, it works great! However, when I have to make a texture procedurally (as opposed to loading it) I''ve got to copy it a few times to other textures in order to insert it in the manager properly. My problem is that I''m unable to copy the texture! Is there a way to do this (other than locking the textures, cause that doesn''t work with textures in some memory spaces) such as a D3DX function or something? Thanks Chris

Share this post

Link to post
Share on other sites
It depends what pool you are using.

If you use the DEFAULT pool, you will need a SYSTEM memory copy of it. That is, you need to allocate both one in the DEFAULT pool and one in SYSTEM pool. To write into the texture:

- Lock SYSTEM texture
- Write in first level of SYSTEM texture
- Unlock SYSTEM texture
- Call D3DXFilterTexture if needed (for mipmaping) on SYSTEM texture
- Call Update on DEFAULT texture

For MANAGED pool it''s less trouble since the driver is doing all that work for you.

Oooh, you found the horadric cube!

Share this post

Link to post
Share on other sites