Direct3D Retained Mode Animated Header --IDirect3DRMMaterial Direct3D Retained Mode Animated Header --IDirect3DRMMaterial * Microsoft Direct3D Retained Mode SDK
*Index  *Topic Contents
*Previous Topic: IDirect3DRMLight
*Next Topic: IDirect3DRMMesh

IDirect3DRMMaterial


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.


IDirect3DRMMaterial::GetEmissive

IDirect3DRMMaterial

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
  );

Parameters
lpr, lpg, and lpb
Addresses that will contain the red, green, and blue components of the emissive color when the method returns.
Return Values

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

See Also

IDirect3DRMMaterial::SetEmissive


IDirect3DRMMaterial::GetPower

IDirect3DRMMaterial

Retrieves the power used for the specular exponent in the given material.

D3DVALUE GetPower( );

Return Values

Returns the value specifying the power of the specular exponent.

See Also

IDirect3DRMMaterial::SetPower


IDirect3DRMMaterial::GetSpecular

IDirect3DRMMaterial

Retrieves the color of the specular highlights of a material.

HRESULT GetSpecular(
  D3DVALUE *lpr,
  D3DVALUE *lpg,
  D3DVALUE *lpb
  );

Parameters
lpr, lpg, and lpb
Addresses that will contain the red, green, and blue components of the color of the specular highlights when the method returns.
Return Values

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

See Also

IDirect3DRMMaterial::SetSpecular


IDirect3DRMMaterial::SetEmissive

IDirect3DRMMaterial

Sets the emissive property of a material.

HRESULT SetEmissive(
  D3DVALUE r,
  D3DVALUE g,
  D3DVALUE b
  );

Parameters
r, g, and b
Red, green, and blue components of the emissive color.
Return Values

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

This method is also used to add an emissive property key to a Direct3DRMMaterialInterpolator object.

See Also

IDirect3DRMMaterial::GetEmissive


IDirect3DRMMaterial::SetPower

IDirect3DRMMaterial

Sets the power used for the specular exponent in a material.

HRESULT SetPower(
  D3DVALUE rvPower
  );

Parameters
rvPower
New specular exponent.
Return Values

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

This method is also used to add a spectral power key to a Direct3DRMMaterialInterpolator object.

See Also

IDirect3DRMMaterial::GetPower


IDirect3DRMMaterial::SetSpecular

IDirect3DRMMaterial

Sets the color of the specular highlights for a material.

HRESULT SetSpecular(
  D3DVALUE r,
  D3DVALUE g,
  D3DVALUE b
  );

Parameters
r, g, and b
Red, green, and blue components of the color of the specular highlights.
Return Values

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

This method is also used to add a spectral color key to a Direct3DRMMaterialInterpolator object.

See Also

IDirect3DRMMaterial::GetSpecular

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.

*Top of Page