![]() |
![]() |
![]() |
Device.Viewport Property |
Language: |
Retrieves or sets the viewport parameters for the current device.
Visual Basic .NET Public Property Viewport As Viewport C# public Viewport Viewport { get; set; } Managed C++ public: __property Viewport get_Viewport();
public: __property void set_Viewport(Viewport);JScript .NET public function get Viewport() : Viewport
public function set Viewport(Viewport);
Microsoft.DirectX.Direct3D.Viewport . A Viewport object that represents the returned viewport parameters or specifies the viewport parameters to set.
This property is read/write.
Device.Viewport can be used to draw on part of the screen. It should be set before any geometry is drawn so the Viewport will take effect.
To draw multiple views within a scene, repeat setting Device.Viewport and draw a geometry sequence for each view.
Exceptions
InvalidCallException Occurs if Viewport is invalid, or if Viewport describes a region that cannot exist within the render target surface.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center