| 1 | <?xml version="1.0" encoding="UTF-8"?>\r |
| 2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"\r |
| 3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">\r |
| 4 | <refentry id="glBindVertexArray">\r |
| 5 | <refmeta>\r |
| 6 | <refmetainfo>\r |
| 7 | <copyright>\r |
| 8 | <year>2010</year>\r |
| 9 | <holder>Khronos Group</holder>\r |
| 10 | </copyright>\r |
| 11 | </refmetainfo>\r |
| 12 | <refentrytitle>glBlitFramebuffer</refentrytitle>\r |
| 13 | <manvolnum>3G</manvolnum>\r |
| 14 | </refmeta>\r |
| 15 | <refnamediv>\r |
| 16 | <refname>glBlitFramebuffer</refname>\r |
| 17 | <refpurpose>copy a block of pixels from the read framebuffer to the draw framebuffer</refpurpose>\r |
| 18 | </refnamediv>\r |
| 19 | <refsynopsisdiv><title>C Specification</title>\r |
| 20 | <funcsynopsis>\r |
| 21 | <funcprototype>\r |
| 22 | <funcdef>void <function>glBlitFramebuffer</function></funcdef>\r |
| 23 | <paramdef>GLint <parameter>srcX0</parameter></paramdef>\r |
| 24 | <paramdef>GLint <parameter>srcY0</parameter></paramdef>\r |
| 25 | <paramdef>GLint <parameter>srcX1</parameter></paramdef>\r |
| 26 | <paramdef>GLint <parameter>srcY1</parameter></paramdef>\r |
| 27 | <paramdef>GLint <parameter>dstX0</parameter></paramdef>\r |
| 28 | <paramdef>GLint <parameter>dstY0</parameter></paramdef>\r |
| 29 | <paramdef>GLint <parameter>dstX1</parameter></paramdef>\r |
| 30 | <paramdef>GLint <parameter>dstY1</parameter></paramdef>\r |
| 31 | <paramdef>GLbitfield <parameter>mask</parameter></paramdef>\r |
| 32 | <paramdef>GLenum <parameter>filter</parameter></paramdef>\r |
| 33 | </funcprototype>\r |
| 34 | </funcsynopsis>\r |
| 35 | </refsynopsisdiv>\r |
| 36 | <refsect1 id="parameters"><title>Parameters</title>\r |
| 37 | <variablelist>\r |
| 38 | <varlistentry>\r |
| 39 | <term><parameter>srcX0</parameter></term>\r |
| 40 | <term><parameter>srcY0</parameter></term>\r |
| 41 | <term><parameter>srcX1</parameter></term>\r |
| 42 | <term><parameter>srcY1</parameter></term>\r |
| 43 | <listitem>\r |
| 44 | <para>\r |
| 45 | Specify the bounds of the source rectangle within the read buffer of the read framebuffer.\r |
| 46 | </para>\r |
| 47 | </listitem>\r |
| 48 | </varlistentry>\r |
| 49 | <varlistentry>\r |
| 50 | <term><parameter>dstX0</parameter></term>\r |
| 51 | <term><parameter>dstY0</parameter></term>\r |
| 52 | <term><parameter>dstX1</parameter></term>\r |
| 53 | <term><parameter>dstY1</parameter></term>\r |
| 54 | <listitem>\r |
| 55 | <para>\r |
| 56 | Specify the bounds of the destination rectangle within the write buffer of the write framebuffer.\r |
| 57 | </para>\r |
| 58 | </listitem>\r |
| 59 | </varlistentry>\r |
| 60 | <varlistentry>\r |
| 61 | <term><parameter>mask</parameter></term>\r |
| 62 | <listitem>\r |
| 63 | <para>\r |
| 64 | The bitwise OR of the flags indicating which buffers are to be copied. The allowed flags are\r |
| 65 | <constant>GL_COLOR_BUFFER_BIT</constant>, <constant>GL_DEPTH_BUFFER_BIT</constant> and <constant>GL_STENCIL_BUFFER_BIT</constant>.\r |
| 66 | </para>\r |
| 67 | </listitem>\r |
| 68 | </varlistentry>\r |
| 69 | <varlistentry>\r |
| 70 | <term><parameter>filter</parameter></term>\r |
| 71 | <listitem>\r |
| 72 | <para>\r |
| 73 | Specifies the interpolation to be applied if the image is stretched. Must be <constant>GL_NEAREST</constant> or <constant>GL_LINEAR</constant>.\r |
| 74 | </para>\r |
| 75 | </listitem>\r |
| 76 | </varlistentry>\r |
| 77 | </variablelist>\r |
| 78 | </refsect1>\r |
| 79 | <refsect1 id="description"><title>Description</title>\r |
| 80 | <para>\r |
| 81 | <function>glBlitFramebuffer</function> transfers a rectangle of pixel values from one region of the read framebuffer to another region in\r |
| 82 | the draw framebuffer. <parameter>mask</parameter> is the bitwise OR of a number of values indicating which buffers are\r |
| 83 | to be copied. The values are <constant>GL_COLOR_BUFFER_BIT</constant>, <constant>GL_DEPTH_BUFFER_BIT</constant>, and\r |
| 84 | <constant>GL_STENCIL_BUFFER_BIT</constant>. The pixels corresponding to these buffers are copied from the source rectangle bounded by the\r |
| 85 | locations (<parameter>srcX0</parameter>; <parameter>srcY0</parameter>) and (<parameter>srcX1</parameter>; <parameter>srcY1</parameter>)\r |
| 86 | to the destination rectangle bounded by the locations (<parameter>dstX0</parameter>; <parameter>dstY0</parameter>) and\r |
| 87 | (<parameter>dstX1</parameter>; <parameter>dstY1</parameter>). The lower bounds of the rectangle are inclusive, while the upper\r |
| 88 | bounds are exclusive.\r |
| 89 | </para>\r |
| 90 | <para>\r |
| 91 | The actual region taken from the read framebuffer is limited to the intersection of the source buffers being transferred, which may\r |
| 92 | include the color buffer selected by the read buffer, the depth buffer, and/or the stencil buffer depending on mask. The actual region\r |
| 93 | written to the draw framebuffer is limited to the intersection of the destination buffers being written, which may include multiple draw\r |
| 94 | buffers, the depth buffer, and/or the stencil buffer depending on mask. Whether or not the source or destination regions are altered due\r |
| 95 | to these limits, the scaling and offset applied to pixels being transferred is performed as though no such limits were present.\r |
| 96 | </para>\r |
| 97 | <para>\r |
| 98 | If the sizes of the source and destination rectangles are not equal, <parameter>filter</parameter> specifies the interpolation method that\r |
| 99 | will be applied to resize the source image , and must be <constant>GL_NEAREST</constant> or <constant>GL_LINEAR</constant>.\r |
| 100 | <constant>GL_LINEAR</constant> is only a valid interpolation method for the color buffer. If <parameter>filter</parameter> is not\r |
| 101 | <constant>GL_NEAREST</constant> and <parameter>mask</parameter> includes <constant>GL_DEPTH_BUFFER_BIT</constant> or\r |
| 102 | <constant>GL_STENCIL_BUFFER_BIT</constant>, no data is transferred and a <constant>GL_INVALID_OPERATION</constant> error is generated.\r |
| 103 | </para>\r |
| 104 | <para>\r |
| 105 | If <parameter>filter</parameter> is <constant>GL_LINEAR</constant> and the source rectangle would require sampling outside the bounds of\r |
| 106 | the source framebuffer, values are read as if the <constant>GL_CLAMP_TO_EDGE</constant> texture wrapping mode were applied.\r |
| 107 | </para>\r |
| 108 | <para>\r |
| 109 | When the color buffer is transferred, values are taken from the read buffer of the read framebuffer and written to each of the draw\r |
| 110 | buffers of the draw framebuffer.\r |
| 111 | </para>\r |
| 112 | <para>\r |
| 113 | If the source and destination rectangles overlap or are the same, and the read and draw buffers are the same, the result of the operation\r |
| 114 | is undefined.\r |
| 115 | </para>\r |
| 116 | </refsect1>\r |
| 117 | <refsect1 id="errors"><title>Errors</title>\r |
| 118 | <para>\r |
| 119 | <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>mask</parameter> contains any of the <constant>GL_DEPTH_BUFFER_BIT</constant>\r |
| 120 | or <constant>GL_STENCIL_BUFFER_BIT</constant> and <parameter>filter</parameter> is not <constant>GL_NEAREST</constant>.\r |
| 121 | </para>\r |
| 122 | <para>\r |
| 123 | <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>mask</parameter> contains <constant>GL_COLOR_BUFFER_BIT</constant>\r |
| 124 | and any of the following conditions hold:\r |
| 125 | <itemizedlist>\r |
| 126 | <listitem>\r |
| 127 | <para>The read buffer contains fixed-point or floating-point values and any draw buffer contains\r |
| 128 | neither fixed-point nor floating-point values.</para>\r |
| 129 | </listitem>\r |
| 130 | <listitem>\r |
| 131 | <para>The read buffer contains unsigned integer values and any draw buffer does not contain unsigned\r |
| 132 | integer values.</para>\r |
| 133 | </listitem>\r |
| 134 | <listitem>\r |
| 135 | <para>The read buffer contains signed integer values and any draw buffer does not contain signed integer values.</para>\r |
| 136 | </listitem>\r |
| 137 | </itemizedlist>\r |
| 138 | </para>\r |
| 139 | <para>\r |
| 140 | <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>mask</parameter> contains <constant>GL_DEPTH_BUFFER_BIT</constant> or\r |
| 141 | <constant>GL_STENCIL_BUFFER_BIT</constant> and the source and destination depth and stencil formats do not match.\r |
| 142 | </para>\r |
| 143 | <para>\r |
| 144 | <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>filter</parameter> is <constant>GL_LINEAR</constant> and the read buffer\r |
| 145 | contains integer data.\r |
| 146 | </para>\r |
| 147 | <para>\r |
| 148 | <constant>GL_INVALID_OPERATION</constant> is generated if the value of <parameter>GL_SAMPLES</parameter> for the read and draw buffers is\r |
| 149 | not identical.\r |
| 150 | </para>\r |
| 151 | <para>\r |
| 152 | <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>GL_SAMPLE_BUFFERS</parameter> for both read and draw buffers greater than\r |
| 153 | zero and the dimensions of the source and destination rectangles is not identical.\r |
| 154 | </para>\r |
| 155 | <para>\r |
| 156 | <constant>GL_INVALID_FRAMEBUFFER_OPERATION</constant> is generated if the objects bound to <constant>GL_DRAW_FRAMEBUFFER_BINDING</constant>\r |
| 157 | or <constant>GL_READ_FRAMEBUFFER_BINDING</constant> are not framebuffer complete.\r |
| 158 | </para>\r |
| 159 | </refsect1>\r |
| 160 | <refsect1 id="seealso"><title>See Also</title>\r |
| 161 | <para>\r |
| 162 | <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry>\r |
| 163 | <citerefentry><refentrytitle>glCheckFramebufferStatus</refentrytitle></citerefentry>,\r |
| 164 | <citerefentry><refentrytitle>glGenFramebuffers</refentrytitle></citerefentry>\r |
| 165 | <citerefentry><refentrytitle>glBindFramebuffer</refentrytitle></citerefentry>\r |
| 166 | <citerefentry><refentrytitle>glDeleteFramebuffers</refentrytitle></citerefentry>\r |
| 167 | </para>\r |
| 168 | </refsect1>\r |
| 169 | <refsect1 id="Copyright"><title>Copyright</title>\r |
| 170 | <para>\r |
| 171 | Copyright <trademark class="copyright"></trademark> 2010 Khronos Group.\r |
| 172 | This material may be distributed subject to the terms and conditions set forth in\r |
| 173 | the Open Publication License, v 1.0, 8 June 1999.\r |
| 174 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r |
| 175 | </para>\r |
| 176 | </refsect1>\r |
| 177 | </refentry>\r |