Platform SDK: DirectX

IDirect3DDevice7

The IDirect3DDevice7 interface provides methods enabling applications to perform DrawPrimitive-based rendering, in contrast to the IDirect3DDevice interface, which applications use to work with execute buffers. You can create a Direct3DDevice object and retrieve a pointer to this interface by calling the IDirect3D7::CreateDevice method.

For a conceptual overview, see Direct3D Devices and the DrawPrimitive Methods.

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

Information GetCaps
  GetDirect3D
GetInfo
Device states ApplyStateBlock
  BeginStateBlock
CaptureStateBlock
CreateStateBlock
DeleteStateBlock
EndStateBlock
GetClipStatus
GetRenderState
GetRenderTarget
GetStateData
GetTransform
SetClipStatus
SetRenderState
SetRenderTarget
SetStateData
SetTransform
Lighting and materials GetLight
  GetLightEnable
GetMaterial
LightEnable
SetLight
SetMaterial
Miscellaneous ComputeSphereVisibility
  MultiplyTransform
Rendering DrawIndexedPrimitive
  DrawIndexedPrimitiveStrided
DrawIndexedPrimitiveVB
DrawPrimitive
DrawPrimitiveStrided
DrawPrimitiveVB
Scenes BeginScene
  EndScene
Textures EnumTextureFormats
  GetTexture
GetTextureStageState
Load
PreLoad
SetTexture
SetTextureStageState
ValidateDevice
User-defined clip planes GetClipPlane
  SetClipPlane
Viewports Clear
  GetViewport
SetViewport

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

IUnknown AddRef
  QueryInterface
Release

This interface extends the IDirect3DDevice3 interface by including methods for device-state blocks. Device-state blocks accelerate the common sequences of state changes that your application requires. In addition, the IDirect3DDevice7 interface includes methods to work with viewports, lights, and materials within the device that supersede the IDirect3DViewport3, IDirect3DMaterial3, and IDirect3DLight interfaces.

Many of the methods common to this interface and its predecessor, IDirect3DDevice3, accept slightly different parameters. Wherever an IDirect3DDevice3 interface method might accept an IDirectDrawSurface3 interface pointer as a parameter, the methods in the IDirect3DDevice7 interface accept an IDirectDrawSurface7 interface pointer instead. Methods that previously accepted pointers to an IDirect3DVertexBuffer or IDirect3DTexture2 interface now accept IDirect3DVertexBuffer7 or IDirectDrawSurface7 interface pointers instead. The methods for viewports, materials, and lighting that were added to the interface accept pointers to new structures, as described in the reference page for each new method.

This interface is not intended to be used with execute buffers and therefore does not contain any execute-buffer-related methods. For information about execute buffers, see the documentation provided with a previous release of DirectX. Legacy documentation is provided with this SDK and available for download from http://www.microsoft.com/directx.

You can use the LPDIRECT3DDEVICE2, LPDIRECT3DDEVICE3, or LPDIRECT3DDEVICE7 data types to declare a variable that contains a pointer to an IDirect3DDevice2, IDirect3DDevice3, or IDirect3DDevice7 interface. The D3d.h header file declares these data types with the following code:

typedef struct IDirect3DDevice2    *LPDIRECT3DDEVICE2;
typedef struct IDirect3DDevice3    *LPDIRECT3DDEVICE3;
typedef struct IDirect3DDevice7    *LPDIRECT3DDEVICE7;

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Version: Requires DirectX 7.0.
  Header: Declared in d3d.h.

See Also

Direct3D Devices, Rendering