• Advertisement

Archived

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

how to directly create a clean texture?

This topic is 5018 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

  • Advertisement