GLCOMPILESHADER(3G)
π GLCOMPILESHADER π
okay so bestie, welcome to the GLCOMPILESHADER(3G) page β yes that 3G means it's an OpenGL manual page, and yes it's giving "I live in the graphics section of the library" β¨. Buckle up, we're compiling shaders fr fr.
π NAME π
glCompileShader β literally compiles a shader object. that's it, that's the whole vibe. π«Ά
πΈ C SPECIFICATION πΈ
void glCompileShader(GLuint shader);
look at her. iconic. one parameter, no drama. π
π¦ PARAMETERS π¦
shaderβ specifies the shader object to be compiled. that's the one, the main character we're about to send off to the compiler π
β¨ DESCRIPTION β¨
okay so here's the tea: glCompileShader compiles the source code strings that have been stored in the shader object specified by shader. like, the strings you already dropped in there? those. they get compiled. slay. π₯
the compilation status gets stored as part of the shader object's state, ngl that's kind of important. that value will be set to GL_TRUE if the shader was compiled without errors and is ready for use, and GL_FALSE otherwise π (rip). you can query it by calling glGetShader() with arguments shader and GL_COMPILE_STATUS. that's the vibe check, iykyk.
compilation of a shader can fail for a number of reasons as specified by the OpenGL Shading Language Specification β so like, not our fault bestie, the spec said so. and whether or not the compilation was successful, information about the compilation can be obtained from the shader object's information log by calling glGetShaderInfoLog(). yes even when it ate. even when it flopped. the log is always there for you π
π ERRORS π
GL_INVALID_VALUEis generated ifshaderis not a value generated by OpenGL. so if you made that number up?? rude. caught. πGL_INVALID_OPERATIONis generated ifshaderis not a shader object. wrong type bestie, wrong type π
β ASSOCIATED GETS β
the little besties you can call along with this one:
glGetShaderInfoLog()with argumentshaderglGetShader()with argumentsshaderandGL_COMPILE_STATUSglIsShader()
π VERSION SUPPORT π
the function/feature name in question is glCompileShader, and she is supported in every single one of these OpenGL versions β all checks, no misses, we love a consistent queen:
- OpenGL
2.0β β - OpenGL
2.1β β - OpenGL
3.0β β - OpenGL
3.1β β - OpenGL
3.2β β - OpenGL
3.3β β - OpenGL
4.0β β - OpenGL
4.1β β - OpenGL
4.2β β - OpenGL
4.3β β - OpenGL
4.4β β - OpenGL
4.5β β
twelve for twelve. periodt. π
π SEE ALSO π
glCreateShader()glLinkProgram()glShaderSource()
(go read those next bestie, they're the prequel and the sequel π§)
π 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 Β© 2003-2005 3Dlabs Inc. Ltd. Copyright Β© 2010-2014 Khronos Group
and that's the whole page!! π source is [FIXME: source] and the date on this baddie is 08/09/2021 β go forth and compile responsibly, bestie, mwah πβ¨
π¦ 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