GLINDEX(3G)
β¨ NAME β¨
okay bestie, gather round π this page is about glIndexd, glIndexf, glIndexi, glIndexs, glIndexub, glIndexdv, glIndexfv, glIndexiv, glIndexsv, glIndexubv β and what do they all do? they set the current color index. that's the whole vibe. that's the gig. slay π
this is the GLINDEX(3G) page, and it's giving "short but iconic", so let's go πΈ
π C SPECIFICATION π
fr fr, here's exactly how you call them:
void glIndexd( GLdouble c )
void glIndexf( GLfloat c )
void glIndexi( GLint c )
void glIndexs( GLshort c )
void glIndexub( GLubyte c); 1.1 )
π PARAMETERS π
1.1β Specifies the new value for the current color index.
no cap, the 1.1 is literally sitting right there in the original parameter text, so i'm keeping it, bestie β i don't make the rules, i just relay them faithfully π«Ά
π¦ C SPECIFICATION (the pointer girlies) π¦
okay now the vector versions, they take a pointer instead:
void glIndexdv( const GLdouble *c )
void glIndexfv( const GLfloat *c )
void glIndexiv( const GLint *c )
void glIndexsv( const GLshort *c )
void glIndexubv( const GLubyte *c); 1.1 )
π PARAMETERS π
1.1β Specifies a pointer to a one-element array that contains the new value for the current color index.
π DESCRIPTION π
okay so the tea: glIndex updates the current (single-valued) color index. it takes one argument, and that argument is literally just the new value for the current color index. one job. done. iconic.
the current index is stored as a floating-point value. and here's the thing β integer values are converted directly to floating-point values, with no special mapping. none. zero. it's just a straight-up conversion, no glow-up in between. also: the initial value is 1. remember that π§
now for the spicy part πΆοΈ β index values outside the representable range of the color index buffer are not clamped. not even a little. however (and this is the important however), before an index is dithered (if enabled) and written to the frame buffer, it is converted to fixed-point. and then β any bits in the integer portion of that resulting fixed-point value that do not correspond to bits in the frame buffer are masked out. so yeah, stuff gets cut off at the end, but not at the start. lowkey important distinction, bestie π
β NOTES β
glIndexubandglIndexubvare available only if the GL version is 1.1 or greater. so if you're on something older, sorry babe, they're not coming to the party π- the current index can be updated at any time. like, any time. in particular,
glIndexcan be called between a call toglBeginand the corresponding call toglEnd. yes, inside the begin/end sandwich. it's allowed. go off π
π₯ ASSOCIATED GETS π₯
you wanna read this value back? say less:
glGetwith argumentGL_CURRENT_INDEX
πΈ SEE ALSO πΈ
glColor(3G)glIndexPointer(3G)
and that's the whole page, bestie β short, sweet, and fully committed to setting one single color index at a time π«Ά
this wasGLINDEX(3G)from theGLINDEX(3G)manual page β that's the source/version tag hanging out at the bottom, and yes, the title is the same as the footer because this page is nothing if not consistent π
mwah, go set some indices, ily ππ¦β¨
π¦ 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