Platform SDK: DirectX |
The D3DVIEWPORT7 type defines the window dimensions of a render target surface that a 3-D volume projects onto. This type is used with the Direct3DDevice7.GetViewport and Direct3DDevice7.SetViewport methods.
Type D3DVIEWPORT7 lHeight As Long lWidth As Long lX As Long lY As Long maxz As Single minz As Single End Type
The lX, lY, lHeight and lWidth members describe the position and dimensions of the viewport on the render target surface. Usually, applications render to the entire target surface; when rendering to a 640x480 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 ranges 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 (by calling Direct3DDevice7.SetViewport), the driver builds a new transformation matrix.
Direct3DDevice7.GetViewport, Direct3DDevice7.SetViewport, Clipping Volumes, Viewports and Clipping