GLDRAWARRAYS(3G)

🌸 NAME 🌸

okay so welcome to GLDRAWARRAYS(3G) β€” header placeholder [FIXME: manual] and all β€” bestie πŸ’… this page is literally about glDrawArrays, AKA render primitives from array data. periodt.


🧾 C SPECIFICATION 🧾

void glDrawArrays(GLenum mode, GLint first, GLsizei count);

No cap, that's the signature.


πŸŽ€ PARAMETERS πŸŽ€

  • mode β€” tells it what kind of primitives to render. these symbolic constants are accepted: GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_LINE_STRIP_ADJACENCY, GL_LINES_ADJACENCY, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_TRIANGLE_STRIP_ADJACENCY, GL_TRIANGLES_ADJACENCY and GL_PATCHES.
  • first β€” specifies the starting index in the enabled arrays. this is where the reading begins, bestie ✨.
  • count β€” specifies the number of indices to be rendered.

πŸ¦‹ 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. obsessed, honestly.

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. slay.

vertex attributes that are modified by glDrawArrays have an unspecified value after glDrawArrays returns. attributes that aren't modified remain well defined. tiny but important, don't forget it πŸ’€.


🧚 NOTES 🧚

GL_LINE_STRIP_ADJACENCY, GL_LINES_ADJACENCY, GL_TRIANGLE_STRIP_ADJACENCY and GL_TRIANGLES_ADJACENCY are available only if the GL version is 3.2 or greater. iykyk.


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_ENUM is generated if mode is not an accepted value.
  • GL_INVALID_VALUE is generated if count is negative.
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array and the buffer object's data store is currently mapped.
  • GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the currently installed program object.

🌈 VERSION SUPPORT 🌈

the original has a whole table with OpenGL Version across the top and Function / Feature Name down the side. since no tables allowed, here's the tea in list form πŸ«–:

  • Function / Feature Name: glDrawArrays
  • OpenGL Version: 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5
  • Supported? βœ” for every single one, bestie. all twelve, no skips.

πŸ”₯ SEE ALSO πŸ”₯

the whole lineup is glDrawArraysInstanced(), glDrawElements(), glDrawRangeElements(), β€” yes, that last comma is in the original and I'm keeping it, no cap.


Copyright Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2010-2014 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.


Copyright Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2010-2014 Khronos Group

okay bye ily 🫢 the footer tea is: source is [FIXME: source], version/date is 08/09/2021, and the manual page is GLDRAWARRAYS(3G). πŸ’–

πŸ“¦ where this page comes from