The D3DMATERIAL structure specifies material properties in calls to the IDirect3DMaterial2::GetMaterial and IDirect3DMaterial2::SetMaterial methods.
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;
The texture handle specified by the hTexture member 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.
To turn off specular highlights for a material, you must set the dvPower member to 0—simply setting the specular color components to 0 is not enough.
Windows NT: Use version 4.0 or later.
Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Header: Declared in d3dtypes.h.
IDirect3DMaterial2::GetMaterial, IDirect3DMaterial2::SetMaterial