GLGETATTACHEDSHADERS(3G)
π GLGETATTACHEDSHADERS β¨
Okay bestie, so this is the tea on glGetAttachedShaders from the OpenGL fam β it's a <cyan>3G</cyan> manual page situation, and honestly it's giving "let me peek at your shader attachments" realness. No cap.
πΈ C SPECIFICATION πΈ
void glGetAttachedShaders(GLuint program, GLsizei maxCount,
GLsizei *count, GLuint *shaders);
Like, literally that's the whole signature. Slay.
π PARAMETERS π
programβ this is the program object you're lowkey interrogating. The main character, if you will.maxCountβ the size of the array where you're storing the returned object names. It's giving "how much room did you make in your closet" energy.countβ returns the number of names actually returned inshaders. Like the receipts of how many shaders showed up. πshadersβ the array where the names of attached shader objects get returned. This is where the attached besties live.
π¦ DESCRIPTION π¦
So glGetAttachedShaders returns the names of the shader objects attached to program. The names of shader objects attached to program get returned in shaders. The actual number of shader names written into shaders is returned in count. If no shader objects are attached to program, count is set to 0 β like an empty group chat, tragic but valid.
The maximum number of shader names that may be returned in shaders is specified by maxCount. Don't overflow it, bestie, that's not the vibe.
If the number of names actually returned is not required β say, for instance, if it has just been obtained by calling glGetProgram() β a value of NULL may be passed for count. Iconic flexibility, honestly. If no shader objects are attached to program, a value of 0 will be returned in count. The actual number of attached shaders can be obtained by calling glGetProgram() with the value GL_ATTACHED_SHADERS. Periodt.
π ERRORS π
Like, things can go wrong and here's the rundown:
GL_INVALID_VALUEis generated ifprogramis not a value generated by OpenGL. Not me calling OpenGL with a fake ID π.GL_INVALID_OPERATIONis generated ifprogramis not a program object. It's giving "you brought a shader to a program-only function" energy.GL_INVALID_VALUEis generated ifmaxCountis less than0. Negative maxCount is not it, bestie, just don't.
π₯ ASSOCIATED GETS π₯
glGetProgram()with argumentGL_ATTACHED_SHADERSglIsProgram()
Like the linked accounts on your finsta, iykyk.
π VERSION SUPPORT π
Okay so here's the mood board β glGetAttachedShaders is supported in every single one of these OpenGL versions, no skips, no absences, full attendance:
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 function name is glGetAttachedShaders, and the feature name is also glGetAttachedShaders. Consistent queen. π
π SEE ALSO π
glAttachShader()glDetachShader()
The attach/detach duo β the on-again-off-again relationship of shader objects.
π«Ά COPYRIGHT π«Ά
Copyright Β© 2003-2005 3Dlabs Inc. Ltd. 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 (AGAIN) π
Copyright Β© 2003-2005 3Dlabs Inc. Ltd. Copyright Β© 2010-2014 Khronos Group
Okay bestie, that's the whole manual page β every detail preserved, every flag accounted for, all the vibes intact. No technical claims were invented, and nothing got skipped. We ate and left no crumbs. π β¨
[FIXME: source] β 08/09/2021 β GLGETATTACHEDSHADERS(3G) β signing off, love you bestie, stay chromatically caffeinated ππ¦πΈ
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms