Enables/disables textures and sets scale and primitive tile settings
#include <ultra64.h> /* gbi.h */ gSPTexture(Gfx *gdl, s32 sc, s32 tc, s32 level, s32 tile, s32 on) gsSPTexture( s32 sc, s32 tc, s32 level, s32 tile, s32 on)
gSPTexture enables/disables textures and sets the scaling value for texturing in the RSP. The texture coordinates are computed by the RSP using the following formula:
Displayed texture coordinates) = (Scale value) x (Shifted texture coordinate values (*))
(*) These are the values of the texture coordinates obtained from the Vtx structure after they have been shifted by the "shift" parameter set in the texture tile attributes.
For details, please see Section 11.5, "Texture State" and Section 22.214.171.124, "Texture Coordinate Transformations" in the N64 Online Programming Manual.
The texture coordinates are created based on the scaling arguments (sc, tc) and the s,t coordinates of the object. Since these are combined by the application, the final s,t values are values in s10.5 format. If you want to scale proportionally, specify 0.5 (0x8000) for sc and tc, and double the object's s,t coordinates.
When MIP-mapping, specify for tile the lowest value in the tile sequence being used. This becomes the tile number of the most-detailed map. For example, in the tile sequence n, n+1, n+2, ... the "n" tile will be the most-detailed tile, so "n" is the value set in this macro. The tiles n+1, n+2, ... have diminishing resolution.
For details about tile descriptors, see gDPSetTile and Section 13.5, "Tile Descriptor Loading" in the N64 Programming Manual.
For the on argument, set either G_ON or G_OFF. When this argument is set to G_OFF, the other arguments are not updated. This might be the cause of bugs in the display list when the state of the texture engine is obtained later.
Please refer to Section 126.96.36.199, "Texture Coordinate Transformations" in the N64 Online Programming Manual.
02/01/99 Entirely revised.