When I was destroying entities, I thought it textures would get destroyed as well, but I ended up clogging up my GPU mem.
Is unloading unreferenced resources necessary to clean the textures? I wasn't loading the textures and materials explicitly, but I need to get rid of them myself. Thus, I suggest documentation notice on 'destroyEntity' method.
Also, unloading unreferenced textures didn't help as well, because they were referenced from material's TextureUnitStates. So I needed to do this tlike this:
Code: Select all
// DESTROY ENTITIES, AND THEN...
MaterialManager::getSingletonPtr()->unloadUnreferencedResources(true);
TextureManager::getSingletonPtr()->unloadUnreferencedResources(true);