removeAllTextures problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
eye776
Posts: 94
Joined: Sun Dec 28, 2008 11:07 pm

removeAllTextures problem

Post by eye776 »

At a certain point, in my code I try to unload all the textures inside a function.

Code: Select all

void GameScreen::unload()
{
SMGR->clear();
SMGR->getMeshCache()->clear();
DRIVER->removeAllTextures(); // <-- crashes if this is NOT comented

/*
 various commented code follows
*/
}
Before calling the function I make sure nothing is being rendered anymore. The function works when quitting the application, but if after calling the function, I try to load anything else (getTexture(), getMesh()) again (without rendering), the app crashes (somewhere inside Irrlicht - haven't debugged yet) - and sometimes i get a BSOD.

If I comment the "removeAllTextures()", the app proceeds just fine, it can load and render any new models I load, but the textures I no longer use are still loaded and can take up quite a lot of memory.

Any ideas?

PS: I just read http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=26031. And I remembered I DO use particles. I'll try the workaround proposed there first.
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Did you drop all meshes, gui-element etc either? Another way is to take a look in the sourceforge.net patchsection for irrlicht. There must be one patch around which makes the ITextures ref-counted and provides a "release-unused-texture" method if I remember correctly. But its mostlikely outdated...
Post Reply