'\" t .\" Title: glGetUniform .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 05/30/2012 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" .TH "GLGETUNIFORM" "3G" "05/30/2012" "[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" glGetUniformfv, glGetUniformiv \- Returns the value of a uniform variable .SH "C SPECIFICATION" .HP \w'void\ glGetUniformfv('u .BI "void glGetUniformfv(GLuint\ " "program" ", GLint\ " "location" ", GLfloat\ *" "params" ");" .HP \w'void\ glGetUniformiv('u .BI "void glGetUniformiv(GLuint\ " "program" ", GLint\ " "location" ", GLint\ *" "params" ");" .SH "PARAMETERS" .PP \fIprogram\fR .RS 4 Specifies the program object to be queried\&. .RE .PP \fIlocation\fR .RS 4 Specifies the location of the uniform variable to be queried\&. .RE .PP \fIparams\fR .RS 4 Returns the value of the specified uniform variable\&. .RE .SH "DESCRIPTION" .PP \fBglGetUniform\fR returns in \fIparams\fR the value(s) of the specified uniform variable\&. The type of the uniform variable specified by \fIlocation\fR determines the number of values returned\&. If the uniform variable is defined in the shader as a boolean, int, or float, a single value will be returned\&. If it is defined as a vec2, ivec2, or bvec2, two values will be returned\&. If it is defined as a vec3, ivec3, or bvec3, three values will be returned, and so on\&. To query values stored in uniform variables declared as arrays, call \fBglGetUniform\fR for each element of the array\&. To query values stored in uniform variables declared as structures, call \fBglGetUniform\fR for each field in the structure\&. The values for uniform variables declared as a matrix will be returned in column major order\&. .PP The locations assigned to uniform variables are not known until the program object is linked\&. 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 \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\&. The uniform variable values can only be queried after a link if the link was successful\&. .SH "NOTES" .PP If an error is generated, no change is made to the contents of \fIparams\fR\&. .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\&. .PP \fBGL_INVALID_OPERATION\fR is generated if \fIlocation\fR does not correspond to a valid uniform variable location for the specified program object\&. .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 \fBglGetUniformLocation\fR() with arguments \fIprogram\fR and the name of a uniform variable .PP \fBglIsProgram\fR() .SH "SEE ALSO" .PP \fBglCreateProgram\fR(), \fBglLinkProgram\fR(), \fBglUniform\fR() .SH "COPYRIGHT" .PP Copyright \(co 2003\-2005 3Dlabs Inc\&. Ltd\&. 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[]\&.