IDirect3DViewport2

Applications use the methods of the IDirect3DViewport2 interface to retrieve and set the properties of viewports. This section is a reference to the methods of this interface. For a conceptual overview, see Viewports and Transformations.

The IDirect3DViewport2 interface is an extension of the IDirect3DViewport interface. You create the IDirect3DViewport2 interface by calling the IDirect3D2::CreateViewport method.

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

Backgrounds GetBackground
GetBackgroundDepth
SetBackground
SetBackgroundDepth
Lights AddLight
DeleteLight
LightElements
NextLight
Materials and viewports Clear
GetViewport
GetViewport2
SetViewport
SetViewport2
Transformation TransformVertices

IDirect3DViewport2 is identical to IDirect3DViewport except for two new methods: GetViewport2 and SetViewport2. The IDirect3DViewport2 interface differs from the IDirect3DViewport interface primarily in its use of the D3DVIEWPORT2 structure. This structure introduces a closer correspondence between window size and viewport size than is true for the D3DVIEWPORT structure.

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

AddRef
QueryInterface
Release

The LPDIRECT3DVIEWPORT2 and LPDIRECT3DVIEWPORT types are defined as pointers to the IDirect3DViewport2 and IDirect3DViewport interfaces:

typedef struct IDirect3DViewport2    *LPDIRECT3DVIEWPORT2;
typedef struct IDirect3DViewport     *LPDIRECT3DVIEWPORT;