DrawSetTextureFile: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
 
m (moved code)
Line 10: Line 10:
  {
  {
  currentId = surface()->[[CreateNewTextureID]]();
  currentId = surface()->[[CreateNewTextureID]]();
surface()->'''DrawSetTextureFile'''( currentId, texturename, false, true );
  }
  }
surface()->'''DrawSetTextureFile'''( currentId, texturename, false, true );
==See Also==
==See Also==
* [[DrawSetTextureRGBA]]
* [[DrawSetTextureRGBA]]
[[Category:ISurface]]
[[Category:ISurface]]

Revision as of 21:27, 12 May 2006

CreateNewTextureID Return to ISurface

void DrawSetTextureFile(int id, const char *filename, int hardwareFilter, bool forceReload)

Use after CreateNewTextureID to set the material referenced by a specified ID.

int hardwareFilter
This integer has no effect on the ID produced.
bool forceReload
This boolean tells ISurface to reload the material if it's already contained in the specified ID. If the material isn't in the specified ID, it will load the material no matter what forceReload is set to.

Sample

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

See Also