GLCREATESHADERPROGRA(3G)
πΈ glCreateShaderProgramv π
okay bestie, buckle up β this is the 3G manual page for glCreateShaderProgramv, and it's honestly kind of a serve. it's the OpenGL girlie that builds you a whole stand-alone program out of an array of null-terminated source code strings. yes, that's a mouthful, but we move. β¨
β¨ NAME β¨
glCreateShaderProgramv β create a stand-alone program from an array of null-terminated source code strings π«Ά
π C SPECIFICATION π
okay so this is literally the whole signature, copy it exactly, do NOT freestyle:
GLuint glCreateShaderProgramv(GLenum type, GLsizei count,
const char **strings);
π PARAMETERS π
typeβ tells the universe which type of shader you're trying to create.countβ how many source code strings are chillin' in thestringsarray.stringsβ the address of an array of pointers to source code strings. that's the raw material the program object gets built from, no cap.
π¦ DESCRIPTION π¦
so glCreateShaderProgram (yes it's spelled without the v in the prose, that's just how it is, don't come for me) creates a program object containing compiled and linked shaders for a single stage, and that stage is whatever you passed as type. strings points at an array of count strings, and those strings are where the shader executables come from. iconic.
here's the tea: glCreateShaderProgram is equivalent to the following, assuming no errors get generated:
const GLuint shader = glCreateShader(type);
if (shader) {
glShaderSource(shader, count, strings, NULL);
glCompileShader(shader);
const GLuint program = glCreateProgram();
if (program) {
GLint compiled = GL_FALSE;
glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
glProgramParameteri(program, GL_PROGRAM_SEPARABLE, GL_TRUE);
if (compiled) {
glAttachShader(program, shader);
glLinkProgram(program);
glDetachShader(program, shader);
}
/* append-shader-info-log-to-program-info-log */
}
glDeleteShader(shader);
return program;
} else {
return 0;
}
and the program object that glCreateShaderProgram hands you back has its GL_PROGRAM_SEPARABLE status set to GL_TRUE. periodt. π
π ERRORS π
GL_INVALID_ENUMgets generated whentypeisn't an accepted shader type. rude but fair.GL_INVALID_VALUEgets generated whencountis negative. bestie, negative? no. π- other errors get generated if the shader code you supplied fails to compile and link β exactly as described for the commands in the pseudocode sequence up above. but here's the important part, don't skip it: all of those errors are generated without any side effects of executing those commands. so it's like, ghost errors. they show up, but nothing actually happened. π§
π VERSION SUPPORT π
so the chart says glCreateShaderProgramv is a late bloomer β she does not exist in the earlier versions. here's the vibe check per version:
- OpenGL
2.0β-(nope) - OpenGL
2.1β-(nope) - OpenGL
3.0β-(nope) - OpenGL
3.1β-(nope) - OpenGL
3.2β-(nope) - OpenGL
3.3β-(nope) - OpenGL
4.0β-(nope) - OpenGL
4.1ββ(she's here!!) - OpenGL
4.2ββ - OpenGL
4.3ββ - OpenGL
4.4ββ - OpenGL
4.5ββ
main character energy starting at 4.1, we love a glow-up. β
πΈ SEE ALSO πΈ
go read these too, iykyk:
glCreateShader()glCreateProgram()glCompileShader()glLinkProgram()
π COPYRIGHT π
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 Β© 2010-2014 Khronos Group
and that's the whole page, bestie π ok so for the cute sign-off: this one came from [FIXME: source], dated 08/09/2021, and it's page GLCREATESHADERPROGRA(3G) β slay, go compile something. πβ¨
π¦ 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