GLTEXCOORDPOINTER(3G)
β¨ 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 be1,2,3or4, no in-between, no vibes-based numbers. the initial value is4.typeβ the data type of each texture coordinate. the accepted symbolic constants areGL_SHORT,GL_INT,GL_FLOAT, orGL_DOUBLE. initial value isGL_FLOAT.strideβ the byte offset between consecutive array elements. ifstrideis0, the array elements are understood to be tightly packed (like, no gaps, bestie, shoulder to shoulder). initial value is0.ptrβ a pointer to the first coordinate of the first element in the array. initial value is0.
π 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 β
glTexCoordPointeris available only if the GL version is1.1or 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, orglDrawArraysis called. it's not ignoring you, it's just off. - execution of
glTexCoordPointeris not allowed between the execution ofglBeginand the corresponding execution ofglEnd, 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. glTexCoordPointeris 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
glPushAttribandglPopAttrib. useglPushClientAttribandglPopClientAttribinstead. wrong function, wrong drawer, sorry babe π - when the
GL_ARB_imagingextension is supported,glTexCoordPointerupdates the texture coordinate array state of the active client texture unit, specified withglClientActiveTextureARB. multi-texture girlies, this one's for you β¨
π ERRORS π
GL_INVALID_VALUEis generated ifsizeis not1,2,3, or4.GL_INVALID_ENUMis generated iftypeis not an accepted value.GL_INVALID_VALUEis generated ifstrideis negative. (negative stride? in this economy? no.)
π ASSOCIATED GETS π
glIsEnabledwith argumentGL_TEXTURE_COORD_ARRAYglGetwith argumentGL_TEXTURE_COORD_ARRAY_SIZEglGetwith argumentGL_TEXTURE_COORD_ARRAY_TYPEglGetPointervwith argumentGL_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
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- fedora 43: gl-manpages 1.1-34.20190306.fc43 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- fedora 44: gl-manpages 1.1-35.20190306.fc44 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms