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

## gDPSetPrimColor [macro]

Sets the primitive color.

Syntax

    #include <ultra64.h> /* gbi.h */
    gDPSetPrimColor(Gfx *gdl, u32 m, u32 l, u32 r, u32 g, u32 b, u32 a)
    gsDSetPrimColor(u32 m, u32 l, u32 r, u32 g, u32 b, u32 a)

Arguments

- gdl is the display list pointer.

- m is the minimum value when LOD is less than 1.0 (.8, 0~255 texel/pixel ratio).

- l is the LOD factor for interpolation of third axis (.8, 0~255).

- r is the red component of RGBA color (8-bit precision, 0~255).

- g is the green component of RGBA color (8-bit precision, 0~255).

- b is the blue component of RGBA color (8-bit precision, 0~255).

- a is the alpha component of RGBA color (8-bit precision, 0~255).

Explanation
Sets the RDP's primitive color, which is used as an input source by the color combiner (CC). The primitive color register set by this macro becomes a general-purpose color register of the CC, expressing the constant flat-shaded surface color applied by the primitive. It is also used for rendering specular highlights. The contents of the primitive color register determine the highlight color. In 2-cycle mode, they indicates the color of the first specular highlight (Hilite1). Furthermore, m and l are used for trilinear interpolation in the MIP-mapping process.

For details, please see Section 12.6.2, "CC Internal Color Registers," in the N64 Programming Manual. For information about LOD, see Section 13.7.3 "LOD Enabled" and Section 14.4.3, "Shrinking Sprites."

Cautions
Normally you need to insert gDPPipeSync immediately after the RDP registers are changed in order to gain synchronization (to wait for the completion of the previous primitive process). However, this macro does not require such synchronization.

See Also
gDPFillRectangle
gDPSetAlphaCompare
gDPSetCombineMode
gDPSetCycleType
gDPSetRenderMode

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