'\" t .\" Title: glGetUniformLocation .\" 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 "GLGETUNIFORMLOCATION" "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" glGetUniformLocation \- Returns the location of a uniform variable .SH "C SPECIFICATION" .HP \w'GLint\ glGetUniformLocation('u .BI "GLint glGetUniformLocation(GLuint\ " "program" ", const\ GLchar\ *" "name" ");" .SH "PARAMETERS" .PP \fIprogram\fR .RS 4 Specifies the program object to be queried\&. .RE .PP \fIname\fR .RS 4 Points to a null terminated string containing the name of the uniform variable whose location is to be queried\&. .RE .SH "DESCRIPTION" .PP \fBglGetUniformLocation \fR returns an integer that represents the location of a specific uniform variable within a program object\&. \fIname\fR must be a null terminated string that contains no white space\&. \fIname\fR must be an active uniform variable name in \fIprogram\fR that is not a structure, an array of structures, or a subcomponent of a vector or a matrix\&. This function returns \-1 if \fIname\fR does not correspond to an active uniform variable in \fIprogram\fR, if \fIname\fR starts with the reserved prefix "gl_", or if \fIname\fR is associated with an atomic counter or a named uniform block\&. .PP Uniform variables that are structures or arrays of structures may be queried by calling \fBglGetUniformLocation\fR for each field within the structure\&. The array element operator "[]" and the structure field operator "\&." may be used in \fIname\fR in order to select elements within an array or fields within a structure\&. The result of using these operators is not allowed to be another structure, an array of structures, or a subcomponent of a vector or a matrix\&. Except if the last part of \fIname\fR indicates a uniform variable array, the location of the first element of an array can be retrieved by using the name of the array, or by using the name appended by "[0]"\&. .PP The actual locations assigned to uniform variables are not known until the program object is linked successfully\&. After linking has occurred, the command \fBglGetUniformLocation\fR can be used to obtain the location of a uniform variable\&. This location value can then be passed to \fBglUniform\fR() to set the value of the uniform variable or to \fBglGetUniform\fR() in order to query the current value of the uniform variable\&. After a program object has been linked successfully, the index values for uniform variables remain fixed until the next link command occurs\&. Uniform variable locations and values can only be queried after a link if the link was successful\&. .SH "ERRORS" .PP \fBGL_INVALID_VALUE\fR is generated if \fIprogram\fR is not 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 has not been successfully linked\&. .SH "ASSOCIATED GETS" .PP \fBglGetActiveUniform\fR() with arguments \fIprogram\fR and the index of an active uniform variable .PP \fBglGetProgram\fR() with arguments \fIprogram\fR and \fBGL_ACTIVE_UNIFORMS\fR or \fBGL_ACTIVE_UNIFORM_MAX_LENGTH\fR .PP \fBglGetUniform\fR() with arguments \fIprogram\fR 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{ \fBglGetUniformLocation\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 \fBglLinkProgram\fR(), \fBglUniform\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