C3DMesh::LoadTexture

Top  Previous  Next

Syntax:

 

LoadTexture(int  texNum, string  filename, UINT  clr)

 

Purpose:

Loads and applies a texture from an image file.

 

Parameters:

texNum - Texture number for 0 to 7.

filename- Filename or resource name.

clr- Transparency color key.

 

Returned value(s):

 

Application:

mesh1.LoadTexture(0,GETSTARTPATH+"tile3.tga",0)

 

Class Hierarchy

C3DObject

-------C3DMesh

 

Additional Info:

The 3D engine supports up to 8 textures per mesh.  The clr parameter can be set to 0 to disable transparency for the texture, otherwise use the RGBA function to specify the transparency color. Alpha is significant and should usually be set to FF (255) for opaque color keys. Thus, for opaque black, the value would be equal to RGBA(0,0,0,255).

 

The texture engine will try an load from your programs resources first, and then try to load from a file if that fails.

 

The memory associated with the texture is automatically freed when the C3DMesh class is destroyed or goes out of scope.