Export (0) Print
Expand All

glTexCoordPointer

The glTexCoordPointer function defines an array of texture coordinates.

void glTexCoordPointer(
  GLint size,
  GLenum type,
  GLsizei stride,
  const GLvoid *pointer
);

Parameters

size
The number of coordinates per array element. The value of size must be 1, 2, 3, or 4.
type
The data type of each texture coordinate in the array using the following symbolic constants: GL_SHORT, GL_INT, GL_FLOAT, and GL_DOUBLE.
stride
The byte offset between consecutive array elements. When stride is zero, the array elements are tightly packed in the array.
count
The number of array elements, counting from the first, that are static.
pointer
A pointer to the first coordinate of the first element in the array.

Remarks

The glTexCoordPointer function specifies the location and data of an array of texture coordinates to use when rendering.The size parameter specifies the number of coordinates used for each element of the array.The type parameter specifies the data type of each texture coordinate. The stride parameter determines the byte offset from one array element to the next, enabling the packing of vertices and attributes in a single array or storage in separate arrays. In some implementations, storing the vertices and attributes in a single array can be more efficient than using separate arrays. For more information, see glInterleavedArrays. When a texture coordinate array is specified, size, type, stride, and pointer are saved client-side state.

A texture coordinate array is enabled when you specify the GL_TEXTURE_COORD_ARRAY constant with glEnableClientState. When enabled, glDrawArrays, glDrawElements, and glArrayElement use the texture coordinate array. By default the texture coordinate array is disabled.

You cannot include glTexCoordPointer in display lists.

When you specify a texture coordinate array using glTexCoordPointer, the values of all the function's texture coordinate array parameters are saved in a client-side state, and static array elements can be cached. Because the texture coordinate array parameters are client-side state, their values are not saved or restored by glPushAttrib and glPopAttrib.

Although no error is generated when you call glTexCoordPointer within glBegin and glEnd pairs, the results are undefined.

The following functions retrieve information related to glTexCoordPointer:

glIsEnabled with argument GL_TEXTURE_COORD_ARRAY

glGet with argument GL_TEXTURE_COORD_ARRAY_SIZE

glGet with argument GL_TEXTURE_COORD_ARRAY_STRIDE

glGet with argument GL_TEXTURE_COORD_ARRAY_COUNT

glGet with argument GL_TEXTURE_COORD_ARRAY_TYPE

glGetPointerv with argument GL_TEXTURE_COORD_ARRAY_POINTER

Error Codes

The following are the error codes generated and their conditions.

Error code Condition
GL_INVALID_VALUE size was not 1, 2, 3, or 4.
GL_INVALID_ENUM type was not an accepted value.
GL_INVALID_VALUE stride or count was negative.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Gl.h.
  Library: Use Opengl32.lib.

See Also

glArrayElement, glColorPointer, glDrawArrays, glDrawElements, glEdgeFlagPointer, glEnable, glGetPointerv, glGetString, glIndexPointer, glIsEnabled, glNormalPointer, glPopClientAttrib, glPushClientAttrib, glTexCoord, glVertexPointer


  

Community Additions

Show:
© 2014 Microsoft