GLCREATEPROGRAM(3G)

✨ glCreateProgram: the 3G manual page ✨

Okay bestie, this is the 3G manual page for glCreateProgram, and the header is literally saying [FIXME: manual] β€” not me being messy, that's just the header. Let's get into it. 🫢

🌸 NAME 🌸

glCreateProgram β€” creates a program object. That's the whole name vibe. ✨

🧚 C SPECIFICATION 🧚

GLuint glCreateProgram(void);

πŸ’– DESCRIPTION πŸ’–

glCreateProgram creates an empty program object and returns a non-zero value by which it can be referenced. A program object is an object to which shader objects can be attached. This provides a mechanism to specify the shader objects that will be linked to create a program. It also provides a means for checking the compatibility of the shaders that will be used to create a program β€” for instance, checking the compatibility between a vertex shader and a fragment shader. When they're no longer needed as part of a program object, shader objects can be detached. Periodt. πŸ’…

One or more executables are created in a program object by successfully attaching shader objects to it with glAttachShader(), successfully compiling the shader objects with glCompileShader(), and successfully linking the program object with glLinkProgram(). These executables are made part of current state when glUseProgram() is called. Program objects can be deleted by calling glDeleteProgram(). The memory associated with the program object will be deleted when it is no longer part of current rendering state for any context. πŸ‘‘

πŸ¦‹ NOTES πŸ¦‹

Like buffer and texture objects, the name space for program objects may be shared across a set of contexts, as long as the server sides of the contexts share the same address space. If the name space is shared across contexts, any attached objects and the data associated with those attached objects are shared as well. πŸŒ€

Applications are responsible for providing the synchronization across API calls when objects are accessed from different execution threads. No cap, that's on you. πŸ’…

😭 ERRORS 😭

This function returns 0 if an error occurs creating the program object.

πŸ”₯ ASSOCIATED GETS πŸ”₯

  • glGet() with the argument GL_CURRENT_PROGRAM
  • glGetActiveAttrib() with a valid program object and the index of an active attribute variable
  • glGetActiveUniform() with a valid program object and the index of an active uniform variable
  • glGetAttachedShaders() with a valid program object
  • glGetAttribLocation() with a valid program object and the name of an attribute variable
  • glGetProgram() with a valid program object and the parameter to be queried
  • glGetProgramInfoLog() with a valid program object
  • glGetUniform() with a valid program object and the location of a uniform variable
  • glGetUniformLocation() with a valid program object and the name of a uniform variable
  • glIsProgram()

🌈 VERSION SUPPORT 🌈

Here's the version vibe check. The original table's columns are a blank corner, Function / Feature Name, and OpenGL Version; the function/feature name is glCreateProgram, and it's got a βœ” in every listed OpenGL version. πŸ’–

  • 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 β€” βœ”

πŸŽ€ SEE ALSO πŸŽ€

  • glAttachShader()
  • glBindAttribLocation()
  • glCreateShader()
  • glDeleteProgram()
  • glDetachShader()
  • glLinkProgram()
  • glUniform()
  • glUseProgram()
  • glValidateProgram()

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

Okay that's the whole man page, bestie πŸ’– Cute sign-off: source/version is [FIXME: source], date is 08/09/2021, and the footer title is GLCREATEPROGRAM(3G). Slay. πŸŽ€
πŸ“¦ where this page comes from