GLBINDPROGRAM(3gl)GLBINDPROGRAM(3gl)NAME
glBindProgramARB - Create or use a program.
C SPECIFICATION
void glBindProgramARB( GLenum target,
GLunit program)
PARAMETERS
target Symbolic name which specifies the program type. Valid val‐
ues
are
GL_VER‐
TEX_PRO‐
GRAM_ARB
and
GL_FRAG‐
MENT_PRO‐
GRAM_ARB.
program Specifies the name of the program.
DESCRIPTION
glBindProgramARB lets you create or use a named program. Calling
glBindProgramARB with target set to GL_VERTEX_PROGRAM_ARB, or GL_FRAG‐
MENT_PROGRAM_ARB and program set to the name of the new program binds
the program name to the target. When a program is bound to a target,
the previous binding for that target is automatically broken.
Programs names are unsigned integers. The value zero is reserved to
represent the default program for each program target. Program names
and the corresponding program contents are local to the shared display-
list space (see glXCreateContext) of the current GL rendering context;
two rendering contexts share program names only if they also share dis‐
play lists.
You may use glGenProgramsARB to generate a set of new program names.
While a program is bound, GL operations on the target to which it is
bound affect the bound program, and queries of the target to which it
is bound return state from the bound program. In effect, the program
targets become aliases for the programs currently bound to them, and
the program name zero refers the default programs that were bound to
them at initialization.
A program binding created with glBindProgramARB remains active until a
different program is bound to the same target, or until the bound pro‐
gram is deleted with glDeleteProgramsARB.
Once created, a named program may be re-bound to the target of the
matching target as often as needed.
NOTES
Changes to a program object made by one rendering context are not guar‐
anteed to take effect in another rendering context until the other
calls glBindProgramARB to bind the program object.
ERRORS
GL_INVALID_VALUE is generated if program is an existing program whose
target does not match target
GL_INVALID_ENUM is generated if target is not one of the allowable val‐
ues.
GL_INVALID_OPERATION is generated if glBindProgramARB is executed
between the execution of glBegin and the corresponding execution of
glEnd.
ASSOCIATED GETS
glGet with argument GL_VERTEX_PROGRAM_ARB or GL_FRAGMENT_PROGRAM_ARB.
SEE ALSO
glDeleteProgramsARB, glGenProgramsARB, glIsProgramARB
11 Mar 04 GLBINDPROGRAM(3gl)