GLINTERLEAVEDARRAYS(3G)

πŸ“¦ version 24.3.3, in opensuse-leap 16.0

πŸ’– 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 are GL_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, and GL_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 format contains a T, texture coordinates are extracted from the interleaved array.
  • if C is present, color values are extracted.
  • if N is 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 πŸ‘‘

  • glInterleavedArrays is available only if the GL version is 1.1 or greater. sorry to the ancient ones 😭
  • if glInterleavedArrays is 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 glInterleavedArrays 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. no cap, do not do this.
  • glInterleavedArrays is typically implemented on the client side.
  • vertex array parameters are client-side state, so they are not saved or restored by glPushAttrib and glPopAttrib. use glPushClientAttrib and glPopClientAttrib instead β€” different functions for different state, iykyk.
  • when the GL_ARB_multitexture extension is supported, glInterleavedArrays only 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_ENUM is generated if format is not an accepted value. (you made up a constant? bestie, no. πŸ™ˆ)
  • GL_INVALID_VALUE is generated if stride is 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