CreateNewTextureID

From Valve Developer Community
Jump to: navigation, search



ISurface
DrawGetTextureId
DrawSetTextureFile


int ISurface::CreateNewTextureID( bool procedural = false )

Use this before DrawSetTextureFile or DrawSetTextureRGBA and after DrawGetTextureId to initialize a new texture ID.

Sample

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