As a terrain page gets loaded, I iterate the textures used by the entire page and preemptively load them into the Hlms texture atlas by:
Code: Select all
hlmsTextureManager->createOrRetrieveTexture( textureName, TEXTURE_TYPE_DIFFUSE );
Building up the materials needed to render the pages & cells is pretty straight forward and simple.
During the unload phase of a terrain page, I need to be able to determine whether or not a particular texture that was used by the page is being used by any other pages and if not, unload it from the Hlms Texture Manager/Atlas.
Does OGRE offer any clean way for me to determine whether that texture is no longer used and discard it without having to resort to writing my own reference management for doing this?