Rectangles

Throughout Microsoft Direct3D and Microsoft Windows programming, objects on the screen are referred to in terms of bounding rectangles. The sides of a bounding rectangle are always parallel to the sides of the screen. Managed code applications should use the RectangleLeave Site structure, in the System.DrawingLeave Site namespace, for storing rectangle information and when blitting to the screen or performing collision detection.

Most unmanaged C++ applications use the RECT Leave Site structure, which requires the (x,y) coordinates of the rectangle's upper-left and lower-right corners. A managed code application typically supplies RectangleLeave Site properties that indicate the (x,y) coordinates of the rectangle's upper-left corner, and its height and width, as shown in the following diagram.

Bounding rectangle within a display screen

In the interest of efficiency, consistency, and ease of use, all Direct3D presentation functions work with rectangles.