Compartilhar via


D3DMMATERIALCOLORSOURCE

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This enumeration provides values that describe material colors for render states.

Syntax

typedef enum _D3DMMATERIALCOLORSOURCE {
  D3DMMCS_MATERIAL    = 0,
  D3DMMCS_COLOR1      = 1,
  D3DMMCS_COLOR2      = 2,
  D3DMMCS_FORCE_ULONG = 0x7fffffff,
} D3DMMATERIALCOLORSOURCE;

Elements

  • D3DMMCS_MATERIAL
    Indicates that the material color is taken from the current material.
  • D3DMMCS_COLOR1
    Indicates that the material color is taken from the vertex's diffuse color.
  • D3DMMCS_COLOR2
    Indicates that the material color is taken from the vertex's specular color.
  • D3DMMCS_FORCE_ULONG
    Forces the compiler to interpret the enumeration as a ULONG value. This value is not used directly in Direct3D Mobile programming.

Remarks

The following list shows render states that specify the color source for lighting calculations. For more information, see D3DMRENDERSTATETYPE.

  • D3DMRS_DIFFUSEMATERIALSOURCE
  • D3DMRS_SPECULARMATERIALSOURCE
  • D3DMRS_AMBIENTMATERIALSOURCE

If a material color source is specified for one of these render state but the FVF for a vertex does not contain a flag corresponding to that color source, then the corresponding value for the material is used instead.

For example, if D3DMRS_AMBIENTMATERIALSOURCE is set to D3DMMCS_COLOR1, but D3DMFVF_DIFFUSE does not exist in the vertex FVF, D3DMMATERIAL.Ambient is used instead.

Requirements

Header d3dmtypes.h
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

Direct3D Mobile Enumerations
D3DMRENDERSTATETYPE