DirectX SDK |
The D3DVIEWPORT7 structure defines the window dimensions of a render target surface onto which a 3-D volume projects. This structure is used with the IDirect3DDevice7::GetViewport and IDirect3DDevice7::SetViewport methods.
typedef struct _D3DVIEWPORT7{ DWORD dwX; DWORD dwY; DWORD dwWidth; DWORD dwHeight; D3DVALUE dvMinZ; D3DVALUE dvMaxZ; } D3DVIEWPORT7, *LPD3DVIEWPORT7
This structure, introduced in DirectX 7.0, supersedes the D3DVIEWPORT2 and D3DVIEWPORT structures used with previous versions of DirectX.
The dwX, dwY, dwWidth, and dwHeight members describe the position and dimensions of the viewport on the render target surface. Usually, applications render to the entire target surface; when rendering on a 640x480 surface, these members should be 0, 0, 640, and 480, respectively. The dvMinZ and dvMaxZ are typically set to 0.0 and 1.0 but can be set to other values to achieve specific effects. For example, you might set them both to 0.0 to force the system to render objects to the foreground of a scene, or both to 1.0 to force the objects into the background.
When the viewport parameters for a device change (due to a call to the IDirect3DDevice7::SetViewport method), the driver builds a new transformation matrix.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Version: Requires DirectX 7.0.
Header: Declared in d3dtypes.h.
D3DVALUE, IDirect3DDevice7::GetViewport, IDirect3DDevice7::SetViewport, Clipping Volumes, Viewports and Clipping