GLLINKPROGRAM(3gl)GLLINKPROGRAM(3gl)NAME
glLinkProgramARB - Links a program object.
C SPECIFICATION
void glLinkProgramARB( GLhandleARB program )
PARAMETERS
program Specifies the program object to be linked.
DESCRIPTION
glLinkProgramARB links the program object specified by program. When a
program object is linked an executable is created from all the shader
objects which are attached to the program object. Any attached shader
objects of subtype GL_VERTEX_SHADER_ARB will be used to create an exe‐
cutable to run on the vertex processor. Any attached shader objects of
subtype GL_FRAGMENT_SHADER_ARB will be used to create an executable to
run on the fragment processor.
The status of a link operation can be queried by calling glGetObjectPa‐
rameterARB with arguments program and GL_OBJECT_LINK_STATUS_ARB. If the
link was successful the status will be GL_TRUE otherwise the status
will be GL_FALSE.
When a program object has been successfully linked all active user-
defined uniform variables belonging to program will be initialized to 0
and all the program object's active uniform variables will be assigned
locations. These locations can be queried by calling glGetUniformLo‐
cationARB.
Information about the link operation can be queried by calling glGet‐
InfoLogARB.
If a program object only has vertex shaders attached they will be
linked with the fixed function fragment processing. Similarly if a pro‐
gram object only has fragment shaders attached they will be linked with
the fixed function vertex processing.
NOTES
glLinkProgramARB can return before the link operation has completed.
ERRORS
GL_INVALID_VALUE is generated if program is not a valid program
object.
GL_INVALID_OPERATION is generated if program is not of type GL_PRO‐
GRAM_OBJECT_ARB.
GL_INVALID_ENUM is generated if pname is not an accepted value.
GL_INVALID_OPERATION is generated glLinkProgramARB is executed between
the execution of glBegin and the corresponding execution of glEnd.
ASSOCIATED GETS
glGetActiveAttribARB with argument program
glGetActiveUniformARB with argument program
glGetUniformARB with argument program and a uniform location
glGetUniformLocationARB with argument program and a uniform name
glGetInfoLogARB with argument program
glGetObjectParameterARB with arguments program and GL_OBJECT_LINK_STA‐
TUS_ARB.
glHandleARB with parameter GL_PROGRAM_OBJECT_ARB
SEE ALSO
glAttachObjectARB, glCompileShaderARB, glDetachObjectARB, glUniformARB,
glUseProgramObjectARB, glValidateProgramARB
11 Mar 04 GLLINKPROGRAM(3gl)