1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <title xmlns:xlink="http://www.w3.org/1999/xlink">eglQuerySurface - EGL Reference Pages</title>
5    <link rel="stylesheet" type="text/css" href="khronos-man.css"/>
6    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/>
7  </head>
8  <body>
9    <header/>
10    <div class="refentry" id="eglQuerySurface">
11      <div class="titlepage"/>
12      <div class="refnamediv">
13        <h2>Name</h2>
14        <p>eglQuerySurface — 
15            return <abbr class="acronym">EGL</abbr> surface information
16        </p>
17      </div>
18      <div class="refsynopsisdiv">
19        <h2>C Specification</h2>
20        <div class="funcsynopsis">
21          <table style="border: 0; cellspacing: 0; cellpadding: 0;" class="funcprototype-table">
22            <tr>
23              <td>
24                <code class="funcdef">EGLBoolean <strong class="fsfunc">eglQuerySurface</strong>(</code>
25              </td>
26              <td>EGLDisplay <var class="pdparam">display</var>, </td>
27            </tr>
28            <tr>
29              <td> </td>
30              <td>EGLSurface <var class="pdparam">surface</var>, </td>
31            </tr>
32            <tr>
33              <td> </td>
34              <td>EGLint <var class="pdparam">attribute</var>, </td>
35            </tr>
36            <tr>
37              <td> </td>
38              <td>EGLint * <var class="pdparam">value</var><code>)</code>;</td>
39            </tr>
40          </table>
41          <div class="funcprototype-spacer"> </div>
42        </div>
43      </div>
44      <div class="refsect1" id="parameters">
45        <h2>Parameters</h2>
46        <div class="variablelist">
47          <dl class="variablelist">
48            <dt>
49              <span class="term">
50                <em class="parameter">
51                  <code>display</code>
52                </em>
53              </span>
54            </dt>
55            <dd>
56              <p>
57                        Specifies the EGL display connection.
58                    </p>
59            </dd>
60            <dt>
61              <span class="term">
62                <em class="parameter">
63                  <code>surface</code>
64                </em>
65              </span>
66            </dt>
67            <dd>
68              <p>
69                        Specifies the EGL surface to query.
70                    </p>
71            </dd>
72            <dt>
73              <span class="term">
74                <em class="parameter">
75                  <code>attribute</code>
76                </em>
77              </span>
78            </dt>
79            <dd>
80              <p>
81                        Specifies the EGL surface attribute to be returned.
82                    </p>
83            </dd>
84            <dt>
85              <span class="term">
86                <em class="parameter">
87                  <code>value</code>
88                </em>
89              </span>
90            </dt>
91            <dd>
92              <p>
93                        Returns the requested value.
94                    </p>
95            </dd>
96          </dl>
97        </div>
98      </div>
99      <div class="refsect1" id="description">
100        <h2>Description</h2>
101        <p>
102            <code class="function">eglQuerySurface</code> returns in
103            <em class="parameter"><code>value</code></em> the value of
104            <em class="parameter"><code>attribute</code></em> for <em class="parameter"><code>surface</code></em>.
105            <em class="parameter"><code>attribute</code></em> can be one of the following:
106        </p>
107        <div class="variablelist">
108          <dl class="variablelist">
109            <dt>
110              <span class="term">
111                <code class="constant">EGL_CONFIG_ID</code>
112              </span>
113            </dt>
114            <dd>
115              <p>
116                    Returns the ID of the EGL frame buffer configuration
117                    with respect to which the surface was created.
118                </p>
119            </dd>
120            <dt>
121              <span class="term">
122                <code class="constant">EGL_HEIGHT</code>
123              </span>
124            </dt>
125            <dd>
126              <p>
127                    Returns the height of the surface in pixels.
128                </p>
129            </dd>
130            <dt>
131              <span class="term">
132                <code class="constant">EGL_HORIZONTAL_RESOLUTION</code>
133              </span>
134            </dt>
135            <dd>
136              <p>
137                    Returns the horizontal dot pitch of the display on
138                    which a window surface is visible. The value
139                    returned is equal to the actual dot pitch, in
140                    pixels/meter, multiplied by the constant value
141                    <code class="constant">EGL_DISPLAY_SCALING</code>.
142                </p>
143            </dd>
144            <dt>
145              <span class="term">
146                <code class="constant">EGL_LARGEST_PBUFFER</code>
147              </span>
148            </dt>
149            <dd>
150              <p>
151                    Returns the same attribute value specified when the
152                    surface was created with
153                    <a class="citerefentry" href="eglCreatePbufferSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePbufferSurface</span></span></a>.
154                    For a window or pixmap surface,
155                    <em class="parameter"><code>value</code></em> is not modified.
156                </p>
157            </dd>
158            <dt>
159              <span class="term">
160                <code class="constant">EGL_MIPMAP_LEVEL</code>
161              </span>
162            </dt>
163            <dd>
164              <p>
165                    Returns which level of the mipmap to render to, if
166                    texture has mipmaps.
167                </p>
168            </dd>
169            <dt>
170              <span class="term">
171                <code class="constant">EGL_MIPMAP_TEXTURE</code>
172              </span>
173            </dt>
174            <dd>
175              <p>
176                    Returns <code class="constant">EGL_TRUE</code> if texture has
177                    mipmaps, <code class="constant">EGL_FALSE</code> otherwise.
178                </p>
179            </dd>
180            <dt>
181              <span class="term">
182                <code class="constant">EGL_MULTISAMPLE_RESOLVE</code>
183              </span>
184            </dt>
185            <dd>
186              <p>
187                    Returns the filter used when resolving the
188                    multisample buffer. The filter may be either
189                    <code class="constant">EGL_MULTISAMPLE_RESOLVE_DEFAULT</code>
190                    or <code class="constant">EGL_MULTISAMPLE_RESOLVE_BOX</code>,
191                    as described for
192                    <a class="citerefentry" href="eglSurfaceAttrib.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSurfaceAttrib</span></span></a>.
193                </p>
194            </dd>
195            <dt>
196              <span class="term">
197                <code class="constant">EGL_PIXEL_ASPECT_RATIO</code>
198              </span>
199            </dt>
200            <dd>
201              <p>
202                    Returns the aspect ratio of an individual pixel (the
203                    ratio of a pixel's width to its height). The value
204                    returned is equal to the actual aspect ratio
205                    multiplied by the constant value
206                    <code class="constant">EGL_DISPLAY_SCALING</code>.
207                </p>
208            </dd>
209            <dt>
210              <span class="term">
211                <code class="constant">EGL_RENDER_BUFFER</code>
212              </span>
213            </dt>
214            <dd>
215              <p>
216                    Returns the buffer which client API rendering is
217                    requested to use. For a window surface, this is the
218                    same attribute value specified when the surface was
219                    created. For a pbuffer surface, it is always
220                    <code class="constant">EGL_BACK_BUFFER</code>. For a pixmap
221                    surface, it is always
222                    <code class="constant">EGL_SINGLE_BUFFER</code>. To determine
223                    the actual buffer being rendered to by a context,
224                    call
225                    <a class="citerefentry" href="eglQueryContext.xhtml"><span class="citerefentry"><span class="refentrytitle">eglQueryContext</span></span></a>.
226                </p>
227            </dd>
228            <dt>
229              <span class="term">
230                <code class="constant">EGL_SWAP_BEHAVIOR</code>
231              </span>
232            </dt>
233            <dd>
234              <p>
235                    Returns the effect on the color buffer when posting
236                    a surface with
237                    <a class="citerefentry" href="eglSwapBuffers.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSwapBuffers</span></span></a>.
238                    Swap behavior may be either
239                    <code class="constant">EGL_BUFFER_PRESERVED</code> or
240                    <code class="constant">EGL_BUFFER_DESTROYED</code>, as
241                    described for
242                    <a class="citerefentry" href="eglSurfaceAttrib.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSurfaceAttrib</span></span></a>.
243                </p>
244            </dd>
245            <dt>
246              <span class="term">
247                <code class="constant">EGL_TEXTURE_FORMAT</code>
248              </span>
249            </dt>
250            <dd>
251              <p>
252                    Returns format of texture. Possible values are
253                    <code class="constant">EGL_NO_TEXTURE</code>,
254                    <code class="constant">EGL_TEXTURE_RGB</code>, and
255                    <code class="constant">EGL_TEXTURE_RGBA</code>.
256                </p>
257            </dd>
258            <dt>
259              <span class="term">
260                <code class="constant">EGL_TEXTURE_TARGET</code>
261              </span>
262            </dt>
263            <dd>
264              <p>
265                    Returns type of texture. Possible values are
266                    <code class="constant">EGL_NO_TEXTURE</code>, or
267                    <code class="constant">EGL_TEXTURE_2D</code>.
268                </p>
269            </dd>
270            <dt>
271              <span class="term">
272                <code class="constant">EGL_VERTICAL_RESOLUTION</code>
273              </span>
274            </dt>
275            <dd>
276              <p>
277                    Returns the vertical dot pitch of the display on
278                    which a window surface is visible. The value
279                    returned is equal to the actual dot pitch, in
280                    pixels/meter, multiplied by the constant value
281                    <code class="constant">EGL_DISPLAY_SCALING</code>.
282                </p>
283            </dd>
284            <dt>
285              <span class="term">
286                <code class="constant">EGL_WIDTH</code>
287              </span>
288            </dt>
289            <dd>
290              <p>
291                    Returns the width of the surface in pixels.
292                </p>
293            </dd>
294          </dl>
295        </div>
296      </div>
297      <div class="refsect1" id="notes">
298        <h2>Notes</h2>
299        <p>
300            Attribute <code class="constant">EGL_MULTISAMPLE_RESOLVE</code> is
301            supported only if the EGL version is 1.4 or greater.
302        </p>
303        <p>
304            Attributes <code class="constant">EGL_DISPLAY_SCALING</code>.
305            <code class="constant">EGL_HORIZONTAL_RESOLUTION</code>,
306            <code class="constant">EGL_PIXEL_ASPECT_RATIO</code>,
307            <code class="constant">EGL_RENDER_BUFFER</code>,
308            <code class="constant">EGL_SWAP_BEHAVIOR</code>, and
309            <code class="constant">EGL_VERTICAL_RESOLUTION</code> are supported
310            only if the EGL version is 1.2 or greater.
311        </p>
312        <p>
313            Querying attributes <code class="constant">EGL_TEXTURE_FORMAT</code>,
314            <code class="constant">EGL_TEXTURE_TARGET</code>,
315            <code class="constant">EGL_MIPMAP_TEXTURE</code>, or
316            <code class="constant">EGL_MIPMAP_LEVEL</code> for a non-pbuffer
317            surface is not an error, but <em class="parameter"><code>value</code></em> is
318            not modified.
319        </p>
320        <p>
321            <code class="constant">EGL_DISPLAY_SCALING</code> is the constant
322            value 10000. Floating-point values such as resolution and
323            pixel aspect ratio are scaled by this value before being
324            returned as integers so that sufficient precision to be
325            meaningful will be retained in the returned value.
326        </p>
327        <p>
328            For an offscreen (pbuffer or pixmap) surface, or a surface
329            whose pixel dot pitch or aspect ratio are unknown, querying
330            <code class="constant">EGL_HORIZONTAL_RESOLUTION</code>,
331            <code class="constant">EGL_PIXEL_ASPECT_RATIO</code>, or
332            <code class="constant">EGL_VERTICAL_RESOLUTION</code> will return the
333            constant value <code class="constant">EGL_UNKNOWN</code> (-1).
334        </p>
335      </div>
336      <div class="refsect1" id="errors">
337        <h2>Errors</h2>
338        <p>
339            <code class="constant">EGL_FALSE</code> is returned on failure,
340            <code class="constant">EGL_TRUE</code> otherwise.
341            <em class="parameter"><code>value</code></em> is not modified when
342            <code class="constant">EGL_FALSE</code> is returned.
343        </p>
344        <p>
345            <code class="constant">EGL_BAD_DISPLAY</code> is generated if
346            <em class="parameter"><code>display</code></em> is not an EGL display connection.
347        </p>
348        <p>
349            <code class="constant">EGL_NOT_INITIALIZED</code> is generated if
350            <em class="parameter"><code>display</code></em> has not been initialized.
351        </p>
352        <p>
353            <code class="constant">EGL_BAD_SURFACE</code> is generated if
354            <em class="parameter"><code>surface</code></em> is not an EGL surface.
355        </p>
356        <p>
357            <code class="constant">EGL_BAD_ATTRIBUTE</code> is generated if
358            <em class="parameter"><code>attribute</code></em> is not a valid surface attribute.
359        </p>
360      </div>
361      <div class="refsect1" id="seealso">
362        <h2>See Also</h2>
363        <p>
364            <a class="citerefentry" href="eglCreatePbufferSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePbufferSurface</span></span></a>,
365            <a class="citerefentry" href="eglCreatePixmapSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePixmapSurface</span></span></a>,
366            <a class="citerefentry" href="eglCreateWindowSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreateWindowSurface</span></span></a>,
367            <a class="citerefentry" href="eglSurfaceAttrib.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSurfaceAttrib</span></span></a>,
368            <a class="citerefentry" href="eglSwapBuffers.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSwapBuffers</span></span></a>
369        </p>
370      </div>
371      <p>
372    </p>
373      <div class="refsect3" id="copyright">
374        <img src="KhronosLogo.jpg"/>
375        <p>
376            Copyright © 2003-2014 The Khronos Group Inc.
377            Permission is hereby granted, free of charge, to any person obtaining a
378            copy of this software and/or associated documentation files (the
379            "Materials"), to deal in the Materials without restriction, including
380            without limitation the rights to use, copy, modify, merge, publish,
381            distribute, sublicense, and/or sell copies of the Materials, and to
382            permit persons to whom the Materials are furnished to do so, subject to
383            the condition that this copyright notice and permission notice shall be included
384            in all copies or substantial portions of the Materials.
385        </p>
386      </div>
387      <p>
388</p>
389    </div>
390    <footer/>
391  </body>
392</html>
393