define_texture(3G)
NAME
define_texture − specify the values for an individual texture map
SYNOPSIS
C Syntax:
void define_texture(fildes,index,s_size,t_size,texture);
int fildes,index,s_size,t_size;
unsigned char texture[];
FORTRAN77 Syntax:
subroutine define_texture(fildes,index,s_size,t_size,texture)
integer*4 fildes,index,s_size,t_size
character *(*) texture
Pascal Syntax:
procedure define_texture(fildes,index,s_size,t_size:integer;
var texture:packed array[lo..hi:integer] of gbyte);
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphic device is opened.
index (1-64) identifies the texture map to be defined.
s_size, t_size Specify the number of pixels in the s and t directions in the texture array.
texture The texture map values in s-minor, t-major order with the pixel at (0,0) the first value and s and t increasing. For CMAP_FULL textures, the data is in RGB order.
Discussion
define_texture specifies the source texture map data to be used in filling either subsequent polygons that have texture map coordinates per vertex or b-spline surfaces when the interior_style (or bf_interior_style) is set to INT_TEXTURE. The resulting texture is selected by texture_index or bf_texture_index. Note that the shade_mode must be CMAP_FULL or CMAP_MONOTONIC for texture mapping to function correctly.
The texture map is defined in parameter space (s,t) on a unit square (0-1). The mapping onto simple polygons is defined by the extra coordinate data specified with the primitives such as polygon_with_data3d or quadrilateral_mesh_with_data. The mapping onto b-spline surfaces is specified by u_knot_vector and v_knot_vector.
The number of bits to use for each pixel is derived from the shade_mode. In CMAP_FULL mode, the texture is assumed to be 24 bits. In CMAP_MONOTONIC mode, it is assumed to be eight. The data in the texture array is organized as bytes and is interpreted as:
depth = 8 (1 byte/pixel) - Used for CMAP_MONOTONIC.
depth = 24 (3 bytes/pixel) - Used for CMAP_FULL.
The portion of the texture map to use may be specified by the texture_viewport and texture_window functions.
The index parameter is used to identify the texture map for the texture_index and bf_texture_index procedures. index is limited to the range 1 ≤ index ≤ 64.
If s_size or t_size is set to zero or texture is a null pointer, then the specified texture map index is effectively deleted and access to that texture map will give the default.
DEFAULTS
The default texture is a fill with the current fill color or back-facing fill color.
SEE ALSO
Starbase Reference: alpha_transparency(3G), bf_texture_index(3G), fill_color(3G), interior_style(3G), shade_mode(3G), texture_index(3G), texture_viewport(3G), texture_window(3G), u_knot_vector(3G), v_knot_vector(3G),
Starbase Device Drivers Manual.
Hewlett-Packard Company — HP-UX Release 9.0: August 1992