GLDRAWARRAYS(3G)
πΈ NAME πΈ
glDrawArrays β render primitives from array data. and yes bestie, you're on the GLDRAWARRAYS(3G) page, the 3G manual moment, we're in it π
β¨ C SPECIFICATION β¨
void glDrawArrays( GLenum mode,
GLint first,
GLsizei count )
π PARAMETERS π
modeβ tells the GL bestie what kind of primitives to render. The accepted symbolic constants areGL_POINTS,GL_LINE_STRIP,GL_LINE_LOOP,GL_LINES,GL_TRIANGLE_STRIP,GL_TRIANGLE_FAN,GL_TRIANGLES,GL_QUAD_STRIP,GL_QUADS, andGL_POLYGON.firstβ the starting index in the enabled arrays. like where the glow-up begins β¨countβ how many indices are going to be rendered. the headcount for the draw call, periodt.
π¦ DESCRIPTION π¦
okay so glDrawArrays specifies multiple geometric primitives with very few subroutine calls. Instead of calling a GL procedure to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and colors and use them to construct a sequence of primitives with a single call to glDrawArrays. it's giving efficiency, no cap π
When glDrawArrays is called, it uses count sequential elements from each enabled array to construct a sequence of geometric primitives, beginning with element first. mode specifies what kind of primitives are constructed, and how the array elements construct those primitives. If GL_VERTEX_ARRAY is not enabled, no geometric primitives are generated. literally nothing gets drawn, bestie π
β οΈ Vertex attributes that are modified byglDrawArrayshave an unspecified value afterglDrawArraysreturns. For example, ifGL_COLOR_ARRAYis enabled, the value of the current color is undefined afterglDrawArraysexecutes. Attributes that aren't modified remain well defined. so yeah, that's the drama π
π NOTES π
glDrawArraysis available only if the GL version is1.1or greater. that's the requirement, bestie π«ΆglDrawArraysis included in display lists. IfglDrawArraysis entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client-side state, their values affect display lists when the lists are created, not when the lists are executed. iykyk β creation time, not execution time.
π₯ ERRORS π₯
GL_INVALID_ENUMis generated ifmodeis not an accepted value. not an iconic mode, bestie.GL_INVALID_VALUEis generated ifcountis negative. negative count is not the vibe.GL_INVALID_OPERATIONis generated ifglDrawArraysis executed between the execution ofglBeginand the correspondingglEnd. do not try to sneak this into aglBegin/glEndsituation, fr fr.
π SEE ALSO π
glArrayElement(3G), glColorPointer(3G), glDrawElements(3G), glDrawRangeElements(3G), glEdgeFlagPointer(3G), glGetPointerv(3G), glIndexPointer(3G), glInterleavedArrays(3G), glNormalPointer(3G), glTexCoordPointer(3G), glVertexPointer(3G)
signing off from the GLDRAWARRAYS(3G) manual page β 3G title energy, no date stamp on this one, just vibes and primitives π slay.
π¦ 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-1017 on : a language model's rewrite of the original, under its terms