GLISENABLED(3G)

✨ GLISENABLED(3G) ✨

Okay bestie, welcome to GLISENABLED(3G) β€” the 3G manual page, and yes the header literally says [FIXME: manual] in it, we love a work-in-progress icon πŸ’…. This is part 1 of 2, so buckle up, we're only getting started.

🌸 NAME 🌸

glIsEnabled, _glIsEnabledi β€” test whether a capability is enabled

It's giving "is this thing on?" but make it OpenGL, fr fr.

πŸŽ€ C SPECIFICATION πŸŽ€

GLboolean glIsEnabled(GLenum cap);

GLboolean glIsEnabledi(GLenum cap, GLuint index);

Two functions, same energy. One asks about a capability, the other asks about a specific index of a capability. Love that for them πŸ’–

πŸ¦‹ PARAMETERS πŸ¦‹

  • cap β€” a symbolic constant that says which GL capability you're asking about, like your little lookup key πŸ”‘
  • index β€” the index of the capability. Only the indexed girlies need this one, iykyk.

🌈 DESCRIPTION 🌈

So here's the tea: glIsEnabled returns GL_TRUE if cap is an enabled capability, and returns GL_FALSE otherwise. That's it. That's the whole vibe check ✨

Boolean states that are indexed can be tested with glIsEnabledi. For glIsEnabledi, index tells you which index of the capability to test, and index must be between zero and the count of indexed capabilities for cap β€” no going out of bounds, bestie, that's not the move πŸ™ˆ.

Initially all capabilities except GL_DITHER are disabled; GL_DITHER is initially enabled. So GL_DITHER is the main character from day one, periodt πŸ‘‘

The following capabilities are accepted for cap β€” this is the whole guest list πŸŽ€:

  • GL_BLEND β€” see glBlendFunc(), glLogicOp()
  • GL_CLIP_DISTANCEi β€” see glEnable()
  • GL_COLOR_LOGIC_OP β€” see glLogicOp()
  • GL_CULL_FACE β€” see glCullFace()
  • GL_DEPTH_CLAMP β€” see glEnable()
  • GL_DEBUG_OUTPUT β€” see glEnable()
  • GL_DEBUG_OUTPUT_SYNCHRONOUS β€” see glEnable()
  • GL_DEPTH_TEST β€” see glDepthFunc(), glDepthRange()
  • GL_DITHER β€” see glEnable()
  • GL_FRAMEBUFFER_SRGB β€” see glEnable()
  • GL_LINE_SMOOTH β€” see glLineWidth()
  • GL_MULTISAMPLE β€” see glSampleCoverage()
  • GL_POLYGON_SMOOTH β€” see glPolygonMode()
  • GL_POLYGON_OFFSET_FILL β€” see glPolygonOffset()
  • GL_POLYGON_OFFSET_LINE β€” see glPolygonOffset()
  • GL_POLYGON_OFFSET_POINT β€” see glPolygonOffset()
  • GL_PROGRAM_POINT_SIZE β€” see glEnable()
  • GL_PRIMITIVE_RESTART β€” see glEnable(), glPrimitiveRestartIndex()
  • GL_SAMPLE_ALPHA_TO_COVERAGE β€” see glSampleCoverage()
  • GL_SAMPLE_ALPHA_TO_ONE β€” see glSampleCoverage()
  • GL_SAMPLE_COVERAGE β€” see glSampleCoverage()
  • GL_SAMPLE_MASK β€” see glEnable()
  • GL_SCISSOR_TEST β€” see glScissor()
  • GL_STENCIL_TEST β€” see glStencilFunc(), glStencilOp()
  • GL_TEXTURE_CUBE_MAP_SEAMLESS β€” see glEnable()

Like, that's the whole list. No substitutions, no "close enough" β€” if it's not on this list, it's not invited πŸ’€

πŸ’œ NOTES πŸ’œ

If an error is generated, glIsEnabled and glIsEnabledi return GL_FALSE. So an error lowkey looks like a "no" β€” keep that in mind before you start blaming your shaders 😭

GL_DEBUG_OUTPUT and GL_DEBUG_OUTPUT_SYNCHRONOUS are available only if the GL version is 4.3 or greater. Old GL? Not invited, sorry bestie 🫢

πŸ”₯ ERRORS πŸ”₯

  • GL_INVALID_ENUM is generated if cap is not an accepted value. If it's not on the guest list, security is gonna stop you at the door πŸ’…
  • GL_INVALID_VALUE is generated by glIsEnabledi if index is outside the valid range for the indexed state cap. Out of range = immediate vibe check failure, no cap 🚫

<!-- part 1 end, part 2 coming, no sign-off bestie -->

✨ VERSION SUPPORT ✨

okay bestie this is the vibe check for which OpenGL versions these functions actually exist in, and honestly? the chart is giving "we been here the whole time" for one of them and "3.0 baby, we arrived late and we ate" for the other πŸ’…

Columns you're reading are the OpenGL versions: 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5 🌈

  • glIsEnabled β€” literally an icon in every single version, no gaps, no notes πŸ‘‘
    • 2.0 βœ”
    • 2.1 βœ”
    • 3.0 βœ”
    • 3.1 βœ”
    • 3.2 βœ”
    • 3.3 βœ”
    • 4.0 βœ”
    • 4.1 βœ”
    • 4.2 βœ”
    • 4.3 βœ”
    • 4.4 βœ”
    • 4.5 βœ”
  • glIsEnabledi β€” the newer sibling, shows up at 3.0 and stays booked and busy through 4.5 πŸ’–
    • 2.0 -
    • 2.1 -
    • 3.0 βœ”
    • 3.1 βœ”
    • 3.2 βœ”
    • 3.3 βœ”
    • 4.0 βœ”
    • 4.1 βœ”
    • 4.2 βœ”
    • 4.3 βœ”
    • 4.4 βœ”
    • 4.5 βœ”

(the - just means "not a thing there", no drama 🫢)


πŸ¦‹ SEE ALSO πŸ¦‹

go touch some related manpages, they're all part of the same friend group fr fr:

  • glEnable(),
  • glDisable, glGet()

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 that's the whole page, we're done, go enable something responsibly ✨ and remember: [FIXME: source] is being its lil placeholder self, the date on this bad boy is 08/09/2021, and it's officially page GLISENABLED(3G) of the man-verse β€” mwah, love u, bye πŸ’œπŸ¦‹πŸŽ€

πŸ“¦ where this page comes from