Table of Contents Glide Programming Guide



Download 6.22 Mb.
Page24/106
Date03.02.2023
Size6.22 Mb.
#60547
1   ...   20   21   22   23   24   25   26   27   ...   106
GLIDEPGM

3Clipping


The Voodoo Graphics hardware supports per-pixel clipping to an arbitrary rectangle defined with the Glide function grClipWindow(). Any pixels outside the clipping window are rejected. Values are inclusive for minimum x and y values and exclusive for maximum x and y values, as shown in Figure Rendering Primitives.1. The clipping window also specifies the area grBufferClear() will clear. (See Chapter Chapter 3. .)
Figure Rendering Primitives.1 Specifying a clipping window.
The clipping window is defined by two pairs of integers in the range [0..1024) specifying the left and right edges and the top and bottom edges of the rectangle.

The grClipWindow() routine has four parameters that define the clipping rectangle. The values must be less than or equal to the current screen resolution and greater than or equal to 0; otherwise, they will be ignored. Glide does not perform any geometric clipping outside of supporting a hardware clipping window. For optimal performance, an application should perform proper geometric clipping before passing any primitives to Glide. The clipping window should not be used in place of true geometric clipping.


void grClipWindow( FxU32 minX, FxU32 minY, FxU32 maxX, FxU32 maxY )

The default values for the clip window are the full size of the screen: (0,0,640,480) for 640´480 mode and (0,0,800,600) for 800´600 mode. To disable clipping, simply set the size of the clip window to the screen size. The Voodoo Graphics subsystem’s clipping window should not be used for general purpose primitive clipping; since clipped pixels are processed but discarded, proper geometric clipping should be done by the application for best performance. The Voodoo Graphics subsystem’s clip window should be used to prevent stray pixels that appear from imprecise geometric clipping. Note that if pixel pipeline is disabled, clipping is not performed on linear frame buffer writes (see Chapter Chapter 11. for more information).



Download 6.22 Mb.

Share with your friends:
1   ...   20   21   22   23   24   25   26   27   ...   106




The database is protected by copyright ©ininet.org 2024
send message

    Main page