GLTEXCOORDPOINTER(3G)

πŸ“¦ version 1.1, in centos-stream 9, fedora 43, fedora 44

✨ glTexCoordPointer β€” it's giving "define an array of texture coordinates" ✨

okay bestie, welcome to the 3G manual page for glTexCoordPointer, and no cap this one is a whole vibe. it's the function that tells OpenGL where your texture coordinates live. sit down, hydrate, let's go πŸ’–


🌸 C SPECIFICATION 🌸

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

that's the whole glow-up. four args. four. count them. 🫢


πŸŽ€ PARAMETERS πŸŽ€

  • size β€” how many coordinates are in each array element. it must be 1, 2, 3 or 4, no in-between, no vibes-based numbers. the initial value is 4.
  • type β€” the data type of each texture coordinate. the accepted symbolic constants are GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE. initial value is GL_FLOAT.
  • stride β€” the byte offset between consecutive array elements. if stride is 0, the array elements are understood to be tightly packed (like, no gaps, bestie, shoulder to shoulder). initial value is 0.
  • ptr β€” a pointer to the first coordinate of the first element in the array. initial value is 0.

πŸ’… DESCRIPTION πŸ’…

glTexCoordPointer specifies the location and data of an array of texture coordinates to use when rendering. iconic. size says how many coordinates per element, and it must be 1, 2, 3, or 4. type says what data type each texture coordinate is, and stride says the byte stride from one array element to the next β€” which is the whole reason you can pack vertices and attributes into a single array or keep them in separate arrays. (single-array storage may be more efficient on some implementations; go peek at glInterleavedArrays.) and the moment a texture coordinate array is specified, size, type, stride, and ptr become saved client-side state. periodt.

to enable and disable the texture coordinate array, call glEnableClientState and glDisableClientState with the argument GL_TEXTURE_COORD_ARRAY. if it's enabled, the texture coordinate array gets used whenever glDrawArrays, glDrawElements, glDrawRangeElements or glArrayElement is called. it just shows up. main character energy. πŸ”₯

use glDrawArrays to construct a sequence of primitives (all of the same type) from prespecified vertex and vertex attribute arrays. use glArrayElement to specify primitives by indexing vertices and vertex attributes, and glDrawElements to construct a sequence of primitives by indexing vertices and vertex attributes. three doors, same hallway, iykyk.


⭐ NOTES ⭐

  • glTexCoordPointer is available only if the GL version is 1.1 or greater. if you're on something older, bestie, this door is locked πŸ”’
  • the texture coordinate array is initially disabled and it won't be accessed when glArrayElement, glDrawElements, glDrawRangeElements, or glDrawArrays is called. it's not ignoring you, it's just off.
  • execution of glTexCoordPointer is not allowed between the execution of glBegin and the corresponding execution of glEnd, but an error may or may not be generated. and if no error is generated, the operation is undefined. so like… don't. that's not a "teehee i'll try it" situation, that's a πŸ’€ situation.
  • glTexCoordPointer is typically implemented on the client side with no protocol. no round trip, no drama.
  • the texture coordinate array parameters are client-side state and are therefore not saved or restored by glPushAttrib and glPopAttrib. use glPushClientAttrib and glPopClientAttrib instead. wrong function, wrong drawer, sorry babe πŸ™ˆ
  • when the GL_ARB_imaging extension is supported, glTexCoordPointer updates the texture coordinate array state of the active client texture unit, specified with glClientActiveTextureARB. multi-texture girlies, this one's for you ✨

πŸ’€ ERRORS πŸ’€

  • GL_INVALID_VALUE is generated if size is not 1, 2, 3, or 4.
  • GL_INVALID_ENUM is generated if type is not an accepted value.
  • GL_INVALID_VALUE is generated if stride is negative. (negative stride? in this economy? no.)

πŸ‘‘ ASSOCIATED GETS πŸ‘‘

  • glIsEnabled with argument GL_TEXTURE_COORD_ARRAY
  • glGet with argument GL_TEXTURE_COORD_ARRAY_SIZE
  • glGet with argument GL_TEXTURE_COORD_ARRAY_TYPE
  • glGetPointerv with argument GL_TEXTURE_COORD_ARRAY_POINTER

πŸ¦‹ SEE ALSO πŸ¦‹

glArrayElement(3G), glClientActiveTextureARB(3G), glColorPointer(3G), glDrawArrays(3G), glDrawElements(3G), glDrawRangeElements(3G), glEdgeFlagPointer(3G), glEnable(3G), glGetPointerv(3G), glIndexPointer(3G), glNormalPointer(3G), glPopClientAttrib(3G), glPushClientAttrib(3G), glTexCoord(3G), glVertexPointer(3G)

go read them. they're all in their 3G era and they all ate πŸ’–


and that's the whole page, bestie! this was GLTEXCOORDPOINTER(3G) β€” page GLTEXCOORDPOINTER(3G) in the 3G manual set β€” and that's literally it, no notes, you're welcome, go forth and array your texture coordinates responsibly. mwah. πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from