D3DMVIEWPORT
A version of this page is also available for
4/8/2010
This structure is used to describe the area of the render target, the viewport, that will be rasterized to. It is also used to set the depth range that will be passed into the rasterizer.
Syntax
typedef struct _D3DMVIEWPORT {
ULONG X;
ULONG Y;
ULONG Width;
ULONG Height;
float MinZ;
float MaxZ;
} D3DMVIEWPORT;
Members
- X
A ULONG value identifying the X pixel coordinate of the viewport's upper left corner.
- Y
A ULONG value identifying the Y pixel coordinate of the viewport's upper left corner.
- Width
A ULONG value identifying the width of the viewport in pixels.
- Height
A ULONG value identifying the height of the viewport in pixels.
- MinZ
A float value identifying the minimum value of the clipping volume, see Remarks.
- MaxZ
A float value identifying the maximum value of the clipping volume, see Remarks.
Remarks
The viewport transformation assumes that all vertices have been clipped such that their Z values fall between the values 0.0 and 1.0, where 0.0 is the near clipping plane and 1.0 is the far clipping plane. The values of the MinZ and MaxZ members can be used to construct a scalar that is applied to all Z values to rescale them. This could be used, for example, to render all incoming primitives into only the back half of the depth buffer by setting MinZ = 0.5 and MaxZ = 1.0.
After the viewport transformation is complete, screen coordinates for the vertex are generated by dividing all coordinate values by homogenous screen space W, and replacing W with 1/W. This coordinate set is then passed to the rasterizer.
Requirements
Header | d3dmtypes.h |
Windows Embedded CE | Windows CE 5.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |