Microsoft DirectX 8.1 (C++)

IDirect3DDevice8::GetDirect3D

Returns an interface to the instance of the Microsoft® Direct3D® object that created the device.

HRESULT GetDirect3D(
  IDirect3D8** ppD3D8
);

Parameters

ppD3D8
[out, retval] Address of a pointer to an IDirect3D8 interface, representing the interface of the Direct3D object that created the device.

Return Values

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be D3DERR_INVALIDCALL.

Remarks

Calling GetDirect3D increases the reference count on the interface, so applications should call IUnknown::Release through this pointer when finished with the interface.

Note  Calling this method will increase the internal reference count on the IDirect3D8 interface. Failure to call IUnknown::Release when finished using this IDirect3D8 interface results in a memory leak.

Requirements

  Header: Declared in D3d8.h.
  Import Library: Use D3d8.lib.