GLDRAWELEMENTSBASEVE(3G)

πŸ’– GLDRAWELEMENTSBASEVE(3G) β€” the manual page, but make it make sense πŸ’–

okay so bestie, you opened the GLDRAWELEMENTSBASEVE(3G) page β€” yes, the header even has a little [FIXME: manual] cameo β€” and it’s all about the OpenGL call that renders primitives from array data with a per-element offset. slay. Let’s get into it. 🫢


✨ NAME ✨

glDrawElementsBaseVertex β€” render primitives from array data with a per-element offset

πŸ› οΈ C SPECIFICATION πŸ› οΈ

void glDrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
                              GLvoid *indices, GLint basevertex);

πŸŽ€ PARAMETERS πŸŽ€

  • mode β€” tells OpenGL what kind of primitives to render. The accepted symbolic constants are GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_LINES_ADJACENCY, GL_LINE_STRIP_ADJACENCY, GL_TRIANGLES_ADJACENCY, GL_TRIANGLE_STRIP_ADJACENCY and GL_PATCHES. iconic list, no notes πŸ’…
  • count β€” the number of elements to be rendered.
  • type β€” the type of the values in indices. It must be one of GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT.
  • indices β€” a pointer to the location where the indices are stored.
  • basevertex β€” a constant that should be added to each element of indices when choosing elements from the enabled vertex arrays.

πŸ¦‹ DESCRIPTION πŸ¦‹

glDrawElementsBaseVertex behaves identically to glDrawElements() except that the *i*th element transferred by the corresponding draw call will be taken from element indices[i] + basevertex of each enabled array. the way that math just sits there being important 😭

If the resulting value is larger than the maximum value representable by type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions).

⚠️ The operation is undefined if the sum would be negative. Do not mess with that, bestie. periodt.

πŸ“ NOTES πŸ“

glDrawElementsBaseVertex is only supported if the GL version is 3.2 or greater, or if the ARB_draw_elements_base_vertex extension is supported. 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 geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the currently installed program object.
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object’s data store is currently mapped.

🌈 VERSION SUPPORT 🌈

OpenGL Version vibe check for the glDrawElementsBaseVertex / Function / Feature Name row πŸ‘‘:

  • 2.0: -
  • 2.1: -
  • 3.0: -
  • 3.1: -
  • 3.2: βœ”
  • 3.3: βœ”
  • 4.0: βœ”
  • 4.1: βœ”
  • 4.2: βœ”
  • 4.3: βœ”
  • 4.4: βœ”
  • 4.5: βœ”

πŸ‘€ SEE ALSO πŸ‘€

  • glDrawElements()
  • glDrawRangeElements()
  • glDrawRangeElementsBaseVertex()
  • glDrawElementsInstanced()
  • glDrawElementsInstancedBaseVertex()

Copyright Β© 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

Copyright Β© 2010-2014 Khronos Group


okay that’s the whole page, bestie β€” source says [FIXME: source], dated 08/09/2021, and the manual is GLDRAWELEMENTSBASEVE(3G). slay forever πŸ’–βœ¨

πŸ“¦ where this page comes from