D3DMATERIAL

typedef struct _D3DMATERIAL {

DWORD dwSize;

union {

D3DCOLORVALUE diffuse;

D3DCOLORVALUE dcvDiffuse;

};

union {

D3DCOLORVALUE ambient;

D3DCOLORVALUE dcvAmbient;

};

union {

D3DCOLORVALUE specular;

D3DCOLORVALUE dcvSpecular;

};

union {

D3DCOLORVALUE emissive;

D3DCOLORVALUE dcvEmissive;

};

union {

D3DVALUE power;

D3DVALUE dvPower;

};

D3DTEXTUREHANDLE hTexture;

DWORD dwRampSize;

} D3DMATERIAL, *LPD3DMATERIAL;

Specifies material properties in calls to the IDirect3DMaterial::GetMaterial and IDirect3DMaterial::SetMaterial methods.

dwSize

Size, in bytes, of this structure.

dcvDiffuse, dcvAmbient, dcvSpecular, and dcvEmissive

Values specifying the diffuse color, ambient color, specular color, and emissive color of the material, respectively. These values are D3DCOLORVALUE structures.

dvPower

Value of the D3DVALUE type specifying the sharpness of specular highlights.

hTexture

Handle of the texture map.

dwRampSize

Size of the color ramp. For the monochromatic (ramp) driver, this value must be less than or equal to 1 for materials assigned to the background; otherwise, the background is not displayed. This behavior also occurs when a texture that is assigned to the background has an associated material whose dwRampSize member is greater than 1.

The texture handle is acquired from Direct3D by loading a texture into the device. The texture handle may be used only when it has been loaded into the device.