Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

You retrieve the material properties that the rendering device is currently using by calling the IDirect3DMobileDevice::GetMaterialmethod for the device. Unlike the IDirect3DMobileDevice::SetMaterialmethod, GetMaterialdoes not require preparation. The GetMaterialmethod accepts the address of a D3DMMATERIALstructure and fills the provided structure with information describing the current material properties before returning.

Copy Code
// For this example, the pd3dmDev variable is assumed to 
// be a valid pointer to an IDirect3DMobileDevice interface.
HRESULT hr;
D3DMMATERIAL mat;

hr = pd3dmDev->GetMaterial(&mat);
if(FAILED(hr))
{
	// Code to handle the error goes here.
}

See Also

Concepts

Materials