DrawGetTextureId

From Valve Developer Community
Revision as of 18:10, 9 May 2006 by Ts2do (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

int DrawGetTextureId( char const *filename )

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

Sample

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