'\" t .\" Title: glAttachShader .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 05/21/2015 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" .TH "GLATTACHSHADER" "3G" "05/21/2015" "[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" glAttachShader \- Attaches a shader object to a program object .SH "C SPECIFICATION" .HP \w'void\ glAttachShader('u .BI "void glAttachShader(GLuint\ " "program" ", GLuint\ " "shader" ");" .SH "PARAMETERS" .PP \fIprogram\fR .RS 4 Specifies the program object to which a shader object will be attached\&. .RE .PP \fIshader\fR .RS 4 Specifies the shader object that is to be attached\&. .RE .SH "DESCRIPTION" .PP In order to create a complete shader program, there must be a way to specify the list of things that will be linked together\&. Program objects provide this mechanism\&. Shaders that are to be linked together in a program object must first be attached to that program object\&. \fBglAttachShader\fR attaches the shader object specified by \fIshader\fR to the program object specified by \fIprogram\fR\&. This indicates that \fIshader\fR will be included in link operations that will be performed on \fIprogram\fR\&. .PP All operations that can be performed on a shader object are valid whether or not the shader object is attached to a program object\&. It is permissible to attach a shader object to a program object before source code has been loaded into the shader object or before the shader object has been compiled\&. It is permissible to attach multiple shader objects of the same type because each may contain a portion of the complete shader\&. It is also permissible to attach a shader object to more than one program object\&. If a shader object is deleted while it is attached to a program object, it will be flagged for deletion, and deletion will not occur until \fBglDetachShader\fR() is called to detach it from all program objects to which it is attached\&. .SH "ERRORS" .PP \fBGL_INVALID_VALUE\fR is generated if either \fIprogram\fR or \fIshader\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 \fIshader\fR is not a shader object\&. .PP \fBGL_INVALID_OPERATION\fR is generated if \fIshader\fR is already attached to \fIprogram\fR\&. .SH "ASSOCIATED GETS" .PP \fBglGetAttachedShaders\fR() with the handle of a valid program object .PP \fBglGetShaderInfoLog\fR() .PP \fBglGetShaderSource\fR() .PP \fBglIsProgram\fR() .PP \fBglIsShader\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{ \fBglAttachShader\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 .SH "SEE ALSO" .PP \fBglCompileShader\fR(), \fBglCreateShader\fR(), \fBglDeleteShader\fR(), \fBglDetachShader\fR(), \fBglLinkProgram\fR(), \fBglShaderSource\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