DrawGetTextureId: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
| mNo edit summary | m (added class) | ||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
| {{navbar-first|ISurface|CreateNewTextureID}} | {{navbar-first|ISurface|CreateNewTextureID}} | ||
| =int '''DrawGetTextureId'''( char const *filename )= | =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. | Use this function before [[CreateNewTextureID]] to make sure you don't reference the same material with multiple texture IDs. | ||
| ==Sample== | ==Sample== | ||
| Line 7: | Line 7: | ||
|   { |   { | ||
|   	currentId = surface()->[[CreateNewTextureID]](); |   	currentId = surface()->[[CreateNewTextureID]](); | ||
|  	surface()->[[DrawSetTextureFile]]( currentId, texturename, false, true ); | |||
|   } |   } | ||
| [[Category:ISurface]] | [[Category:ISurface]] | ||
Latest revision as of 19:32, 28 June 2006
| 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 );
}