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 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403
|
<!DOCTYPE refentry [ <!ENTITY % mathent SYSTEM "math.ent"> %mathent; ]>
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="glGetFramebufferAttachmentParameter">
<info>
<copyright>
<year>2010-2014</year>
<holder>Khronos Group</holder>
</copyright>
</info>
<refmeta>
<refentrytitle>glGetFramebufferAttachmentParameteriv</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glGetFramebufferAttachmentParameteriv</refname>
<refname>glGetNamedFramebufferAttachmentParameteriv</refname>
<refpurpose>retrieve information about attachments of a framebuffer object</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glGetFramebufferAttachmentParameteriv</function></funcdef>
<paramdef>GLenum <parameter>target</parameter></paramdef>
<paramdef>GLenum <parameter>attachment</parameter></paramdef>
<paramdef>GLenum <parameter>pname</parameter></paramdef>
<paramdef>GLint *<parameter>params</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>void <function>glGetNamedFramebufferAttachmentParameteriv</function></funcdef>
<paramdef>GLuint <parameter>framebuffer</parameter></paramdef>
<paramdef>GLenum <parameter>attachment</parameter></paramdef>
<paramdef>GLenum <parameter>pname</parameter></paramdef>
<paramdef>GLint *<parameter>params</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 xml:id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>target</parameter></term>
<listitem>
<para>
Specifies the target to which the framebuffer object is
bound for
<function>glGetFramebufferAttachmentParameteriv</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>framebuffer</parameter></term>
<listitem>
<para>
Specifies the name of the framebuffer object for
<function>glGetNamedFramebufferAttachmentParameteriv</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>attachment</parameter></term>
<listitem>
<para>
Specifies the attachment of the framebuffer object to
query.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>pname</parameter></term>
<listitem>
<para>
Specifies the parameter of
<parameter>attachment</parameter> to query.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>params</parameter></term>
<listitem>
<para>
Returns the value of parameter
<parameter>pname</parameter> for
<parameter>attachment</parameter>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 xml:id="description"><title>Description</title>
<para>
<function>glGetFramebufferAttachmentParameteriv</function> and
<function>glGetNamedFramebufferAttachmentParameteriv</function>
return parameters of attachments of a specified framebuffer
object.
</para>
<para>
For <function>glGetFramebufferAttachmentParameteriv</function>,
the framebuffer object is that bound to
<parameter>target</parameter>, which must be one of
<constant>GL_DRAW_FRAMEBUFFER</constant>,
<constant>GL_READ_FRAMEBUFFER</constant> or
<constant>GL_FRAMEBUFFER</constant>.
<constant>GL_FRAMEBUFFER</constant> is equivalent to
<constant>GL_DRAW_FRAMEBUFFER</constant>. Buffers of default
framebuffers may also be queried if bound to
<parameter>target</parameter>.
</para>
<para>
For
<function>glGetNamedFramebufferAttachmentParameteriv</function>,
<parameter>framebuffer</parameter> is the name of the
framebuffer object. If <parameter>framebuffer</parameter> is
zero, the default draw framebuffer is queried.
</para>
<para>
If the specified framebuffer is a framebuffer object,
<parameter>attachment</parameter> must be one of
<constant>GL_DEPTH_ATTACHMENT</constant>,
<constant>GL_STENCIL_ATTACHMENT</constant>
<constant>GL_DEPTH_STENCIL_ATTACHMENT</constant>, or
<constant>GL_COLOR_ATTACHMENT</constant><emphasis>i</emphasis>,
where <emphasis>i</emphasis> is between zero and the value of
<constant>GL_MAX_COLOR_ATTACHMENTS</constant> minus one.
</para>
<para>
If the specified framebuffer is a default framebuffer,
<parameter>target</parameter>, <parameter>attachment</parameter>
must be one of <constant>GL_FRONT_LEFT</constant>,
<constant>GL_FRONT_RIGHT</constant>,
<constant>GL_BACK_LEFT</constant>,
<constant>GL_BACK_RIGHT</constant>,
<constant>GL_DEPTH</constant> or
<constant>GL_STENCIL</constant>, identifying the corresponding
buffer.
</para>
<para>
If <parameter>attachment</parameter> is
<constant>GL_DEPTH_STENCIL_ATTACHMENT</constant>, the same
object must be bound to both the depth and stencil attachment
points of the framebuffer object, and information about that
object is returned.
</para>
<para>
Upon successful return, if <parameter>pname</parameter> is
<constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant>, then
<parameter>params</parameter> will contain one of
<constant>GL_NONE</constant>,
<constant>GL_FRAMEBUFFER_DEFAULT</constant>,
<constant>GL_TEXTURE</constant>, or
<constant>GL_RENDERBUFFER</constant>, identifying the type of
object which contains the attached image. Other values accepted
for <parameter>pname</parameter> depend on the type of object,
as described below.
</para>
<para>
If the value of
<constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant> is
<constant>GL_NONE</constant>, then either no framebuffer is
bound to <parameter>target</parameter>; or a default framebuffer
is queried, <parameter>attachment</parameter> is
<constant>GL_DEPTH</constant> or
<constant>GL_STENCIL</constant>, and the number of depth or
stencil bits, respectively, is zero. In this case querying
<parameter>pname</parameter>
<constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</constant> will
return zero, and all other queries will generate an error.
</para>
<para>
If the value of
<constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant> is
not <constant>GL_NONE</constant>, these queries apply to all
other framebuffer types:
</para>
<itemizedlist>
<listitem>
<para>
If <parameter>pname</parameter> is
<constant>GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE</constant>,
<constant>GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE</constant>,
<constant>GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE</constant>,
<constant>GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE</constant>,
<constant>GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE</constant>
or
<constant>GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE</constant>,
then <parameter>params</parameter> will contain the
number of bits in the corresponding red, green, blue,
alpha, depth, or stencil component of the specified
attachment. If the requested component is not present in
the attachment, or if no data storage or texture image
has been specified for the attachment, then
<parameter>params</parameter> will contain zero.
</para>
</listitem>
<listitem>
<para>
If <parameter>pname</parameter> is
<constant>GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE</constant>,
then <parameter>params</parameter> will contain the
format of components of the specified attachment, one of
<constant>GL_FLOAT</constant>,
<constant>GL_INT</constant>,
<constant>GL_UNSIGNED_INT</constant>,
<constant>GL_SIGNED_NORMALIZED</constant>, or
<constant>GL_UNSIGNED_NORMALIZED</constant> for
floating-point, signed integer, unsigned integer, signed
normalized fixed-point, or unsigned normalized
fixed-point components respectively. Only color buffers
may have integer components. If no data storage or
texture image has been specified for the attachment,
then <parameter>params</parameter> will contain
<constant>GL_NONE</constant>. This query cannot be
performed for a combined depth+stencil attachment, since
it does not have a single format.
</para>
</listitem>
<listitem>
<para>
If <parameter>pname</parameter> is
<constant>GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING</constant>,
then <parameter>params</parameter> will contain the encoding
of components of the specified attachment, one of
<constant>GL_LINEAR</constant> or
<constant>GL_SRGB</constant> for linear or sRGB-encoded
components, respectively. Only color buffer components
may be sRGB-encoded; such components are treated as
described in the OpenGL Specification. For a default
framebuffer, color encoding is determined by the
implementation. For framebuffer objects, components are
sRGB-encoded if the internal format of a color
attachment is one of the color-renderable SRGB formats.
If the attachment is not a color attachment, or if no
data storage or texture image has been specified for the
attachment, then <parameter>params</parameter> will
contain <constant>GL_LINEAR</constant>.
</para>
</listitem>
</itemizedlist>
<para>
If the value of
<constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant> is
<constant>GL_RENDERBUFFER</constant>, then
</para>
<itemizedlist>
<listitem>
<para>
If <parameter>pname</parameter> is
<constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</constant>,
<parameter>params</parameter> will contain the name of
the renderbuffer object which contains the attached
image.
</para>
</listitem>
</itemizedlist>
<para>
If the value of
<constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant> is
<constant>GL_TEXTURE</constant>, then
</para>
<itemizedlist>
<listitem>
<para>
If <parameter>pname</parameter> is
<constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</constant>,
then <parameter>params</parameter> will contain the name
of the texture object which contains the attached image.
</para>
</listitem>
<listitem>
<para>
If <parameter>pname</parameter> is
<constant>GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL</constant>,
then <parameter>params</parameter> will contain the
mipmap level of the texture object which contains the
attached image.
</para>
</listitem>
<listitem>
<para>
If <parameter>pname</parameter> is
<constant>GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE</constant>
and the value of
<constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</constant>
is the name of a cube map texture object, then
<parameter>params</parameter> will contain the cube map
face of the cubemap texture object which contains the
attached image. Otherwise <parameter>params</parameter>
will contain zero.
</para>
</listitem>
<listitem>
<para>
If <parameter>pname</parameter> is
<constant>GL_FRAMEBUFFER_ATTACHMENT_LAYERED</constant>,
then <parameter>params</parameter> will contain
<constant>GL_TRUE</constant> if an entire level of a
three-dimensional texture, cube map texture, or one-or
two-dimensional array texture is attached. Otherwise,
<parameter>params</parameter> will contain
<constant>GL_FALSE</constant>.
</para>
</listitem>
<listitem>
<para>
If <parameter>pname</parameter> is
<constant>GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER</constant>;
the value of
<constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</constant>
is the name of a three-dimensional, or a one- or
two-dimensional array texture; and the value of
<constant>GL_FRAMEBUFFER_ATTACHMENT_LAYERED</constant>
is <constant>GL_FALSE</constant>, then
<parameter>params</parameter> will contain the texture
layer which contains the attached image. Otherwise
<parameter>params</parameter> will contain zero.
</para>
</listitem>
</itemizedlist>
</refsect1>
<refsect1 xml:id="notes"><title>Notes</title>
<para>
The <constant>GL_FRAMEBUFFER_ATTACHMENT_LAYERED</constant> query
is supported only if the GL version is 3.2 or greater.
</para>
</refsect1>
<refsect1 xml:id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated by
<function>glGetFramebufferAttachmentParameteriv</function> if
<parameter>target</parameter> is not one of the accepted
framebuffer targets.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated by
<function>glGetNamedFramebufferAttachmentParameteriv</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>pname</parameter> is not valid for the value of
<constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant>, as
described above.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>attachment</parameter> is not one of the accepted
framebuffer attachment points, as described above.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if the
value of
<constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant> is
<constant>GL_NONE</constant> and <parameter>pname</parameter> is
not <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</constant>
or <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>attachment</parameter> is
<constant>GL_DEPTH_STENCIL_ATTACHMENT</constant> and different
objects are bound to the depth and stencil attachment points of
<parameter>target</parameter>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>attachment</parameter> is
<constant>GL_DEPTH_STENCIL_ATTACHMENT</constant> and
<parameter>pname</parameter> is
<constant>GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE</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>glGetFramebufferAttachmentParameteriv</function></entry>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='30']/*)"/>
</row>
<row>
<entry><function>glGetNamedFramebufferAttachmentParameteriv</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>glGenFramebuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindFramebuffer</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glGetFramebufferParameter</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 xml:id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"/> 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.
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://opencontent.org/openpub/">http://opencontent.org/openpub/</link>.
</para>
</refsect1>
</refentry>
|