D3DVIEWPORT

The D3DVIEWPORT structure defines the visible 3-D volume and the 2-D screen area that a 3-D volume projects onto for the IDirect3DViewport3::GetViewport and IDirect3DViewport3::SetViewport methods.

For the IDirect3D2 and IDirect3DDevice2 interfaces, this structure has been superseded by the D3DVIEWPORT2 structure.

typedef struct _D3DVIEWPORT { 
    DWORD    dwSize; 
    DWORD    dwX; 
    DWORD    dwY; 
    DWORD    dwWidth; 
    DWORD    dwHeight; 
    D3DVALUE dvScaleX; 
    D3DVALUE dvScaleY; 
    D3DVALUE dvMaxX; 
    D3DVALUE dvMaxY; 
    D3DVALUE dvMinZ; 
    D3DVALUE dvMaxZ; 
} D3DVIEWPORT, *LPD3DVIEWPORT; 
 

Members

dwSize
Size of this structure, in bytes. This member must be initialized before the structure is used.
dwX and dwY
Coordinates of the top-left corner of the viewport.
dwWidth and dwHeight
Dimensions of the viewport.
dvScaleX and dvScaleY
Values of the D3DVALUE type describing how coordinates are scaled. The relevant coordinates here are the nonhomogeneous coordinates that result from the perspective division that projects the vertices onto the w=1 plane.
dvMaxX, dvMaxY, dvMinZ, and dvMaxZ
Values of the D3DVALUE type describing the maximum and minimum nonhomogeneous coordinates of x, y, and z. Again, the relevant coordinates are the nonhomogeneous coordinates that result from the perspective division.

Remarks

When the viewport is changed, the driver builds a new transformation matrix.

The coordinates and dimensions of the viewport are given relative to the top left of the device.

QuickInfo

  Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in d3dtypes.h.

See Also

D3DVALUE, IDirect3DViewport3::GetViewport, IDirect3DViewport3::SetViewport