'\" t .\" Title: glUseProgram .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 01/03/2018 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" .TH "GLUSEPROGRAM" "3G" "01/03/2018" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" glUseProgram \- Installs a program object as part of current rendering state .SH "C SPECIFICATION" .HP \w'void\ glUseProgram('u .BI "void glUseProgram(GLuint\ " "program" ");" .SH "PARAMETERS" .PP \fIprogram\fR .RS 4 Specifies the handle of the program object whose executables are to be used as part of current rendering state\&. .RE .SH "DESCRIPTION" .PP \fBglUseProgram\fR installs the program object specified by \fIprogram\fR as part of current rendering state\&. One or more executables are created in a program object by successfully attaching shader objects to it with \fBglAttachShader\fR(), successfully compiling the shader objects with \fBglCompileShader\fR(), and successfully linking the program object with \fBglLinkProgram\fR()\&. .PP A program object will contain an executable that will run on the vertex processor if it contains one or more shader objects of type \fBGL_VERTEX_SHADER\fR that have been successfully compiled and linked\&. A program object will contain an executable that will run on the geometry processor if it contains one or more shader objects of type \fBGL_GEOMETRY_SHADER\fR that have been successfully compiled and linked\&. Similarly, a program object will contain an executable that will run on the fragment processor if it contains one or more shader objects of type \fBGL_FRAGMENT_SHADER\fR that have been successfully compiled and linked\&. .PP While a program object is in use, applications are free to modify attached shader objects, compile attached shader objects, attach additional 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 \fBglLinkProgram\fR() )\&. If the program object currently in use is relinked unsuccessfully, its link status will be set to \fBGL_FALSE\fR, but the executables and associated state will remain part of the current state until a subsequent call to \fBglUseProgram\fR removes it from use\&. After it is removed from use, it cannot be made part of current state until it has been successfully relinked\&. .PP If \fIprogram\fR is zero, then the current rendering state refers to an \fIinvalid\fR program object and the results of shader execution are undefined\&. However, this is not an error\&. .PP If \fIprogram\fR does not contain shader objects of type \fBGL_FRAGMENT_SHADER\fR, an executable will be installed on the vertex, and possibly geometry processors, but the results of fragment shader execution will be undefined\&. .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 \fBGL_INVALID_VALUE\fR is generated if \fIprogram\fR is neither 0 nor a value generated by OpenGL\&. .PP \fBGL_INVALID_OPERATION\fR is generated if \fIprogram\fR is not a program object\&. .PP \fBGL_INVALID_OPERATION\fR is generated if \fIprogram\fR could not be made part of current state\&. .PP \fBGL_INVALID_OPERATION\fR is generated if transform feedback mode is active\&. .SH "ASSOCIATED GETS" .PP \fBglGet\fR() with the argument \fBGL_CURRENT_PROGRAM\fR .PP \fBglGetActiveAttrib\fR() with a valid program object and the index of an active attribute variable .PP \fBglGetActiveUniform\fR() with a valid program object and the index of an active uniform variable .PP \fBglGetAttachedShaders\fR() with a valid program object .PP \fBglGetAttribLocation\fR() with a valid program object and the name of an attribute variable .PP \fBglGetProgram\fR() with a valid program object and the parameter to be queried .PP \fBglGetProgramInfoLog\fR() with a valid program object .PP \fBglGetUniform\fR() with a valid program object and the location of a uniform variable .PP \fBglGetUniformLocation\fR() with a valid program object and the name of a uniform variable .PP \fBglIsProgram\fR() .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{ \fBOpenGL Version\fR T} T{ \fBFunction / Feature Name\fR T}:T{ \fB2\&.0\fR T}:T{ \fB2\&.1\fR T}:T{ \fB3\&.0\fR T}:T{ \fB3\&.1\fR T}:T{ \fB3\&.2\fR T}:T{ \fB3\&.3\fR T}:T{ \fB4\&.0\fR T}:T{ \fB4\&.1\fR T}:T{ \fB4\&.2\fR T}:T{ \fB4\&.3\fR T}:T{ \fB4\&.4\fR T}:T{ \fB4\&.5\fR T} .T& l c c c c c c c c c c c c. T{ \fBglUseProgram\fR 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} .TE .sp 1 .SH "SEE ALSO" .PP \fBglAttachShader\fR(), \fBglBindAttribLocation\fR(), \fBglCompileShader\fR(), \fBglCreateProgram\fR(), \fBglDeleteProgram\fR(), \fBglDetachShader\fR(), \fBglLinkProgram\fR(), \fBglUniform\fR(), \fBglValidateProgram\fR(), \fBglVertexAttrib\fR() .SH "COPYRIGHT" .PP Copyright \(co 2003\-2005 3Dlabs Inc\&. Ltd\&. Copyright \(co 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\&. \m[blue]\fBhttp://opencontent\&.org/openpub/\fR\m[]\&. .SH "COPYRIGHT" .br Copyright \(co 2003-2005 3Dlabs Inc. Ltd. .br Copyright \(co 2010-2014 Khronos Group .br