A texture rectangle is a special primitive supported by the Reality Display Processor (RDP) hardware. This primitive is intended to provide simple "sprite" capabilities with a minimum number of parameters. Texture rectangles are screen-aligned rectangles whose coordinates are defined directly in screen space.
Texture coordinates are defined by specifying the start point S and T coordinates at the top left corner of the rectangle and the step in S per pixel in X and the step in T per pixel in Y. Example 14-2 shows a rectangle 100 pixels wide by 100 pixels high drawn at screen coordinates (100,100). The texture coordinates at the top left corner of the rectangle are (0,0). The texture steps 1 texel per pixel in both the S and T directions. This example assumes that a texture has been previously loaded (see Section "13.9, Texture Loading").
gsDPSetTexturePersp(G_TP_NONE), gsSPTextureRectangle(100<<2,100<<2,200<<2,200<<2, G_TX_RENDERTILE, 0,0, 1<<10,1<<10),
Caution: The perspective divide of the texture coordinates in the RDP must be disabled using the gsDPSetTexturePersp() command when rendering texture rectangles.
Texture rectangles are two-dimensional (2D)-- they may be translated in X and Y, but not rotated. Texture rectangles may be Z buffered in a limited way, as described in Section 14.7, "Z Buffering Texture Rectangles". This chapter will explain some of the details associated with the texture rectangle primitive and provide some simple examples for new Nintendo 64 programmers.