GLEDGEFLAGPOINTER(3G)
π GLEDGEFLAGPOINTER (3G) π
okay bestie, welcome to the 3G section of the manual β this is the OpenGL girlies' corner and we are thriving here. today's main character is glEdgeFlagPointer and she's honestly so underrated. let's get into it π«Ά
β¨ NAME β¨
glEdgeFlagPointer β define an array of edge flags π
πΈ C SPECIFICATION πΈ
void glEdgeFlagPointer( GLsizei stride,
const GLvoid *ptr )
like, that's the whole signature. two args. we love a low-maintenance icon π
π PARAMETERS π
strideβ this is the byte offset between consecutive edge flags, i.e. how far apart your lil edge flags are living from each other. and listen: ifstrideis0(which is the initial value btw), then the edge flags are understood to be tightly packed in the array. no gaps, no drama, just vibes pressed right up against each other. the initial value is0. periodt.ptrβ a pointer to the first edge flag in the array. the very first one. the main character of the array if you will β¨. the initial value is zero.
π¦ DESCRIPTION π¦
so what does glEdgeFlagPointer actually do, you ask? she specifies the location and data of an array of boolean edge flags to use when rendering. yes bestie, boolean. true/false. yes/no. slay/not slay. π
stride specifies the byte stride from one edge flag to the next, which is the whole reason this exists β it lets vertices and attributes be packed into a single array, or stored in separate arrays. (and ngl, single-array storage may be more efficient on some implementations β see glInterleavedArrays if you wanna go down that rabbit hole π.)
when an edge flag array is specified, stride and ptr are saved as client-side state. remember that, it matters later, iykyk.
to enable and disable the edge flag array, you call glEnableClientState and glDisableClientState with the argument GL_EDGE_FLAG_ARRAY. and if it's enabled? the edge flag array gets used when glDrawArrays, glDrawElements, or glArrayElement is called. no cap.
use glDrawArrays to construct a sequence of primitives (all of the same type) from prespecified vertex and vertex attribute arrays. use glArrayElement to specify primitives by indexing vertices and vertex attributes, and glDrawElements to construct a sequence of primitives by indexing vertices and vertex attributes. three sisters, three paths, one destiny π
π₯ NOTES π₯
glEdgeFlagPointeris available only if the GL version is1.1or greater. so if you're on some ancient build, sorry babe, this isn't for you π- the edge flag array is initially disabled and it won't be accessed when
glArrayElement,glDrawElementsorglDrawArraysis called. she's asleep until you wake her up. - > π¨ okay this one's important: execution of
glEdgeFlagPointeris 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. undefined behaviour bestie. do not. just don't. π glEdgeFlagPointeris typically implemented on the client side.- edge flag array parameters are client-side state and are therefore not saved or restored by
glPushAttribandglPopAttrib. useglPushClientAttribandglPopClientAttribinstead. do not mix these up, i am begging π₯Ί
π ERRORS π
GL_INVALID_ENUMis generated ifstrideis negative. negative stride?? absolutely not. the universe will simply refuse. π
π ASSOCIATED GETS π
glIsEnabledwith argumentGL_EDGE_FLAG_ARRAYglGetwith argumentGL_EDGE_FLAG_ARRAY_STRIDEglGetPointervwith argumentGL_EDGE_FLAG_ARRAY_POINTER
π SEE ALSO π
glArrayElement(3G), glColorPointer(3G), glDrawArrays(3G), glDrawElements(3G), glEnable(3G), glGetPointerv(3G), glIndexPointer(3G), glNormalPointer(3G), glPopClientAttrib(3G), glPushClientAttrib(3G), glTexCoordPointer(3G), glVertexPointer(3G)
and that's the whole page babes π this lil entry lives in the GLEDGEFLAGPOINTER(3G) corner of the manual β that's the page name stamped right there at the bottom, the source/version-and-date footer of the whole thing. go forth and index your edge flags responsibly, bestie. mwah πβ¨
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- fedora 43: gl-manpages 1.1-34.20190306.fc43 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- fedora 44: gl-manpages 1.1-35.20190306.fc44 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms