Copying Textures

Started by
0 comments, last by c t o a n 21 years, 4 months ago
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
Chris PergrossiMy Realm | "Good Morning, Dave"
Advertisement
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!
Editor42 ...builds worlds

This topic is closed to new replies.

Advertisement