Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> | |
3 | <!-- saved from url=(0013)about:internet --> | |
4 | <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="stylesheet" type="text/css" href="opengl-man.css" /><title>glGetFramebufferAttachmentParameteriv - OpenGL 4 Reference Pages</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glGetFramebufferAttachmentParameter"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glGetFramebufferAttachmentParameteriv — retrieve information about attachments of a bound framebuffer object</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glGetFramebufferAttachmentParameteriv</b>(</code></td><td>GLenum </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLenum </td><td><var class="pdparam">attachment</var>, </td></tr><tr><td> </td><td>GLenum </td><td><var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLint * </td><td><var class="pdparam">params</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>target</code></em></span></dt><dd><p> | |
5 | Specifies the target of the query operation. | |
6 | </p></dd><dt><span class="term"><em class="parameter"><code>attachment</code></em></span></dt><dd><p> | |
7 | Specifies the attachment within <em class="parameter"><code>target</code></em> | |
8 | </p></dd><dt><span class="term"><em class="parameter"><code>pname</code></em></span></dt><dd><p> | |
9 | Specifies the parameter of <em class="parameter"><code>attachment</code></em> to query. | |
10 | </p></dd><dt><span class="term"><em class="parameter"><code>params</code></em></span></dt><dd><p> | |
11 | Specifies the address of a variable receive the value of <em class="parameter"><code>pname</code></em> for <em class="parameter"><code>attachment</code></em>. | |
12 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
c7b31271 | 13 | <code class="function">glGetFramebufferAttachmentParameteriv</code> returns information about attachments of a bound framebuffer |
7faf1d71 AW |
14 | object. <em class="parameter"><code>target</code></em> specifies the framebuffer binding point and must be <code class="constant">GL_DRAW_FRAMEBUFFER</code>, |
15 | <code class="constant">GL_READ_FRAMEBUFFER</code> or <code class="constant">GL_FRAMEBUFFER</code>. <code class="constant">GL_FRAMEBUFFER</code> is equivalent | |
16 | to <code class="constant">GL_DRAW_FRAMEBUFFER</code>. | |
17 | </p><p> | |
18 | If the default framebuffer is bound to <em class="parameter"><code>target</code></em> then <em class="parameter"><code>attachment</code></em> must be one of | |
19 | <code class="constant">GL_FRONT_LEFT</code>, <code class="constant">GL_FRONT_RIGHT</code>, <code class="constant">GL_BACK_LEFT</code>, or | |
20 | <code class="constant">GL_BACK_RIGHT</code>, identifying a color buffer, <code class="constant">GL_DEPTH</code>, identifying the depth buffer, | |
21 | or <code class="constant">GL_STENCIL</code>, identifying the stencil buffer. | |
22 | </p><p> | |
23 | If a framebuffer object is bound, then <em class="parameter"><code>attachment</code></em> must be one of <code class="constant">GL_COLOR_ATTACHMENT<span class="emphasis"><em>i</em></span></code>, | |
24 | <code class="constant">GL_DEPTH_ATTACHMENT</code>, <code class="constant">GL_STENCIL_ATTACHMENT</code>, or <code class="constant">GL_DEPTH_STENCIL_ATTACHMENT</code>. | |
25 | <span class="emphasis"><em>i</em></span> in <code class="constant">GL_COLOR_ATTACHMENT<span class="emphasis"><em>i</em></span></code> must be in the range zero to the value of | |
26 | <code class="constant">GL_MAX_COLOR_ATTACHMENTS</code> - 1. | |
27 | </p><p> | |
28 | If <em class="parameter"><code>attachment</code></em> is <code class="constant">GL_DEPTH_STENCIL_ATTACHMENT</code> and different objects are bound | |
29 | to the depth and stencil attachment points of <em class="parameter"><code>target</code></em> the query will fail. If the same object | |
30 | is bound to both attachment points, information about that object will be returned. | |
31 | </p><p> | |
32 | Upon successful return from <code class="function">glGetFramebufferAttachmentParameteriv</code>, if <em class="parameter"><code>pname</code></em> is | |
33 | <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</code>, then <em class="parameter"><code>params</code></em> will contain one of <code class="constant">GL_NONE</code>, | |
34 | <code class="constant">GL_FRAMEBUFFER_DEFAULT</code>, <code class="constant">GL_TEXTURE</code>, or <code class="constant">GL_RENDERBUFFER</code>, identifying the type of | |
35 | object which contains the attached image. Other values accepted for <em class="parameter"><code>pname</code></em> depend on the type of object, as described below. | |
36 | </p><p> | |
37 | If the value of <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</code> is <code class="constant">GL_NONE</code>, no framebuffer is bound to | |
38 | <em class="parameter"><code>target</code></em>. In this case querying <em class="parameter"><code>pname</code></em> <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</code> | |
39 | will return zero, and all other queries will generate an error. | |
40 | </p><p> | |
41 | If the value of <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</code> is not <code class="constant">GL_NONE</code>, these queries apply to all other | |
42 | framebuffer types: | |
43 | </p><div class="itemizedlist"><ul type="disc"><li><p> | |
44 | If <em class="parameter"><code>pname</code></em> is <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE</code>, | |
45 | <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE</code>, <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE</code>, | |
46 | <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE</code>, <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE</code>, | |
47 | or <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE</code>, then <em class="parameter"><code>params</code></em> will contain the number | |
48 | of bits in the corresponding red, green, blue, alpha, depth, or stencil component of the specified attachment. Zero is returned | |
49 | if the requested component is not present in <em class="parameter"><code>attachment</code></em>. | |
50 | </p></li><li><p> | |
51 | If <em class="parameter"><code>pname</code></em> is <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE</code>, <em class="parameter"><code>params</code></em> will | |
52 | contain the format of components of the specified attachment, one of <code class="constant">GL_FLOAT</code>, <em class="parameter"><code>GL_INT</code></em>, | |
53 | <em class="parameter"><code>GL_UNSIGNED_INT</code></em>, <em class="parameter"><code>GL_SIGNED_NORMALIZED</code></em>, or <em class="parameter"><code>GL_UNSIGNED_NORMALIZED</code></em> | |
54 | for floating-point, signed integer, unsigned integer, signed normalized fixed-point, or unsigned normalized fixed-point components | |
55 | respectively. Only color buffers may have integer components. | |
56 | </p></li><li><p> | |
57 | If <em class="parameter"><code>pname</code></em> is <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING</code>, <em class="parameter"><code>param</code></em> will | |
58 | contain the encoding of components of the specified attachment, one of <code class="constant">GL_LINEAR</code> or <code class="constant">GL_SRGB</code> | |
59 | for linear or sRGB-encoded components, respectively. Only color buffer components may be sRGB-encoded; such components | |
60 | are treated as described in sections 4.1.7 and 4.1.8. For the default framebuffer, color encoding is determined by the implementation. | |
61 | For framebuffer objects, components are sRGB-encoded if the internal format of a color attachment is one of the color-renderable SRGB | |
62 | formats. | |
63 | </p></li></ul></div><p> | |
64 | If the value of <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</code> is <code class="constant">GL_RENDERBUFFER</code>, then: | |
65 | </p><div class="itemizedlist"><ul type="disc"><li><p> | |
66 | If <em class="parameter"><code>pname</code></em> is <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</code>, <em class="parameter"><code>params</code></em> will contain | |
67 | the name of the renderbuffer object which contains the attached image. | |
68 | </p></li></ul></div><p> | |
69 | If the value of <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</code> is <code class="constant">GL_TEXTURE</code>, then: | |
70 | </p><div class="itemizedlist"><ul type="disc"><li><p> | |
71 | If <em class="parameter"><code>pname</code></em> is <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</code>, then <em class="parameter"><code>params</code></em> will | |
72 | contain the name of the texture object which contains the attached image. | |
73 | </p></li><li><p> | |
74 | If <em class="parameter"><code>pname</code></em> is <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL</code>, then <em class="parameter"><code>params</code></em> | |
75 | will contain the mipmap level of the texture object which contains the attached image. | |
76 | </p></li><li><p> | |
77 | If <em class="parameter"><code>pname</code></em> is <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE</code> and the texture object named | |
78 | <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</code> is a cube map texture, then <em class="parameter"><code>params</code></em> will contain the cube map | |
79 | face of the cubemap texture object which contains the attached image. Otherwise <em class="parameter"><code>params</code></em> will contain the value | |
80 | zero. | |
81 | </p></li><li><p> | |
82 | If <em class="parameter"><code>pname</code></em> is <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER</code> and the texture object named | |
83 | <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</code> is a layer of a three-dimensional texture or a one-or two-dimensional | |
84 | array texture, then <em class="parameter"><code>params</code></em> will contain the number of the texture layer which contains the attached image. | |
85 | Otherwise <em class="parameter"><code>params</code></em> will contain the value zero. | |
86 | </p></li><li><p> | |
87 | If <em class="parameter"><code>pname</code></em> is <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_LAYERED</code>, then <em class="parameter"><code>params</code></em> will | |
88 | contain <code class="constant">GL_TRUE</code> if an entire level of a three-dimesional texture, cube map texture, or one-or two-dimensional | |
89 | array texture is attached. Otherwise, <em class="parameter"><code>params</code></em> will contain <code class="constant">GL_FALSE</code>. | |
90 | </p></li></ul></div><p> | |
91 | Any combinations of framebuffer type and <em class="parameter"><code>pname</code></em> not described above will generate an error. | |
92 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
93 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not one of the accepted tokens. | |
94 | </p><p> | |
95 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>pname</code></em> is not valid for the value of | |
96 | <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</code>. | |
97 | </p><p> | |
98 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>attachment</code></em> is not the accepted values | |
99 | for <em class="parameter"><code>target</code></em>. | |
100 | </p><p> | |
101 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>attachment</code></em> is <code class="constant">GL_DEPTH_STENCIL_ATTACHMENT</code> | |
102 | and different objects are bound to the depth and stencil attachment points of <em class="parameter"><code>target</code></em>. | |
103 | </p><p> | |
104 | <code class="constant">GL_INVALID_OPERATION</code> is generated if the value of <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</code> is | |
105 | <code class="constant">GL_NONE</code> and <em class="parameter"><code>pname</code></em> is not <code class="constant">GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</code>. | |
106 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
107 | <a href="glGenFramebuffers.xml"><span class="citerefentry"><span class="refentrytitle">glGenFramebuffers</span></span></a>, | |
108 | <a href="glBindFramebuffer.xml"><span class="citerefentry"><span class="refentrytitle">glBindFramebuffer</span></span></a> | |
109 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
c7b31271 | 110 | Copyright <span class="trademark"></span>© 2010-2013 Khronos Group. |
7faf1d71 AW |
111 | This material may be distributed subject to the terms and conditions set forth in |
112 | the Open Publication License, v 1.0, 8 June 1999. | |
113 | <a href="http://opencontent.org/openpub/" target="_top">http://opencontent.org/openpub/</a>. | |
114 | </p></div></div></body></html> |