Originally Posted by
leeor_net
I created a std::map that I'm iterating through checking for a value. If the value matches, I delete the entry in map and continue on until I reach the end of the list.
Are you sure that a std::map is the correct container for this? Anyway, what you to do is this:
Code:
map<Image*, pair<GLuint, int> >::iterator i = mTextureArray.begin();
while(i != mTextureArray.end())
{
if((currentTick - i->second.second) > TEXTURE_EXPIRE_TIME)
{
glDeleteTextures(1, &i->second.first);
mTextureArray.erase(i++);
}
else
{
++i;
}
}