Page 1 of 1

Clearing textures?

Posted: Mon Aug 07, 2006 1:37 pm
by terence
Hi,

Probably a stupid question, but not asking is worse.

I know you call driver->getTexture(X) to load a texture but I don't see a 'clear'/release texture function. I am assuming that the engine does texture management for us? Still I am building a surface management class and would like to be able to clear a texture..or should I not even bother.

Posted: Mon Aug 07, 2006 4:12 pm
by vitek
The video driver has a texture cache. Every time you call getTexture for a texture that is not yet in the cache, it will be loaded from disk. Once it is in the cache, it will remain until you remove it. The IVideoDriver interface provides methods for removing textures from the cache.

If a texture has been removed from the cache, it should be automatically deleted when the last reference to it is dropped.

Travis