rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man3 / glFramebufferTexture.xml
CommitLineData
7faf1d71
AW
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="glFramebufferTexture">\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>glFramebufferTexture</refentrytitle>\r
13 <manvolnum>3G</manvolnum>\r
14 </refmeta>\r
15 <refnamediv>\r
16 <refname>glFramebufferTexture</refname>\r
17 <refpurpose>attach a level of a texture object as a logical buffer to the currently bound framebuffer object</refpurpose>\r
18 </refnamediv>\r
19 <refsynopsisdiv><title>C Specification</title>\r
20 <funcsynopsis>\r
21 <funcprototype>\r
22 <funcdef>void <function>glFramebufferTexture</function></funcdef>\r
23 <paramdef>GLenum <parameter>target</parameter></paramdef>\r
24 <paramdef>GLenum <parameter>attachment</parameter></paramdef>\r
25 <paramdef>GLuint <parameter>texture</parameter></paramdef>\r
26 <paramdef>GLint <parameter>level</parameter></paramdef>\r
27 </funcprototype>\r
28 <funcprototype>\r
29 <funcdef>void <function>glFramebufferTexture1D</function></funcdef>\r
30 <paramdef>GLenum <parameter>target</parameter></paramdef>\r
31 <paramdef>GLenum <parameter>attachment</parameter></paramdef>\r
32 <paramdef>GLenum <parameter>textarget</parameter></paramdef>\r
33 <paramdef>GLuint <parameter>texture</parameter></paramdef>\r
34 <paramdef>GLint <parameter>level</parameter></paramdef>\r
35 </funcprototype>\r
36 <funcprototype>\r
37 <funcdef>void <function>glFramebufferTexture2D</function></funcdef>\r
38 <paramdef>GLenum <parameter>target</parameter></paramdef>\r
39 <paramdef>GLenum <parameter>attachment</parameter></paramdef>\r
40 <paramdef>GLenum <parameter>textarget</parameter></paramdef>\r
41 <paramdef>GLuint <parameter>texture</parameter></paramdef>\r
42 <paramdef>GLint <parameter>level</parameter></paramdef>\r
43 </funcprototype>\r
44 <funcprototype>\r
45 <funcdef>void <function>glFramebufferTexture3D</function></funcdef>\r
46 <paramdef>GLenum <parameter>target</parameter></paramdef>\r
47 <paramdef>GLenum <parameter>attachment</parameter></paramdef>\r
48 <paramdef>GLenum <parameter>textarget</parameter></paramdef>\r
49 <paramdef>GLuint <parameter>texture</parameter></paramdef>\r
50 <paramdef>GLint <parameter>level</parameter></paramdef>\r
51 <paramdef>GLint <parameter>layer</parameter></paramdef>\r
52 </funcprototype>\r
53 </funcsynopsis>\r
54 </refsynopsisdiv>\r
55 <!-- eqn: ignoring delim $$ -->\r
56 <refsect1 id="parameters"><title>Parameters</title>\r
57 <variablelist>\r
58 <varlistentry>\r
59 <term><parameter>target</parameter></term>\r
60 <listitem>\r
61 <para>\r
62 Specifies the framebuffer target. <parameter>target</parameter> must be <constant>GL_DRAW_FRAMEBUFFER</constant>,\r
63 <constant>GL_READ_FRAMEBUFFER</constant>, or <constant>GL_FRAMEBUFFER</constant>. <constant>GL_FRAMEBUFFER</constant>\r
64 is equivalent to <constant>GL_DRAW_FRAMEBUFFER</constant>.\r
65 </para>\r
66 </listitem>\r
67 </varlistentry>\r
68 <varlistentry>\r
69 <term><parameter>attachment</parameter></term>\r
70 <listitem>\r
71 <para>\r
72 Specifies the attachment point of the framebuffer. <parameter>attachment</parameter> must be\r
73 <constant>GL_COLOR_ATTACHMENT<emphasis>i</emphasis></constant>, <constant>GL_DEPTH_ATTACHMENT</constant>,\r
74 <constant>GL_STENCIL_ATTACHMENT</constant> or <constant>GL_DEPTH_STENCIL_ATTACHMMENT</constant>.\r
75 </para>\r
76 </listitem>\r
77 </varlistentry>\r
78 <varlistentry>\r
79 <term><parameter>textarget</parameter></term>\r
80 <listitem>\r
81 <para>\r
82 For <function>glFramebufferTexture1D</function>, <function>glFramebufferTexture2D</function> and\r
83 <function>glFramebufferTexture3D</function>, specifies what type of texture is expected\r
84 in the <parameter>texture</parameter> parameter, or for cube map textures, which face is to be attached.\r
85 </para>\r
86 </listitem>\r
87 </varlistentry>\r
88 <varlistentry>\r
89 <term><parameter>texture</parameter></term>\r
90 <listitem>\r
91 <para>\r
92 Specifies the texture object to attach to the framebuffer attachment point named by <parameter>attachment</parameter>.\r
93 </para>\r
94 </listitem>\r
95 </varlistentry>\r
96 <varlistentry>\r
97 <term><parameter>level</parameter></term>\r
98 <listitem>\r
99 <para>\r
100 Specifies the mipmap level of <parameter>texture</parameter> to attach.\r
101 </para>\r
102 </listitem>\r
103 </varlistentry>\r
104 </variablelist>\r
105 </refsect1>\r
106 <refsect1 id="description"><title>Description</title>\r
107 <para>\r
108 <function>glFramebufferTexture</function>, <function>glFramebufferTexture1D</function>, <function>glFramebufferTexture2D</function>,\r
109 and <function>glFramebufferTexture</function> attach a selected mipmap level or image of a texture object as one of the\r
110 logical buffers of the framebuffer object currently bound to <parameter>target</parameter>. <parameter>target</parameter> must\r
111 be <constant>GL_DRAW_FRAMEBUFFER</constant>, <constant>GL_READ_FRAMEBUFFER</constant>, or <constant>GL_FRAMEBUFFER</constant>.\r
112 <constant>GL_FRAMEBUFFER</constant> is equivalent to <constant>GL_DRAW_FRAMEBUFFER</constant>.\r
113 </para>\r
114 <para>\r
115 <parameter>attachment</parameter> specifies the logical attachment of the framebuffer and must be\r
116 <constant>GL_COLOR_ATTACHMENT<emphasis>i</emphasis></constant>, <constant>GL_DEPTH_ATTACHMENT</constant>,\r
117 <constant>GL_STENCIL_ATTACHMENT</constant> or <constant>GL_DEPTH_STENCIL_ATTACHMMENT</constant>.\r
118 <emphasis>i</emphasis> in <constant>GL_COLOR_ATTACHMENT<emphasis>i</emphasis></constant> may range from zero to\r
119 the value of <constant>GL_MAX_COLOR_ATTACHMENTS</constant> - 1. Attaching a level of a texture to\r
120 <constant>GL_DEPTH_STENCIL_ATTACHMENT</constant> is equivalent to attaching that level to both the\r
121 <constant>GL_DEPTH_ATTACHMENT</constant> <emphasis>and</emphasis> the <constant>GL_STENCIL_ATTACHMENT</constant>\r
122 attachment points simultaneously.\r
123 </para>\r
124 <para>\r
125 <parameter>textarget</parameter> specifies what type of texture is named by <parameter>texture</parameter>, and for\r
126 cube map textures, specifies the face that is to be attached. If <parameter>texture</parameter> is not zero, it\r
127 must be the name of an existing texture with type <parameter>textarget</parameter>, unless it is a cube map\r
128 texture, in which case <parameter>textarget</parameter> must be <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>\r
129 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>, <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>,\r
130 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>, <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>, or\r
131 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>.\r
132 </para>\r
133 <para>\r
134 If <parameter>texture</parameter> is non-zero, the specified <parameter>level</parameter> of the texture object named\r
135 <parameter>texture</parameter> is attached to the framebfufer attachment point named by <parameter>attachment</parameter>.\r
136 For <function>glFramebufferTexture1D</function>, <function>glFramebufferTexture2D</function>, and\r
137 <function>glFramebufferTexture3D</function>, <parameter>texture</parameter> must be zero or the name of an existing\r
138 texture with a target of <parameter>textarget</parameter>, or <parameter>texture</parameter> must be the name\r
139 of an existing cube-map texture and <parameter>textarget</parameter> must be one of <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>,\r
140 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>, <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>,\r
141 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>, <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>, or\r
142 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>.\r
143 </para>\r
144 <para>\r
145 If <parameter>textarget</parameter> is <constant>GL_TEXTURE_RECTANGLE</constant>, <constant>GL_TEXTURE_2D_MULTISAMPLE</constant>,\r
146 or <constant>GL_TEXTURE_2D_MULTISAMPLE_ARRAY</constant>, then <parameter>level</parameter> must be zero. If <parameter>textarget</parameter>\r
147 is <constant>GL_TEXTURE_3D</constant>, then level must be greater than or equal to zero and less than or equal to log<subscript>2</subscript>\r
148 of the value of <constant>GL_MAX_3D_TEXTURE_SIZE</constant>. If <parameter>textarget</parameter> is one of <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>,\r
149 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>, <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>, <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>,\r
150 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>, or <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>, then <parameter>level</parameter> must be greater\r
151 than or equal to zero and less than or equal to log<subscript>2</subscript> of the value of <constant>GL_MAX_CUBE_MAP_TEXTURE_SIZE</constant>. For all other\r
152 values of <parameter>textarget</parameter>, <parameter>level</parameter> must be greater than or equal to zero and no larger than log<subscript>2</subscript>\r
153 of the value of <constant>GL_MAX_TEXTURE_SIZE</constant>.\r
154 </para>\r
155 <para>\r
156 <parameter>layer</parameter> specifies the layer of a 2-dimensional image within a 3-dimensional texture.\r
157 </para>\r
158 <para>\r
159 For <function>glFramebufferTexture1D</function>, if <parameter>texture</parameter> is not zero, then <parameter>textarget</parameter> must\r
160 be <constant>GL_TEXTURE_1D</constant>. For <function>glFramebufferTexture2D</function>, if <parameter>texture</parameter> is not zero,\r
161 <parameter>textarget</parameter> must be one of <constant>GL_TEXTURE_2D</constant>, <constant>GL_TEXTURE_RECTANGLE</constant>,\r
162 <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>, <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>, <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>,\r
163 <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>, <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>, <constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>, or\r
164 <constant>GL_TEXTURE_2D_MULTISAMPLE</constant>. For <function>glFramebufferTexture3D</function>, if <parameter>texture</parameter> is\r
165 not zero, then <parameter>textarget</parameter> must be <constant>GL_TEXTURE_3D</constant>.\r
166 </para>\r
167 </refsect1>\r
168 <refsect1 id="notes"><title>Notes</title>\r
169 <para>\r
170 <function>glFramebufferTexture</function> is available only if the GL version is 3.2 or greater.\r
171 </para>\r
172 </refsect1>\r
173 <refsect1 id="errors"><title>Errors</title>\r
174 <para>\r
175 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not one of the accepted tokens.\r
176 </para>\r
177 <para>\r
178 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>renderbuffertarget</parameter> is not <constant>GL_RENDERBUFFER</constant>.\r
179 </para>\r
180 <para>\r
181 <constant>GL_INVALID_OPERATION</constant> is generated if zero is bound to <parameter>target</parameter>.\r
182 </para>\r
183 <para>\r
184 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>textarget</parameter> and <parameter>texture</parameter>\r
185 are not compatible.\r
186 </para>\r
187 </refsect1>\r
188 <refsect1 id="seealso"><title>See Also</title>\r
189 <para>\r
190 <citerefentry><refentrytitle>glGenFramebuffers</refentrytitle></citerefentry>,\r
191 <citerefentry><refentrytitle>glBindFramebuffer</refentrytitle></citerefentry>,\r
192 <citerefentry><refentrytitle>glGenRenderbuffers</refentrytitle></citerefentry>,\r
193 <citerefentry><refentrytitle>glFramebufferTexture</refentrytitle></citerefentry>,\r
194 <citerefentry><refentrytitle>glFramebufferTexture1D</refentrytitle></citerefentry>,\r
195 <citerefentry><refentrytitle>glFramebufferTexture2D</refentrytitle></citerefentry>,\r
196 <citerefentry><refentrytitle>glFramebufferTexture3D</refentrytitle></citerefentry>\r
197 </para>\r
198 </refsect1>\r
199 <refsect1 id="Copyright"><title>Copyright</title>\r
200 <para>\r
201 Copyright <trademark class="copyright"></trademark> 2010 Khronos Group. \r
202 This material may be distributed subject to the terms and conditions set forth in \r
203 the Open Publication License, v 1.0, 8 June 1999.\r
204 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r
205 </para>\r
206 </refsect1>\r
207</refentry>\r