'\" t .\" Title: glGetActiveAttrib .\" 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 "GLGETACTIVEATTRIB" "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" glGetActiveAttrib \- Returns information about an active attribute variable for the specified program object .SH "C SPECIFICATION" .HP \w'void\ glGetActiveAttrib('u .BI "void glGetActiveAttrib(GLuint\ " "program" ", GLuint\ " "index" ", GLsizei\ " "bufSize" ", GLsizei\ *" "length" ", GLint\ *" "size" ", GLenum\ *" "type" ", GLchar\ *" "name" ");" .SH "PARAMETERS" .PP \fIprogram\fR .RS 4 Specifies the program object to be queried\&. .RE .PP \fIindex\fR .RS 4 Specifies the index of the attribute variable to be queried\&. .RE .PP \fIbufSize\fR .RS 4 Specifies the maximum number of characters OpenGL is allowed to write in the character buffer indicated by \fIname\fR\&. .RE .PP \fIlength\fR .RS 4 Returns the number of characters actually written by OpenGL in the string indicated by \fIname\fR (excluding the null terminator) if a value other than \fBNULL\fR is passed\&. .RE .PP \fIsize\fR .RS 4 Returns the size of the attribute variable\&. .RE .PP \fItype\fR .RS 4 Returns the data type of the attribute variable\&. .RE .PP \fIname\fR .RS 4 Returns a null terminated string containing the name of the attribute variable\&. .RE .SH "DESCRIPTION" .PP \fBglGetActiveAttrib\fR returns information about an active attribute variable in the program object specified by \fIprogram\fR\&. The number of active attributes can be obtained by calling \fBglGetProgram\fR() with the value \fBGL_ACTIVE_ATTRIBUTES\fR\&. A value of 0 for \fIindex\fR selects the first active attribute variable\&. Permissible values for \fIindex\fR range from zero to the number of active attribute variables minus one\&. .PP A vertex shader may use either built\-in attribute variables, user\-defined attribute variables, or both\&. Built\-in attribute variables have a prefix of "gl_" and reference conventional OpenGL vertex attribtes (e\&.g\&., \fIgl_Vertex\fR, \fIgl_Normal\fR, etc\&., see the OpenGL Shading Language specification for a complete list\&.) User\-defined attribute variables have arbitrary names and obtain their values through numbered generic vertex attributes\&. An attribute variable (either built\-in or user\-defined) is considered active if it is determined during the link operation that it may be accessed during program execution\&. Therefore, \fIprogram\fR should have previously been the target of a call to \fBglLinkProgram\fR(), but it is not necessary for it to have been linked successfully\&. .PP The size of the character buffer required to store the longest attribute variable name in \fIprogram\fR can be obtained by calling \fBglGetProgram\fR() with the value \fBGL_ACTIVE_ATTRIBUTE_MAX_LENGTH\fR\&. This value should be used to allocate a buffer of sufficient size to store the returned attribute name\&. The size of this character buffer is passed in \fIbufSize\fR, and a pointer to this character buffer is passed in \fIname\fR\&. .PP \fBglGetActiveAttrib\fR returns the name of the attribute variable indicated by \fIindex\fR, storing it in the character buffer specified by \fIname\fR\&. The string returned will be null terminated\&. The actual number of characters written into this buffer is returned in \fIlength\fR, and this count does not include the null termination character\&. If the length of the returned string is not required, a value of \fBNULL\fR can be passed in the \fIlength\fR argument\&. .PP The \fItype\fR argument specifies a pointer to a variable into which the attribute variable\*(Aqs data type will be written\&. The symbolic constants \fBGL_FLOAT\fR, \fBGL_FLOAT_VEC2\fR, \fBGL_FLOAT_VEC3\fR, \fBGL_FLOAT_VEC4\fR, \fBGL_FLOAT_MAT2\fR, \fBGL_FLOAT_MAT3\fR, \fBGL_FLOAT_MAT4\fR, \fBGL_FLOAT_MAT2x3\fR, \fBGL_FLOAT_MAT2x4\fR, \fBGL_FLOAT_MAT3x2\fR, \fBGL_FLOAT_MAT3x4\fR, \fBGL_FLOAT_MAT4x2\fR, \fBGL_FLOAT_MAT4x3\fR, \fBGL_INT\fR, \fBGL_INT_VEC2\fR, \fBGL_INT_VEC3\fR, \fBGL_INT_VEC4\fR, \fBGL_UNSIGNED_INT\fR, \fBGL_UNSIGNED_INT_VEC2\fR, \fBGL_UNSIGNED_INT_VEC3\fR, \fBGL_UNSIGNED_INT_VEC4\fR, \fBGL_DOUBLE\fR, \fBGL_DOUBLE_VEC2\fR, \fBGL_DOUBLE_VEC3\fR, \fBGL_DOUBLE_VEC4\fR, \fBGL_DOUBLE_MAT2\fR, \fBGL_DOUBLE_MAT3\fR, \fBGL_DOUBLE_MAT4\fR, \fBGL_DOUBLE_MAT2x3\fR, \fBGL_DOUBLE_MAT2x4\fR, \fBGL_DOUBLE_MAT3x2\fR, \fBGL_DOUBLE_MAT3x4\fR, \fBGL_DOUBLE_MAT4x2\fR, or \fBGL_DOUBLE_MAT4x3\fR may be returned\&. The \fIsize\fR argument will return the size of the attribute, in units of the type returned in \fItype\fR\&. .PP The list of active attribute variables may include both built\-in attribute variables (which begin with the prefix "gl_") as well as user\-defined attribute variable names\&. .PP This function will return as much information as it can about the specified active attribute variable\&. If no information is available, \fIlength\fR will be 0, and \fIname\fR will be an empty string\&. This situation could occur if this function is called after a link operation that failed\&. If an error occurs, the return values \fIlength\fR, \fIsize\fR, \fItype\fR, and \fIname\fR will be unmodified\&. .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_VALUE\fR is generated if \fIindex\fR is greater than or equal to the number of active attribute variables in \fIprogram\fR\&. .PP \fBGL_INVALID_VALUE\fR is generated if \fIbufSize\fR is less than 0\&. .SH "ASSOCIATED GETS" .PP \fBglGet\fR() with argument \fBGL_MAX_VERTEX_ATTRIBS\fR\&. .PP \fBglGetProgram\fR() with argument \fBGL_ACTIVE_ATTRIBUTES\fR or \fBGL_ACTIVE_ATTRIBUTE_MAX_LENGTH\fR\&. .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{ \fBglGetActiveAttrib\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 \fBglBindAttribLocation\fR(), \fBglLinkProgram\fR(), \fBglVertexAttrib\fR(), \fBglVertexAttribPointer\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