Always reload texture
Posted: Sun Feb 06, 2011 12:38 pm
Hi all,
In tutorial#9, there is a comment and some code I can't understand. I tried to search the forum but there are 11500+ posts with "always reload texture"...
Can someone just tell me why once a texture is loaded we have to remove it and reload it again? Should I have to do the same in my projects?
Thanks in advance.
In tutorial#9, there is a comment and some code I can't understand. I tried to search the forum but there are 11500+ posts with "always reload texture"...
Code: Select all
{
video::ITexture * texture =
Device->getVideoDriver()->getTexture( filename );
if ( texture && Model )
{
// always reload texture
Device->getVideoDriver()->removeTexture(texture);
texture = Device->getVideoDriver()->getTexture( filename );
Model->setMaterialTexture(0, texture);
}
return;
}
Thanks in advance.