Microsoft DirectX 8.1 (Visual Basic)

D3DVIEWPORT8

Defines the window dimensions of a render target surface onto which a 3-D volume projects.

Type D3DVIEWPORT8
    MaxZ As Single
    MinZ As Single
    Height As Long
    Width As Long
    x As Long
    y As Long
End Type

Members

MaxZ and MinZ
Values describing the range of depth values into which a scene is to be rendered, the minimum and maximum values of the clip volume. Most applications set these values to 0.0 and 1.0, respectively. Clipping is performed after applying the projection matrix.
Height and Width
Dimensions of the viewport on the render target surface, in pixels. Unless you are rendering only to a subset of the surface, these members should be set to the dimensions of the render target surface.
x and y
Pixel coordinates of the upper-left corner of the viewport on the render target surface. Unless you want to render to a subset of the surface, these members can be set to 0.

Remarks

The x, y, Width, and Height 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 640×480 surface, these members should be 0, 0, 640, and 480, respectively. The MinZ and MaxZ 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 Direct3DDevice8.SetViewport method), the driver builds a new transformation matrix.

See Also

Direct3DDevice8.GetViewport, Direct3DDevice8.SetViewport