CreateNewTextureID
From Valve Developer Community
| ← Back to DrawGetTextureId | Return to ISurface | Continue to DrawSetTextureFile → |
[edit]
int ISurface::CreateNewTextureID( bool procedural = false )
Use this before DrawSetTextureFile or DrawSetTextureRGBA and after DrawGetTextureId to initialize a new texture ID.
[edit]
Sample
currentId = surface()->DrawGetTextureId( texturename ); if ( currentId == -1 ) { currentId = surface()->CreateNewTextureID(); surface()->DrawSetTextureFile( currentId, texturename, false, true ); }
