DrawGetTextureId: Difference between revisions
Jump to navigation
Jump to search
m (navbar) |
m (bold) |
||
Line 1: | Line 1: | ||
{{navbar|ISurface|ISurface|CreateNewTextureID}} | {{navbar-first|ISurface|ISurface|CreateNewTextureID}} | ||
=int DrawGetTextureId( char const *filename )= | =int '''DrawGetTextureId'''( char const *filename )= | ||
Use this function before [[CreateNewTextureID]] to make sure you don't reference the same material with multiple texture IDs. | Use this function before [[CreateNewTextureID]] to make sure you don't reference the same material with multiple texture IDs. | ||
==Sample== | ==Sample== |
Revision as of 18:23, 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 );