Click or drag to resize

ProgramUse Method

Installs the program object as part of current rendering state.

Namespace:  Ooogles
Assembly:  Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public void Use()
Exceptions
ExceptionCondition
GLExceptionInvalidOperation if the program could not be made part of the current state.
Remarks
Executables for each stage are created in a program object by successfully attaching shader objects to it with AttachShader(Shader), successfully compiling the shader objects with Compile, and successfully linking the program object with Link.

A program object will contain executables that will run on the vertex and fragment processors if it contains one shader object of type Vertex and one shader object of type Fragment that have both been successfully compiled and linked.

While a program object is in use, applications are free to modify attached shader objects, compile attached shader objects, attach shader objects, and detach or delete shader objects. None of these operations will affect the executables that are part of the current state. However, relinking the program object that is currently in use will install the program object as part of the current rendering state if the link operation was successful (see Link). If the program object currently in use is relinked unsuccessfully, its link status will be set to False, but the executables and associated state will remain part of the current state until a subsequent call to Use removes it from use. After it is removed from use, it cannot be made part of current state until it has been successfully relinked.

Note: like texture objects and buffer 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.

Note: applications are responsible for providing the synchronization across API calls when objects are accessed from different execution threads.

OpenGL API: glUseProgram

See Also