update upstream sources
[clinton/guile-figl.git] / upstream-doc / man3 / glGetFramebufferAttachmentParameter.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="glGetFramebufferAttachmentParameter">\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>glGetFramebufferAttachmentParameteriv</refentrytitle>\r
13 <manvolnum>3G</manvolnum>\r
14 </refmeta>\r
15 <refnamediv>\r
16 <refname>glGetFramebufferAttachmentParameteriv</refname>\r
17 <refpurpose>retrieve information about attachments of a bound framebuffer object</refpurpose>\r
18 </refnamediv>\r
19 <refsynopsisdiv><title>C Specification</title>\r
20 <funcsynopsis>\r
21 <funcprototype>\r
c7b31271 22 <funcdef>void <function>glGetFramebufferAttachmentParameteriv</function></funcdef>\r
7faf1d71
AW
23 <paramdef>GLenum <parameter>target</parameter></paramdef>\r
24 <paramdef>GLenum <parameter>attachment</parameter></paramdef>\r
25 <paramdef>GLenum <parameter>pname</parameter></paramdef>\r
26 <paramdef>GLint *<parameter>params</parameter></paramdef>\r
27 </funcprototype>\r
28 </funcsynopsis>\r
29 </refsynopsisdiv>\r
30 <!-- eqn: ignoring delim $$ -->\r
31 <refsect1 id="parameters"><title>Parameters</title>\r
32 <variablelist>\r
33 <varlistentry>\r
34 <term><parameter>target</parameter></term>\r
35 <listitem>\r
36 <para>\r
37 Specifies the target of the query operation.\r
38 </para>\r
39 </listitem>\r
40 </varlistentry>\r
41 <varlistentry>\r
42 <term><parameter>attachment</parameter></term>\r
43 <listitem>\r
44 <para>\r
45 Specifies the attachment within <parameter>target</parameter>\r
46 </para>\r
47 </listitem>\r
48 </varlistentry>\r
49 <varlistentry>\r
50 <term><parameter>pname</parameter></term>\r
51 <listitem>\r
52 <para>\r
53 Specifies the parameter of <parameter>attachment</parameter> to query.\r
54 </para>\r
55 </listitem>\r
56 </varlistentry>\r
57 <varlistentry>\r
58 <term><parameter>params</parameter></term>\r
59 <listitem>\r
60 <para>\r
61 Specifies the address of a variable receive the value of <parameter>pname</parameter> for <parameter>attachment</parameter>.\r
62 </para>\r
63 </listitem>\r
64 </varlistentry>\r
65 </variablelist>\r
66 </refsect1>\r
67 <refsect1 id="description"><title>Description</title>\r
68 <para>\r
c7b31271 69 <function>glGetFramebufferAttachmentParameteriv</function> returns information about attachments of a bound framebuffer\r
7faf1d71
AW
70 object. <parameter>target</parameter> specifies the framebuffer binding point and must be <constant>GL_DRAW_FRAMEBUFFER</constant>,\r
71 <constant>GL_READ_FRAMEBUFFER</constant> or <constant>GL_FRAMEBUFFER</constant>. <constant>GL_FRAMEBUFFER</constant> is equivalent\r
72 to <constant>GL_DRAW_FRAMEBUFFER</constant>.\r
73 </para>\r
74 <para>\r
75 If the default framebuffer is bound to <parameter>target</parameter> then <parameter>attachment</parameter> must be one of\r
76 <constant>GL_FRONT_LEFT</constant>, <constant>GL_FRONT_RIGHT</constant>, <constant>GL_BACK_LEFT</constant>, or\r
77 <constant>GL_BACK_RIGHT</constant>, identifying a color buffer, <constant>GL_DEPTH</constant>, identifying the depth buffer,\r
78 or <constant>GL_STENCIL</constant>, identifying the stencil buffer.\r
79 </para>\r
80 <para>\r
81 If a framebuffer object is bound, then <parameter>attachment</parameter> must be one of <constant>GL_COLOR_ATTACHMENT<emphasis>i</emphasis></constant>,\r
82 <constant>GL_DEPTH_ATTACHMENT</constant>, <constant>GL_STENCIL_ATTACHMENT</constant>, or <constant>GL_DEPTH_STENCIL_ATTACHMENT</constant>.\r
83 <emphasis>i</emphasis> in <constant>GL_COLOR_ATTACHMENT<emphasis>i</emphasis></constant> must be in the range zero to the value of\r
84 <constant>GL_MAX_COLOR_ATTACHMENTS</constant> - 1.\r
85 </para>\r
86 <para>\r
87 If <parameter>attachment</parameter> is <constant>GL_DEPTH_STENCIL_ATTACHMENT</constant> and different objects are bound\r
88 to the depth and stencil attachment points of <parameter>target</parameter> the query will fail. If the same object\r
89 is bound to both attachment points, information about that object will be returned.\r
90 </para>\r
91 <para>\r
92 Upon successful return from <function>glGetFramebufferAttachmentParameteriv</function>, if <parameter>pname</parameter> is\r
93 <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant>, then <parameter>params</parameter> will contain one of <constant>GL_NONE</constant>,\r
94 <constant>GL_FRAMEBUFFER_DEFAULT</constant>, <constant>GL_TEXTURE</constant>, or <constant>GL_RENDERBUFFER</constant>, identifying the type of\r
95 object which contains the attached image. Other values accepted for <parameter>pname</parameter> depend on the type of object, as described below.\r
96 </para>\r
97 <para>\r
98 If the value of <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant> is <constant>GL_NONE</constant>, no framebuffer is bound to\r
99 <parameter>target</parameter>. In this case querying <parameter>pname</parameter> <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</constant>\r
100 will return zero, and all other queries will generate an error.\r
101 </para>\r
102 <para>\r
103 If the value of <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant> is not <constant>GL_NONE</constant>, these queries apply to all other\r
104 framebuffer types:\r
105 </para>\r
106 <itemizedlist>\r
107 <listitem>\r
108 <para>\r
109 If <parameter>pname</parameter> is <constant>GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE</constant>,\r
110 <constant>GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE</constant>, <constant>GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE</constant>,\r
111 <constant>GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE</constant>, <constant>GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE</constant>,\r
112 or <constant>GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE</constant>, then <parameter>params</parameter> will contain the number\r
113 of bits in the corresponding red, green, blue, alpha, depth, or stencil component of the specified attachment. Zero is returned\r
114 if the requested component is not present in <parameter>attachment</parameter>.\r
115 </para>\r
116 </listitem>\r
117 <listitem>\r
118 <para>\r
119 If <parameter>pname</parameter> is <constant>GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE</constant>, <parameter>params</parameter> will\r
120 contain the format of components of the specified attachment, one of <constant>GL_FLOAT</constant>, <parameter>GL_INT</parameter>,\r
121 <parameter>GL_UNSIGNED_INT</parameter>, <parameter>GL_SIGNED_NORMALIZED</parameter>, or <parameter>GL_UNSIGNED_NORMALIZED</parameter>\r
122 for floating-point, signed integer, unsigned integer, signed normalized fixed-point, or unsigned normalized fixed-point components\r
123 respectively. Only color buffers may have integer components.\r
124 </para>\r
125 </listitem>\r
126 <listitem>\r
127 <para>\r
128 If <parameter>pname</parameter> is <constant>GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING</constant>, <parameter>param</parameter> will\r
129 contain the encoding of components of the specified attachment, one of <constant>GL_LINEAR</constant> or <constant>GL_SRGB</constant>\r
130 for linear or sRGB-encoded components, respectively. Only color buffer components may be sRGB-encoded; such components\r
131 are treated as described in sections 4.1.7 and 4.1.8. For the default framebuffer, color encoding is determined by the implementation.\r
132 For framebuffer objects, components are sRGB-encoded if the internal format of a color attachment is one of the color-renderable SRGB\r
133 formats.\r
134 </para>\r
135 </listitem>\r
136 </itemizedlist>\r
137 <para>\r
138 If the value of <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant> is <constant>GL_RENDERBUFFER</constant>, then:\r
139 </para>\r
140 <itemizedlist>\r
141 <listitem>\r
142 <para>\r
143 If <parameter>pname</parameter> is <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</constant>, <parameter>params</parameter> will contain\r
144 the name of the renderbuffer object which contains the attached image.\r
145 </para>\r
146 </listitem>\r
147 </itemizedlist>\r
148 <para>\r
149 If the value of <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant> is <constant>GL_TEXTURE</constant>, then:\r
150 </para>\r
151 <itemizedlist>\r
152 <listitem>\r
153 <para>\r
154 If <parameter>pname</parameter> is <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</constant>, then <parameter>params</parameter> will\r
155 contain the name of the texture object which contains the attached image.\r
156 </para>\r
157 </listitem>\r
158 <listitem>\r
159 <para>\r
160 If <parameter>pname</parameter> is <constant>GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL</constant>, then <parameter>params</parameter>\r
161 will contain the mipmap level of the texture object which contains the attached image.\r
162 </para>\r
163 </listitem>\r
164 <listitem>\r
165 <para>\r
166 If <parameter>pname</parameter> is <constant>GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE</constant> and the texture object named\r
167 <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</constant> is a cube map texture, then <parameter>params</parameter> will contain the cube map\r
168 face of the cubemap texture object which contains the attached image. Otherwise <parameter>params</parameter> will contain the value\r
169 zero.\r
170 </para>\r
171 </listitem>\r
172 <listitem>\r
173 <para>\r
174 If <parameter>pname</parameter> is <constant>GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER</constant> and the texture object named\r
175 <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</constant> is a layer of a three-dimensional texture or a one-or two-dimensional\r
176 array texture, then <parameter>params</parameter> will contain the number of the texture layer which contains the attached image.\r
177 Otherwise <parameter>params</parameter> will contain the value zero.\r
178 </para>\r
179 </listitem>\r
180 <listitem>\r
181 <para>\r
182 If <parameter>pname</parameter> is <constant>GL_FRAMEBUFFER_ATTACHMENT_LAYERED</constant>, then <parameter>params</parameter> will\r
183 contain <constant>GL_TRUE</constant> if an entire level of a three-dimesional texture, cube map texture, or one-or two-dimensional\r
184 array texture is attached. Otherwise, <parameter>params</parameter> will contain <constant>GL_FALSE</constant>.\r
185 </para>\r
186 </listitem>\r
187 </itemizedlist>\r
188 <para>\r
189 Any combinations of framebuffer type and <parameter>pname</parameter> not described above will generate an error.\r
190 </para>\r
191 </refsect1>\r
192 <refsect1 id="errors"><title>Errors</title>\r
193 <para>\r
194 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not one of the accepted tokens.\r
195 </para>\r
196 <para>\r
197 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>pname</parameter> is not valid for the value of\r
198 <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant>.\r
199 </para>\r
200 <para>\r
201 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>attachment</parameter> is not the accepted values\r
202 for <parameter>target</parameter>.\r
203 </para>\r
204 <para>\r
205 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>attachment</parameter> is <constant>GL_DEPTH_STENCIL_ATTACHMENT</constant>\r
206 and different objects are bound to the depth and stencil attachment points of <parameter>target</parameter>.\r
207 </para>\r
208 <para>\r
209 <constant>GL_INVALID_OPERATION</constant> is generated if the value of <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant> is\r
210 <constant>GL_NONE</constant> and <parameter>pname</parameter> is not <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</constant>.\r
211 </para>\r
212 </refsect1>\r
213 <refsect1 id="seealso"><title>See Also</title>\r
214 <para>\r
215 <citerefentry><refentrytitle>glGenFramebuffers</refentrytitle></citerefentry>,\r
216 <citerefentry><refentrytitle>glBindFramebuffer</refentrytitle></citerefentry>\r
217 </para>\r
218 </refsect1>\r
219 <refsect1 id="Copyright"><title>Copyright</title>\r
220 <para>\r
c7b31271 221 Copyright <trademark class="copyright"></trademark> 2010-2013 Khronos Group. \r
7faf1d71
AW
222 This material may be distributed subject to the terms and conditions set forth in \r
223 the Open Publication License, v 1.0, 8 June 1999.\r
224 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r
225 </para>\r
226 </refsect1>\r
227</refentry>\r