File: glDrawBuffer.xml

package info (click to toggle)
khronos-opengl-man4 1.0~svn33624-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 6,344 kB
  • sloc: xml: 93,066; makefile: 730; python: 627; sh: 50; php: 4
file content (277 lines) | stat: -rw-r--r-- 10,421 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<!DOCTYPE refentry [ <!ENTITY % mathent SYSTEM "math.ent"> %mathent; ]>

<!-- Converted by db4-upgrade version 1.1 -->

<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="glDrawBuffer">
    <info>
    <copyright>
      <year>1991-2006</year>

      <holder>Silicon Graphics, Inc.</holder>
    </copyright>

    <copyright>
      <year>2010-2014</year>

      <holder>Khronos Group</holder>
    </copyright>
  </info>

  <refmeta>
    <refentrytitle>glDrawBuffer</refentrytitle>

    <manvolnum>3G</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>glDrawBuffer</refname>

    <refname>glNamedFramebufferDrawBuffer</refname>

    <refpurpose>specify which color buffers are to be drawn into</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <title>C Specification</title>

    <funcsynopsis>
      <funcprototype>
        <funcdef>void <function>glDrawBuffer</function></funcdef>

        <paramdef>GLenum <parameter>buf</parameter></paramdef>
      </funcprototype>

      <funcprototype>
        <funcdef>void <function>glNamedFramebufferDrawBuffer</function></funcdef>

        <paramdef>GLuint <parameter>framebuffer</parameter></paramdef>

        <paramdef>GLenum <parameter>buf</parameter></paramdef>
      </funcprototype>
    </funcsynopsis>
  </refsynopsisdiv>

  <refsect1 xml:id="parameters">
    <title>Parameters</title>

    <variablelist>
      <varlistentry>
        <term><parameter>framebuffer</parameter></term>

        <listitem>
          <para>Specifies the name of the framebuffer object for
          <function>glNamedFramebufferDrawBuffer</function> function. Must be
          zero or the name of a framebuffer object.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><parameter>buf</parameter></term>

        <listitem>
          <para>For default framebuffer, the argument specifies up to four
          color buffers to be drawn into. Symbolic constants
          <constant>GL_NONE</constant>, <constant>GL_FRONT_LEFT</constant>,
          <constant>GL_FRONT_RIGHT</constant>,
          <constant>GL_BACK_LEFT</constant>,
          <constant>GL_BACK_RIGHT</constant>, <constant>GL_FRONT</constant>,
          <constant>GL_BACK</constant>, <constant>GL_LEFT</constant>,
          <constant>GL_RIGHT</constant>, and
          <constant>GL_FRONT_AND_BACK</constant> are accepted. The initial
          value is <constant>GL_FRONT</constant> for single-buffered contexts,
          and <constant>GL_BACK</constant> for double-buffered contexts. For
          framebuffer objects, <constant>GL_COLOR_ATTACHMENT$m$</constant> and
          <constant>GL_NONE</constant> enums are accepted, where
          <constant>$m$</constant> is a value between 0 and
          <constant>GL_MAX_COLOR_ATTACHMENTS</constant>.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1 xml:id="description">
    <title>Description</title>

    <para>When colors are written to the frame buffer, they are written into
    the color buffers specified by <function>glDrawBuffer</function>. One of
    the following values can be used for default framebuffer:</para>

    <variablelist>
      <varlistentry>
        <term><constant>GL_NONE</constant></term>

        <listitem>
          <para>No color buffers are written.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><constant>GL_FRONT_LEFT</constant></term>

        <listitem>
          <para>Only the front left color buffer is written.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><constant>GL_FRONT_RIGHT</constant></term>

        <listitem>
          <para>Only the front right color buffer is written.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><constant>GL_BACK_LEFT</constant></term>

        <listitem>
          <para>Only the back left color buffer is written.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><constant>GL_BACK_RIGHT</constant></term>

        <listitem>
          <para>Only the back right color buffer is written.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><constant>GL_FRONT</constant></term>

        <listitem>
          <para>Only the front left and front right color buffers are written.
          If there is no front right color buffer, only the front left color
          buffer is written.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><constant>GL_BACK</constant></term>

        <listitem>
          <para>Only the back left and back right color buffers are written.
          If there is no back right color buffer, only the back left color
          buffer is written.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><constant>GL_LEFT</constant></term>

        <listitem>
          <para>Only the front left and back left color buffers are written.
          If there is no back left color buffer, only the front left color
          buffer is written.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><constant>GL_RIGHT</constant></term>

        <listitem>
          <para>Only the front right and back right color buffers are written.
          If there is no back right color buffer, only the front right color
          buffer is written.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><constant>GL_FRONT_AND_BACK</constant></term>

        <listitem>
          <para>All the front and back color buffers (front left, front right,
          back left, back right) are written. If there are no back color
          buffers, only the front left and front right color buffers are
          written. If there are no right color buffers, only the front left
          and back left color buffers are written. If there are no right or
          back color buffers, only the front left color buffer is
          written.</para>
        </listitem>
      </varlistentry>
    </variablelist>

    <para>If more than one color buffer is selected for drawing, then blending
    or logical operations are computed and applied independently for each
    color buffer and can produce different results in each buffer.</para>

    <para>Monoscopic contexts include only <emphasis>left</emphasis> buffers,
    and stereoscopic contexts include both <emphasis>left</emphasis> and
    <emphasis>right</emphasis> buffers. Likewise, single-buffered contexts
    include only <emphasis>front</emphasis> buffers, and double-buffered
    contexts include both <emphasis>front</emphasis> and
    <emphasis>back</emphasis> buffers. The context is selected at GL
    initialization.</para>

    <para>For framebuffer objects, <constant>GL_COLOR_ATTACHMENT$m$</constant>
    and <constant>GL_NONE</constant> enums are accepted, where
    <constant>$m$</constant> is a value between 0 and
    <constant>GL_MAX_COLOR_ATTACHMENTS</constant>. glDrawBuffer will set the
    draw buffer for fragment colors other than zero to
    <constant>GL_NONE</constant>.</para>
  </refsect1>

  <refsect1 xml:id="errors">
    <title>Errors</title>

    <para><constant>GL_INVALID_OPERATION</constant> error is generated by
    <function>glNamedFramebufferDrawBuffer</function> if
    <parameter>framebuffer</parameter> is not zero or the name of an existing
    framebuffer object.</para>

    <para><constant>GL_INVALID_ENUM</constant> is generated if
    <parameter>buf</parameter> is not an accepted value.</para>

    <para><constant>GL_INVALID_OPERATION</constant> is generated if the
    default framebuffer is affected and none of the buffers indicated by
    <parameter>buf</parameter> exists.</para>

    <para><constant>GL_INVALID_OPERATION</constant> is generated if a
    framebuffer object is affected and <parameter>buf</parameter> is not equal
    to <constant>GL_NONE</constant> or
    <constant>GL_COLOR_ATTACHMENT$m$</constant>, where
    <constant>$m$</constant> is a value between 0 and
    <constant>GL_MAX_COLOR_ATTACHMENTS</constant>.</para>
  </refsect1>
    <refsect1 xml:id="associatedgets"><title>Associated Gets</title>
        <para>
            <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_DRAW_BUFFER</constant>
        </para>
    </refsect1>
    <refsect1 xml:id="versions"><title>Version Support</title>
        <informaltable>
            <tgroup cols="13" align="left">
                <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apifunchead.xml" xpointer="xpointer(/*/*)"/>
                <tbody>
                    <row>
                        <entry><function>glDrawBuffer</function></entry>
                        <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='20']/*)"/>
                    </row>
                    <row>
                        <entry><function>glNamedFramebufferDrawBuffer</function></entry>
                        <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='45']/*)"/>
                    </row>
                </tbody>
            </tgroup>
        </informaltable>
    </refsect1>
    <refsect1 xml:id="seealso"><title>See Also</title>
        <para>
            <citerefentry><refentrytitle>glBlendFunc</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glColorMask</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glDrawBuffers</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glLogicOp</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glReadBuffer</refentrytitle></citerefentry>
        </para>
    </refsect1>
    <refsect1 xml:id="Copyright"><title>Copyright</title>
        <para>
            Copyright <trademark class="copyright"/> 1991-2006 Silicon Graphics, Inc.
            Copyright <trademark class="copyright"/> 2010-2014 Khronos Group.
            This document is licensed under the SGI Free Software B License.
            For details, see
            <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</link>.
        </para>
    </refsect1>
</refentry>