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

Format
#include "gbi.h"

gDPSetScissor(Gfx *gdl,
   unsigned int mode,
   unsigned int ulx,
   unsigned int uly,
   unsigned int lrx,
   unsigned int lry )

gsDPSetScissor(unsigned int mode,
   unsigned int ulx,
   unsigned int uly,
   unsigned int lrx,
   unsigned int lry )
Arguments
  • gdl is the pointer to the graphics display list
  • mode is the interlace mode (G_SC_NON_INTERLACE, G_SC_ODD_INTERLACE, or G_SC_EVEN_INTERLACE)
  • ulx, uly specify the screen coordinates for the upper-left corner
  • lrx, lry specify the screen coordinates for the lower-right corner
What This Macro Does
It sets the scissor box, which eliminates pixels drawn outside of the box region, in screen coordinates.

The RSP graphics microcode performs fixed-point precision clipping that can result in small precision errors, causing primitives to be slightly off of the viewport rectangle. A typical application would set the viewport region slightly larger than the scissor region in order to eliminate these artifacts.

Scissoring can also be used to eliminate a majority of the clipping computation all together. You can tell the RSP to clip in a region larger than visible screen, in which case the off screen pixels must be scissored (which is often faster).

This macro also eliminates scanlines when rendering in interlaced video mode. In non-interlaced mode, all scanlines are drawn. In interlaced mode, the application can specify whether even or odd scanlines are eliminated. This allows a single framebuffer to be used to store the images for the two fields of an interlaced display mode.

Note
Scissoring only works for one- and two-cycle types. The scissor box must be larger than or equal to the rectangle region in fill or copy mode.

See Also
gSPViewport
gSPClipRatio
gDPFillRectangle
gSPTextureRectangle



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
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated January 1998