'\" t .\" Title: glDrawBuffers .\" 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 "GLDRAWBUFFERS" "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" glDrawBuffers, glNamedFramebufferDrawBuffers \- Specifies a list of color buffers to be drawn into .SH "C SPECIFICATION" .HP \w'void\ glDrawBuffers('u .BI "void glDrawBuffers(GLsizei\ " "n" ", const\ GLenum\ *" "bufs" ");" .HP \w'void\ glNamedFramebufferDrawBuffers('u .BI "void glNamedFramebufferDrawBuffers(GLuint\ " "framebuffer" ", GLsizei\ " "n" ", const\ GLenum\ *" "bufs" ");" .SH "PARAMETERS" .PP \fIframebuffer\fR .RS 4 Specifies the name of the framebuffer object for \fBglNamedFramebufferDrawBuffers\fR\&. .RE .PP \fIn\fR .RS 4 Specifies the number of buffers in \fIbufs\fR\&. .RE .PP \fIbufs\fR .RS 4 Points to an array of symbolic constants specifying the buffers into which fragment colors or data values will be written\&. .RE .SH "DESCRIPTION" .PP \fBglDrawBuffers\fR and \fBglNamedFramebufferDrawBuffers\fR define an array of buffers into which outputs from the fragment shader data will be written\&. If a fragment shader writes a value to one or more user defined output variables, then the value of each variable will be written into the buffer specified at a location within \fIbufs\fR corresponding to the location assigned to that user defined output\&. The draw buffer used for user defined outputs assigned to locations greater than or equal to \fIn\fR is implicitly set to \fBGL_NONE\fR and any data written to such an output is discarded\&. .PP For \fBglDrawBuffers\fR, the framebuffer object that is bound to the \fBGL_DRAW_FRAMEBUFFER\fR binding will be used\&. For \fBglNamedFramebufferDrawBuffers\fR, \fIframebuffer\fR is the name of the framebuffer object\&. If \fIframebuffer\fR is zero, then the default framebuffer is affected\&. .PP The symbolic constants contained in \fIbufs\fR may be any of the following: .PP \fBGL_NONE\fR .RS 4 The fragment shader output value is not written into any color buffer\&. .RE .PP \fBGL_FRONT_LEFT\fR .RS 4 The fragment shader output value is written into the front left color buffer\&. .RE .PP \fBGL_FRONT_RIGHT\fR .RS 4 The fragment shader output value is written into the front right color buffer\&. .RE .PP \fBGL_BACK_LEFT\fR .RS 4 The fragment shader output value is written into the back left color buffer\&. .RE .PP \fBGL_BACK_RIGHT\fR .RS 4 The fragment shader output value is written into the back right color buffer\&. .RE .PP \fBGL_COLOR_ATTACHMENT\fR\fIn\fR .RS 4 The fragment shader output value is written into the \fIn\fRth color attachment of the current framebuffer\&. \fIn\fR may range from zero to the value of \fBGL_MAX_COLOR_ATTACHMENTS\fR\&. .RE .PP Except for \fBGL_NONE\fR, the preceding symbolic constants may not appear more than once in \fIbufs\fR\&. The maximum number of draw buffers supported is implementation dependent and can be queried by calling \fBglGet\fR() with the argument \fBGL_MAX_DRAW_BUFFERS\fR\&. .SH "NOTES" .PP The symbolic constants \fBGL_FRONT\fR, \fBGL_BACK\fR, \fBGL_LEFT\fR, \fBGL_RIGHT\fR, and \fBGL_FRONT_AND_BACK\fR are not allowed in the \fIbufs\fR array since they may refer to multiple buffers\&. .PP If a fragment shader does not write to a user defined output variable, the values of the fragment colors following shader execution are undefined\&. For each fragment generated in this situation, a different value may be written into each of the buffers specified by \fIbufs\fR\&. .SH "ERRORS" .PP \fBGL_INVALID_OPERATION\fR error is generated by \fBglNamedFramebufferDrawBuffers\fR if \fIframebuffer\fR is not zero or the name of an existing framebuffer object\&. .PP \fBGL_INVALID_ENUM\fR is generated if one of the values in \fIbufs\fR is not an accepted value\&. .PP \fBGL_INVALID_ENUM\fR is generated if the API call refers to the default framebuffer and one or more of the values in \fIbufs\fR is one of the \fBGL_COLOR_ATTACHMENT\fR\fIn\fR tokens\&. .PP \fBGL_INVALID_ENUM\fR is generated if the API call refers to a framebuffer object and one or more of the values in \fIbufs\fR is anything other than \fBGL_NONE\fR or one of the \fBGL_COLOR_ATTACHMENT\fR\fIn\fR tokens\&. .PP \fBGL_INVALID_ENUM\fR is generated if \fIn\fR is less than 0\&. .PP \fBGL_INVALID_OPERATION\fR is generated if a symbolic constant other than \fBGL_NONE\fR appears more than once in \fIbufs\fR\&. .PP \fBGL_INVALID_OPERATION\fR is generated if any of the entries in \fIbufs\fR (other than \fBGL_NONE\fR ) indicates a color buffer that does not exist in the current GL context\&. .PP \fBGL_INVALID_OPERATION\fR is generated if any value in \fIbufs\fR is \fBGL_BACK\fR, and \fIn\fR is not one\&. .PP \fBGL_INVALID_VALUE\fR is generated if \fIn\fR is greater than \fBGL_MAX_DRAW_BUFFERS\fR\&. .SH "ASSOCIATED GETS" .PP \fBglGet\fR() with argument \fBGL_MAX_DRAW_BUFFERS\fR .PP \fBglGet\fR() with argument \fBGL_DRAW_BUFFER\fR\fIi\fR where \fIi\fR indicates the number of the draw buffer whose value is to be queried .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 l c c c c c c c c c c c c. T{ \fBglDrawBuffers\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} T{ \fBglNamedFramebufferDrawBuffers\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 \fBglBlendFunc\fR(), \fBglColorMask\fR(), \fBglDrawBuffers\fR(), \fBglLogicOp\fR(), \fBglReadBuffer\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