Applications use the methods of the IDirect3DRMMaterial interface to interact with material objects. This section is a reference to the methods of this interface. For a conceptual overview, see IDirect3DRMMaterial Interface.
The methods of the IDirect3DRMMaterial interface can be organized into the following groups:
| Emission | GetEmissive |
| SetEmissive | |
| Power for | GetPower |
| specular exponent | SetPower |
| Specular | GetSpecular |
| SetSpecular | |
The IDirect3DRMMaterial interface, like all Component Object Model (COM) interfaces, inherits the IUnknown interface methods. The IUnknown interface supports the following three methods:
| AddRef |
| QueryInterface |
| Release |
In addition, the IDirect3DRMMaterial interface inherits the following methods from the IDirect3DRMObject interface:
| AddDestroyCallback |
| Clone |
| DeleteDestroyCallback |
| GetAppData |
| GetClassName |
| GetName |
| SetAppData |
| SetName |
The Direct3DRMMaterial object is obtained by using the IDirect3DRM::CreateMaterial method.
Retrieves the setting for the emissive property of a material. The setting of this property is the color and intensity of the light the object emits.
HRESULT GetEmissive(
D3DVALUE *lpr,
D3DVALUE *lpg,
D3DVALUE *lpb
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMMaterial::SetEmissive
Retrieves the power used for the specular exponent in the given material.
D3DVALUE GetPower( );
Returns the value specifying the power of the specular exponent.
Retrieves the color of the specular highlights of a material.
HRESULT GetSpecular(
D3DVALUE *lpr,
D3DVALUE *lpg,
D3DVALUE *lpb
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMMaterial::SetSpecular
Sets the emissive property of a material.
HRESULT SetEmissive(
D3DVALUE r,
D3DVALUE g,
D3DVALUE b
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method is also used to add an emissive property key to a Direct3DRMMaterialInterpolator object.
IDirect3DRMMaterial::GetEmissive
Sets the power used for the specular exponent in a material.
HRESULT SetPower(
D3DVALUE rvPower
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method is also used to add a spectral power key to a Direct3DRMMaterialInterpolator object.
Sets the color of the specular highlights for a material.
HRESULT SetSpecular(
D3DVALUE r,
D3DVALUE g,
D3DVALUE b
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method is also used to add a spectral color key to a Direct3DRMMaterialInterpolator object.
IDirect3DRMMaterial::GetSpecular
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.