GLINDEXPOINTER(3G)
GLINDEXPOINTER π
okay bestie, sit down, hydrate, because we're about to talk about glIndexPointer β that's the 3G manual page, OpenGL family, and she's a lil client-side icon π
β¨ NAME β¨
glIndexPointer β define an array of color indexes π
β¨ C SPECIFICATION β¨
void glIndexPointer( GLenum type,
GLsizei stride,
const GLvoid *ptr )
β¨ PARAMETERS β¨
typeβ tells you the data type of each color index in the array. The symbolic constants she accepts areGL_UNSIGNED_BYTE,GL_SHORT,GL_INT,GL_FLOAT, andGL_DOUBLE. Her initial value isGL_FLOAT. π¦strideβ the byte offset between consecutive color indexes. Ifstrideis0(which is the initial value, slay), then the color indexes are understood to be tightly packed in the array. Initial value is0. π«ptrβ a pointer to the first index in the array. Initial value is0. π«Ά
β¨ DESCRIPTION β¨
So glIndexPointer specifies the location and data of an array of color indexes to use when rendering. type specifies the data type of each color index, and stride gives the byte stride from one color index to the next β which is the whole reason vertices and attributes can be packed into a single array, or stored in separate arrays. (Single-array storage may be more efficient on some implementations; go look at glInterleavedArrays, she's right there.) π
type, stride, and ptr are saved as client-side state. no cap.
The color index array is initially disabled. To enable and disable the array, call glEnableClientState and glDisableClientState with the argument GL_INDEX_ARRAY. If enabled, the color index array is used when glDrawArrays, glDrawElements or glArrayElement is called. periodt. π
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 sisters, all iconic. πΈ
β¨ NOTES β¨
glIndexPointeris available only if the GL version is 1.1 or greater. iykyk.- The color index array is initially disabled, and it isn't accessed when
glArrayElement,glDrawElements, orglDrawArraysis called. - Execution of
glIndexPointeris not allowed betweenglBeginand the correspondingglEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. π bestie please do not test this. glIndexPointeris typically implemented on the client side.- Since the color index array parameters are client-side state, they are not saved or restored by
glPushAttribandglPopAttrib. UseglPushClientAttribandglPopClientAttribinstead. different functions, different vibe. π
β¨ ERRORS β¨
GL_INVALID_ENUMis generated iftypeis not an accepted value. π«GL_INVALID_VALUEis generated ifstrideis negative. π
β¨ ASSOCIATED GETS β¨
glIsEnabledwith argumentGL_INDEX_ARRAYglGetwith argumentGL_INDEX_ARRAY_TYPEglGetwith argumentGL_INDEX_ARRAY_STRIDEglGetPointervwith argumentGL_INDEX_ARRAY_POINTER
β¨ SEE ALSO β¨
glArrayElement(3G), glColorPointer(3G), glDrawArrays(3G), glDrawElements(3G), glEdgeFlagPointer(3G), glEnable(3G), glGetPointerv(3G), glInterleavedArrays(3G), glNormalPointer(3G), glPopClientAttrib(3G), glPushClientAttrib(3G), glTexCoordPointer(3G), glVertexPointer(3G) β
π that's the whole page, no notes, every single detail intact, we ate and left no crumbs.
and that's the sign-off, bestie β this was page <code>GLINDEXPOINTER(3G)</code> from the <code>3G</code> manual set, footer and all. mwah. π§π
π¦ where this page comes from
- opensuse-leap 16.0: Mesa-libGL-devel 24.1.7-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms