texture_index(3G)
NAME
texture_index, bf_texture_index − select the texture map to use
SYNOPSIS
C Syntax:
int texture_index ( fildes, index );
int fildes, index;
int bf_texture_index ( fildes, index );
int fildes, index;
FORTRAN77 Syntax:
integer*4 function texture_index ( fildes, index )
integer*4 fildes, index
integer*4 function bf_texture_index ( fildes, index )
integer*4 fildes, index
Pascal Syntax:
function texture_index ( fildes, index:integer ):integer;
function bf_texture_index ( fildes, index:integer ):integer;
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphic device is opened.
index The index of the texture map to use. The range of index is 0 to 64. The indices 1 to 64 specify a texture map. The index zero (0) with texture_index is used to remove all textures from offscreen memory. The index zero (0) with bf_texture_index causes the front-facing texture map to be used on the back-facing surfaces.
Discussion
The texture_index procedure selects a texture map to use for front-facing polygons and the bf_texture_index procedure selects a texture map to use for back-facing polygons. The index specified is that supplied with the define_texture procedure. If an index is specified which has not been defined then a warning is generated and the default texture map is used. index is limited to the range 0 ≤ index ≤ 64. Indices specified outside this range will generate an error and the default texture map will be used. Texture maps are numbered from 1 through 64. An index of zero (0) used with texture_index specifies that all texture maps are to be removed from offscreen memory. This should be done in multi-process environments when the texture is no longer needed to better share the offscreen memory resource. This specification of index equal to zero will set the front-facing texture map to the default texture. An index of zero (0) used with bf_texture_index will set the back-facing texture to the currently defined front-facing texture.
To operate correctly, the texture map must be loaded into offscreen memory. If the texture map will not fit in the available offscreen memory, other texture maps defined by the current process will be removed to try and make room. If the texture still does not fit, it will be down sampled, by a factor of two in both axes, to a smaller size until it can be loaded into offscreen memory.
The value returned by this function is the factor by which the texture had to be reduced to make it fit into offscreen memory. A return value of one implies that no down sampling was necessary. A return value of two implies that the texture was down sampled once. A return value of zero is given if the texture was already in offscreen memory or index zero was specified. A value of minus 1 (-1) is given if an error occurred.
DEFAULTS
The default value for index is zero (0).
SEE ALSO
Starbase Reference: define_texture(3G). Starbase Graphics Techniques: "Rendering".
Hewlett-Packard Company — November 03, 1994