gDPSetScissor [Macro]

Function

gDPSetScissor

Specifies the drawing region (scissoring) in screen coordinates

Syntax

#include <ultra64.h>        /* gbi.h */
gDPSetScissor(Gfx *gdl, u32 mode, f32 ulx, f32 uly, f32 lrx, f32 lry )
gsDPSetScissor(         u32 mode, f32 ulx, f32 uly, f32 lrx, f32 lry )

Arguments

gdl
Display list pointer
mode
Video mode:

Interlace mode
G_SC_NON_INTERLACE Draw all scan lines
G_SC_ODD_INTERLACE Draw only odd-numbered scan lines
G_SC_EVEN_INTERLACE Draw only even-numbered scan lines

ulx
Screen's left edge coordinates (0.0~1023.75)
uly
Screen's top edge coordinates (0.0~1023.75)
lrx
Screen's right edge coordinates (0.0~1023.75)
lry
Screen's bottom edge coordinates (0.0~1023.75)

Description

Specifies the drawing area (the scissoring box). All pixels drawn outside the specified region are deleted.

Scissoring can be used to eliminate the majority of clipping computations. When instructions are sent to the RDP to clip in a region larger than the visible screen, the process is speeded up (in most cases) by using scissoring to delete pixels that are off the screen.

Note

The scissoring of rectangles has some limitations. In 1-cycle mode and 2-cycle mode, rectangles are scissored just like triangles. In FILL mode and COPY mode, rectangles are scissored to the nearest 4-pixel alignment, so scissoring might also be required on the game software screen.

Comment

The RSP graphics microcode executes low-error fixed-point clipping on primitives a little bit inside the viewport region. For this reason, the viewport region is typically set a little bigger than the scissoring box in the application.

You can set the interlace mode in the mode argument to omit scan lines during rendering. When you specify G_SC_NON_INTERLACE for the mode, all scan lines are drawn. But if you set the mode to either G_SC_ODD_INTERLACE or G_SC_EVEN_INTERLACE the application will omit either even-number scan lines or odd-numbered scan lines. By doing this, only one frame buffer is needed to store an image, even when two fields are being displayed in interlace mode.

For details, see Section 12.3.1 "Scissoring" in the N64 Programming Manual.

See Also

gDPFillRectangle, gDPScisFillRectangle, gSPClipRatio, gSPTextureRectangle, gSPViewport

Revision History

02/01/99 Completely rewritten.