DrawGetTextureId: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
m (categorize)
Line 8: Line 8:
  }
  }
  surface()->[[DrawSetTextureFile]]( currentId, texturename, false, true );
  surface()->[[DrawSetTextureFile]]( currentId, texturename, false, true );
[[Category:ISurface]]

Revision as of 18:13, 9 May 2006

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 );