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

   

SetImage Functions

Format
#include "gbi.h"

gDPSetColorImage(Gfx *gdl,
   int fmt, int siz,
   int width, int img)
gsDPSetColorImage(int fmt,
   int siz, int width,
   int img)

gDPSetDepthImage(Gfx *gdl, int img)
gsDPSetDepthImage(int img)

gDPSetTextureImage(Gfx *gdl, int fmt,
   int siz, int width, int img)
gsDPSetTextureImage(int fmt, int siz,
   int width, int img)
Arguments
  • gdl is the pointer to the graphics display list
  • fmt is the image format (G_IM_FMT_RGBA, G_IM_FMT_YUV, G_IM_FMT_CI, G_IM_FMT_IA, G_IM_FMT_I)
  • siz is the pixel element size (G_IM_SIZ_4b, G_IM_SIZ_8b, G_IM_SIZ_16b, G_IM_SIZ_32b)
  • width is the image width in number of pixel elements
  • img is the image pointer
What These Macros Do
These macros set the framebuffer area for color, depth, and texture images. An application typically has two color frame buffers for double buffering; they are swapped during the vertical retrace interval.

If Z-Buffering is enabled, the application should use the gDPSetDepthImage macro to set up the Z-Buffer area. The width parameter is not needed for gDPSetDepthImage because the RDP assumes the width is the same as the color buffer. The siz parameter is not needed for gDPSetDepthImage because the depth-buffer is always G_IM_SIZ_16b.

The gDPSetTextureImage macro is used to point to different textures. This macro is usually not used directly, it is embedded in the appropriate gDPLoadTexture macros.

The gDPSetDepthImage and gDPSetColorImage macros require a 64-BYTE aligned address.

Following are the descriptions for each of the format and size argument elements:
  • G_IM_FMT_RGBA is RGBA format. Red is always packed toward the MSB.
  • G_IM_FMT_YUV is YUV format.
  • G_IM_FMT_CI is color-indexed format.
  • G_IM_FMT_IA is intensity and Alpha format.
  • G_IM_FMT_I is intensity format.
  • G_IM_SIZ_4b is 4 bits per pixel element. Use only for G_IM_FMT_I.
  • G_IM_SIZ_8b is 8 bits per pixel element. Use for G_IM_FMT_CI, G_IM_FMT_I, and G_IM_FMT_IA (4b for each component).
  • G_IM_SIZ_16b is 16 bits per pixel element. Use for G_IM_FMT_RGBA (5/5/5/1), G_IM_FMT_MASK, G_IM_FMT_IA (8b each component).
  • G_IM_SIZ_32b is 32 bits per pixel element.



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