GLGETSHADER(3G)
π GLGETSHADER(3G) β glGetShaderiv
okay so first of all, bestie, the manual name is 3G (iykyk, OpenGL section) and this whole page is about glGetShaderiv β the little function that spills the tea on a shader object. π«β¨
β¨ NAME β¨
glGetShaderiv β Returns a parameter from a shader object. literally just "tell me about this shader", no cap.
πΈ C SPECIFICATION πΈ
void glGetShaderiv(GLuint shader, GLenum pname, GLint *params);
like, three args, no drama, we love to see it π
π PARAMETERS π
shaderβ the shader object you're being nosy about π which one are we querying, bestie?pnameβ the object parameter. the accepted symbolic names areGL_SHADER_TYPE,GL_DELETE_STATUS,GL_COMPILE_STATUS,GL_INFO_LOG_LENGTH,GL_SHADER_SOURCE_LENGTH. pick one, and it's giving "choose your fighter" π₯paramsβ where the requested object parameter gets returned. this is the lil mailbox the answer goes into π¬
π¦ DESCRIPTION π¦
glGetShader returns in params the value of a parameter for a specific shader object. here's the whole menu, no gatekeeping:
GL_SHADER_TYPEβparamsreturnsGL_VERTEX_SHADERifshaderis a vertex shader object,GL_GEOMETRY_SHADERifshaderis a geometry shader object, andGL_FRAGMENT_SHADERifshaderis a fragment shader object. it's giving "what kind of girlie am i" energy πGL_DELETE_STATUSβparamsreturnsGL_TRUEifshaderis currently flagged for deletion, andGL_FALSEotherwise. yes bestie, we're checking if it's on its way out πGL_COMPILE_STATUSβparamsreturnsGL_TRUEif the last compile operation onshaderwas successful, andGL_FALSEotherwise. this is the vibe check for your compile π§GL_INFO_LOG_LENGTHβparamsreturns the number of characters in the information log forshaderincluding the null termination character (i.e., the size of the character buffer required to store the information log). ifshaderhas no information log, a value of0is returned. so like, it's telling you how big a bucket you need πͺ£GL_SHADER_SOURCE_LENGTHβparamsreturns the length of the concatenation of the source strings that make up the shader source for theshader, including the null termination character. (i.e., the size of the character buffer required to store the shader source). if no source code exists,0is returned. sizing up the source, iconic π
π NOTES π
If an error is generated, no change is made to the contents of params. like, nothing moves, the mailbox stays exactly as it was. periodt.
π ERRORS π
bestie. when it goes wrong, it goes wrong loudly:
GL_INVALID_VALUEis generated ifshaderis not a value generated by OpenGL. that's not even a real shader, ma'am πGL_INVALID_OPERATIONis generated ifshaderdoes not refer to a shader object. close but no πGL_INVALID_ENUMis generated ifpnameis not an accepted value. wrong parameter name, wrong vibe, rejected π«
π₯ ASSOCIATED GETS π₯
glGetShaderInfoLog()with argumentshaderglGetShaderSource()with argumentshaderglIsShader()
the whole friend group, fr fr π«Ά
π VERSION SUPPORT π
every single OpenGL version said "yes queen" to glGetShaderiv:
glGetShaderivis supported in 2.0 β, 2.1 β, 3.0 β, 3.1 β, 3.2 β, 3.3 β, 4.0 β, 4.1 β, 4.2 β, 4.3 β, 4.4 β, and 4.5 β.
not one single version left it on read. we stan a universally supported function πβ¨
β SEE ALSO β
glCompileShader()glCreateShader()glDeleteShader()glGetProgram()glShaderSource()
go read those too, i'm obsessed with a well-rounded education ππ
π 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 (yes, again) π§
Copyright Β© 2003-2005 3Dlabs Inc. Ltd. Copyright Β© 2010-2014 Khronos Group
ok that's the whole page, bestie, you ate that π β¨ mwah π
sign-off time: this came from [FIXME: source], dated 08/09/2021, and it's page GLGETSHADER(3G) β screenshot it, cite it, love it πΈπ¦
π¦ 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