Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.SetViewport

Sets the viewport parameters for the device.

object.SetViewport( _ 
    Viewport As D3DVIEWPORT8)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
Viewport
A D3DVIEWPORT8 type, specifying the viewport parameters to set.

Error Codes

If the method fails, an error is raised and Err.Number may be set to D3DERR_INVALIDCALL to indicate that the Viewport parameter is invalid.

If the viewport parameters described by the D3DVIEWPORT8 type describe a region that cannot exist within the render target surface, the method fails, returning D3DERR_INVALIDCALL.

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

Any call to SetViewPort between a pair of calls to Direct3DDevice8.BeginScene and Direct3DDevice8.EndScene must be made before any geometry is drawn.

See Also

Direct3DDevice8.GetViewport