IDirect3D3::CreateMaterial

The IDirect3D3::CreateMaterial method allocates a Direct3DMaterial3 object.

HRESULT CreateMaterial(
  LPDIRECT3DMATERIAL3* lplpDirect3DMaterial,  
  IUnknown* pUnkOuter                         
);
 

Parameters

lplpDirect3DMaterial
Address that will be filled with a pointer to an IDirect3DMaterial3 interface if the call succeeds.
pUnkOuter
This parameter is provided for future compatibility with COM aggregation features. Currently, however, CreateMaterial returns an error if this parameter is anything but NULL.

Return Values

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value is an error. For a list of possible return codes, see Direct3D Immediate Mode Return Values.

Remarks

In the IDirect3D2 interface, this method retrieves a pointer to an IDirect3DMaterial2 interface, not an IDirect3DMaterial3 interface.

QuickInfo

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in d3d.h.
  Import Library: Use ddraw.lib.

See Also

Materials, Lighting and Materials