GLCREATEPROGRAM(3G)

    .SH "NAME" glCreateProgram - Creates a program object
    .SH "C SPECIFICATION"

            .HP u GLuint glCreateProgram(void);

    .SH "DESCRIPTION"
        .PP 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 no longer needed as part of a program object, shader objects can be detached.
        .PP 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.

    .SH "NOTES"
        .PP 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.
        .PP Applications are responsible for providing the synchronization across API calls when objects are accessed from different execution threads.

    .SH "ERRORS"
        .PP This function returns 0 if an error occurs creating the program object.

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

    .SH "VERSION SUPPORT"
        .TS allbox tab(:); lB cB s s s s s s s s s s s lB cB cB cB cB cB cB cB cB cB cB cB cB. T{ T}:T{ OpenGL Version T} T{ Function / Feature Name T}:T{ 2.0 T}:T{ 2.1 T}:T{ 3.0 T}:T{ 3.1 T}:T{ 3.2 T}:T{ 3.3 T}:T{ 4.0 T}:T{ 4.1 T}:T{ 4.2 T}:T{ 4.3 T}:T{ 4.4 T}:T{ 4.5 T} l c c c c c c c c c c c c. T{ glCreateProgram T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}

    .SH "SEE ALSO"
        .PP glAttachShader(), glBindAttribLocation(), glCreateShader(), glDeleteProgram(), glDetachShader(), glLinkProgram(), glUniform(), glUseProgram(), glValidateProgram()

    .SH "COPYRIGHT"
        .PP 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. https://opencontent.org/openpub/.

COPYRIGHT
Copyright © 2003-2005 3Dlabs Inc. Ltd.
Copyright © 2010-2014 Khronos Group