DrawGetTextureId

From Valve Developer Community
Revision as of 18:23, 9 May 2006 by Ts2do (talk | contribs) (bold)
Jump to navigation Jump to search
Return to ISurface ISurface

int DrawGetTextureId( char const *filename )

Use this function before CreateNewTextureID to make sure you don't reference the same material with multiple texture IDs.

Sample

currentId = surface()->DrawGetTextureId( texturename );
if ( currentId == -1 )
{
	currentId = surface()->CreateNewTextureID();
}
surface()->DrawSetTextureFile( currentId, texturename, false, true );