Archived

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

softimage

how to directly create a clean texture?

Recommended Posts

softimage    122
When running the same application twice, I found that the CreateTexture() returned a texture with the content that I wrote last time. How to directly create a texture with r,g,b,a = 0,0,0,0 ? Or is there any function to flush the content?

Share this post


Link to post
Share on other sites
Nik02    4348
Use the FillTexture functions, they are the easiest way to clear a texture.
What you described is normal behaviour, D3D doesn''t bother to clear the texture on creation. This is mainly for performance reasons, but in case of an unknown texture format, D3D might not even know what data matches the intended color.

-Nik

Share this post


Link to post
Share on other sites