GLINTERLEAVEDARRAYS(3G)
π GLINTERLEAVEDARRAYS(3G) π
okay bestie, sit down, hydrate, because we're talking about glInterleavedArrays from the 3G manual β the one that sets up and turns on a whole bunch of interleaved arrays at the same time. one call, many arrays, main character energy. β¨
πΈ C SPECIFICATION πΈ
void glInterleavedArrays( GLenum format,
GLsizei stride,
const GLvoid *pointer )
π PARAMETERS π
formatβ tells the GL which type of array to enable. the accepted symbolic constants areGL_V2F,GL_V3F,GL_C4UB_V2F,GL_C4UB_V3F,GL_C3F_V3F,GL_N3F_V3F,GL_C4F_N3F_V3F,GL_T2F_V3F,GL_T4F_V4F,GL_T2F_C4UB_V3F,GL_T2F_C3F_V3F,GL_T2F_N3F_V3F,GL_T2F_C4F_N3F_V3F, andGL_T4F_C4F_N3F_V4F. that's the whole menu, no substitutions π«Άstrideβ the offset, in bytes, between each aggregate array element. basically "how far apart are my lil guys".
π¦ DESCRIPTION π¦
so here's the vibe: glInterleavedArrays lets you specify and enable individual color, normal, texture, and vertex arrays whose elements are all part of one bigger aggregate array element. for some implementations this is literally more efficient than specifying all the arrays separately. it's giving "one trip, all the groceries." π
if stride is 0, the aggregate elements are stored consecutively β back to back to back, no gaps. otherwise, stride bytes sit between the beginning of one aggregate array element and the beginning of the next aggregate array element.
format is basically a ``key'' π that describes how the individual arrays get extracted from the aggregate array. here's the decoding:
- if
formatcontains aT, texture coordinates are extracted from the interleaved array. - if
Cis present, color values are extracted. - if
Nis present, normal coordinates are extracted. - vertex coordinates are always extracted. always. no opt-out, bestie.
the digits 2, 3, and 4 tell you how many values get extracted. F means the values are extracted as floating-point values. colors can also be extracted as 4 unsigned bytes if 4UB follows the C. and if a color is extracted as 4 unsigned bytes, the vertex array element that follows is located at the first possible floating-point aligned address. β¨ alignment slay.
π NOTES π
glInterleavedArraysis available only if the GL version is 1.1 or greater. sorry to the ancient ones π- if
glInterleavedArraysis called while compiling a display list, it is not compiled into the list, and it is executed immediately. it said "not part of the group project." π - execution of
glInterleavedArraysis 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. no cap, do not do this. glInterleavedArraysis typically implemented on the client side.- vertex array parameters are client-side state, so they are not saved or restored by
glPushAttribandglPopAttrib. useglPushClientAttribandglPopClientAttribinstead β different functions for different state, iykyk. - when the
GL_ARB_multitextureextension is supported,glInterleavedArraysonly updates the texture coordinate array for the active active texture unit. (yes, the original really says it twice, we don't make the rules π) the texture coordinate state for other client texture units is not update, regardless of whether they are enabled or not.
π¨ ERRORS π¨
GL_INVALID_ENUMis generated ifformatis not an accepted value. (you made up a constant? bestie, no. π)GL_INVALID_VALUEis generated ifstrideis negative.
π«Ά SEE ALSO π«Ά
glArrayElement(3G), glClientActiveTextureARB(3G), glColorPointer(3G), glDrawArrays(3G), glDrawElements(3G), glEdgeFlagPointer(3G), glEnableClientState(3G), glGetPointer(3G), glIndexPointer(3G), glNormalPointer(3G), glTexCoordPointer(3G), glVertexPointer(3G)
and that's the whole page, babe π this was GLINTERLEAVEDARRAYS(3G), from the GLINTERLEAVEDARRAYS(3G) corner of the 3G manual β go interleave some arrays, you absolute icon. πβ¨π
π¦ 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