Name
gl.TexCoordPointer -- define an array of texture coordinates
Synopsis
gl.TexCoordPointer(vArray[, size])
Function
gl.TexCoordPointer() specifies an array of texture coordinates to use when rendering. vArray can be either a one-dimensional table consisting of an arbitrary number of consecutive texture coordinates or a two-dimensional table consisting of an arbitrary number of subtables which contain 1 to 4 texture coordinates each. If vArray is a one-dimensional table, you need to pass the optional size argument as well to define the number of texture coordinates per array element. size must be a value in the range of 1 to 4. If vArray is a two-dimensional table, size is automatically determined by the number of items in the first subtable, which must be in the range of 1 to 4 as well.

When using a two-dimensional table, please keep in mind that the number of texture coordinates in each subtable must be constant. It is not allowed to use differing numbers of texture coordinates in the individual subtables. The number of texture coordinates is defined by the number of elements in the first subtable and all following subtables must use the very same number of coordinates.

If you pass Nil in vArray, the texture coordinates array buffer will be freed but it won't be removed from OpenGL. You need to do this manually, e.g. by disabling the texture coordinates array or defining a new one.

To enable and disable a texture coordinate array, call gl.EnableClientState() and gl.DisableClientState() with the argument #GL_TEXTURE_COORD_ARRAY. If enabled, the texture coordinate array is used when gl.DrawArrays(), gl.DrawElements(), or gl.ArrayElement() is called.

Each texture coordinate array is initially disabled and isn't accessed when gl.DrawArrays(), gl.DrawElements(), or gl.ArrayElement() is called.

Execution of gl.TexCoordPointer() is not allowed between the execution of gl.Begin() and the corresponding execution of gl.End(), but an error may or may not be generated. If no error is generated, the operation is undefined.

gl.TexCoordPointer() is typically implemented on the client side.

Texture coordinate array parameters are client-side state and are therefore not saved or restored by gl.PushAttrib() and gl.PopAttrib(). Use gl.PushClientAttrib() and gl.PopClientAttrib() instead.

Please consult an OpenGL reference manual for more information.

Inputs
vArray
one- or two-dimensional table containing texture coordinates or Nil (see above)
size
optional: texture coordinates per array element; must be between 1 to 4 and is only used with one-dimensional tables (see above)
Errors
#GL_INVALID_VALUE is generated if size is not 1, 2, 3, or 4.

Associated gets
gl.IsEnabled() with argument #GL_TEXTURE_COORD_ARRAY

gl.Get() with argument #GL_TEXTURE_COORD_ARRAY_SIZE

gl.Get() with argument #GL_TEXTURE_COORD_ARRAY_TYPE

gl.Get() with argument #GL_TEXTURE_COORD_ARRAY_STRIDE

gl.GetPointer() with argument #GL_TEXTURE_COORD_ARRAY_POINTER


Show TOC