DrawGetTextureId

From Valve Developer Community
Revision as of 02:32, 29 June 2006 by Ts2do (talk | contribs) (added class)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Return to ISurface CreateNewTextureID

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.

Sample

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