IDirect3DDevice2

The IDirect3DDevice2 interface helps applications work with the DrawPrimitive methods; this is in contrast to the IDirect3DDevice interface, which applications use to work with execute buffers. You can create a Direct3DDevice2 object by calling the IDirect3D2::CreateDevice method.

For a conceptual overview, see Devices and The DrawPrimitive Methods.

The methods of the IDirect3DDevice2 interface can be organized into the following groups:

Information EnumTextureFormats
GetCaps
GetDirect3D
GetStats
Miscellaneous MultiplyTransform
SwapTextureHandles
Getting and Setting States GetClipStatus
GetCurrentViewport
GetLightState
GetRenderState
GetRenderTarget
GetTransform
SetClipStatus
SetCurrentViewport
SetLightState
SetRenderState
SetRenderTarget
SetTransform
Rendering Begin
BeginIndexed
DrawIndexedPrimitive
DrawPrimitive
End
Index
Vertex
Scenes BeginScene
EndScene
Viewports AddViewport
DeleteViewport
NextViewport

The IDirect3DDevice2 interface, like all COM interfaces, inherits the IUnknown interface methods. The IUnknown interface supports the following three methods:

AddRef
QueryInterface
Release

The IDirect3DDevice2 interface is not intended to be used with execute buffers. If you need to use some of the methods in the IDirect3DDevice interface that are not supported in IDirect3DDevice2, you can call IDirect3DDevice2::QueryInterface to retrieve a pointer to an IDirect3DDevice interface. The following methods from the IDirect3DDevice interface are not supported by IDirect3DDevice2:

IDirect3DDevice::CreateExecuteBuffer
IDirect3DDevice::CreateMatrix
IDirect3DDevice::DeleteMatrix
IDirect3DDevice::Execute
IDirect3DDevice::GetMatrix
IDirect3DDevice::GetPickRecords
IDirect3DDevice::Initialize
IDirect3DDevice::Pick
IDirect3DDevice::SetMatrix

The LPDIRECT3DDEVICE2 type is defined as a pointer to the IDirect3DDevice2 interface:

typedef struct IDirect3DDevice2    *LPDIRECT3DDEVICE2;