N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential





gDPSetScissor [macro]

Specifies the drawing region (scissoring box) 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 is the pointer to the display list.

  • mode is the 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 is the screen's left edge coordinates (0.0~1023.75).

  • uly is the screen's top edge coordinates (0.0~1023.75).

  • lrx is the screen's right edge coordinates (0.0~1023.75).

  • lry is the screen's bottom edge coordinates (0.0~1023.75)

Explanation
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.

Notes
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.

Cautions
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 Online Programming Manual.

See Also
gDPFillRectangle
gDPScisFillRectangle"
gSPClipRatio
gSPTextureRectangle
gSPViewport

Revision History
2/1/99 Completely rewritten.




Nintendo® Confidential

Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.


Copyright © 1998-1999
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last Updated April, 1999