DrawGetTextureId
From Valve Developer Community
| Return to ISurface | Continue to CreateNewTextureID → |
[edit]
int ISurface::DrawGetTextureId( char const *filename )
Use this function before CreateNewTextureID to make sure you don't reference the same material with multiple texture IDs.
[edit]
Sample
currentId = surface()->DrawGetTextureId( texturename );
if ( currentId == -1 )
{
currentId = surface()->CreateNewTextureID();
surface()->DrawSetTextureFile( currentId, texturename, false, true );
}
