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.79.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_GL_COLORSPACE</code> 123 </span> 124 </dt> 125 <dd> 126 <p> 127 Returns the color space used by OpenGL and OpenGL ES 128 when rendering to the surface, either 129 <code class="constant">EGL_GL_COLORSPACE_SRGB</code> or 130 <code class="constant">EGL_GL_COLORSPACE_LINEAR</code>. 131 </p> 132 </dd> 133 <dt> 134 <span class="term"> 135 <code class="constant">EGL_HEIGHT</code> 136 </span> 137 </dt> 138 <dd> 139 <p> 140 Returns the height of the surface in pixels. 141 </p> 142 </dd> 143 <dt> 144 <span class="term"> 145 <code class="constant">EGL_HORIZONTAL_RESOLUTION</code> 146 </span> 147 </dt> 148 <dd> 149 <p> 150 Returns the horizontal dot pitch of the display on 151 which a window surface is visible. The value 152 returned is equal to the actual dot pitch, in 153 pixels/meter, multiplied by the constant value 154 <code class="constant">EGL_DISPLAY_SCALING</code>. 155 </p> 156 </dd> 157 <dt> 158 <span class="term"> 159 <code class="constant">EGL_LARGEST_PBUFFER</code> 160 </span> 161 </dt> 162 <dd> 163 <p> 164 Returns the same attribute value specified when the 165 surface was created with 166 <a class="citerefentry" href="eglCreatePbufferSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePbufferSurface</span></span></a>. 167 For a window or pixmap surface, 168 <em class="parameter"><code>value</code></em> is not modified. 169 </p> 170 </dd> 171 <dt> 172 <span class="term"> 173 <code class="constant">EGL_MIPMAP_LEVEL</code> 174 </span> 175 </dt> 176 <dd> 177 <p> 178 Returns which level of the mipmap to render to, if 179 texture has mipmaps. 180 </p> 181 </dd> 182 <dt> 183 <span class="term"> 184 <code class="constant">EGL_MIPMAP_TEXTURE</code> 185 </span> 186 </dt> 187 <dd> 188 <p> 189 Returns <code class="constant">EGL_TRUE</code> if texture has 190 mipmaps, <code class="constant">EGL_FALSE</code> otherwise. 191 </p> 192 </dd> 193 <dt> 194 <span class="term"> 195 <code class="constant">EGL_MULTISAMPLE_RESOLVE</code> 196 </span> 197 </dt> 198 <dd> 199 <p> 200 Returns the filter used when resolving the 201 multisample buffer. The filter may be either 202 <code class="constant">EGL_MULTISAMPLE_RESOLVE_DEFAULT</code> 203 or <code class="constant">EGL_MULTISAMPLE_RESOLVE_BOX</code>, 204 as described for 205 <a class="citerefentry" href="eglSurfaceAttrib.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSurfaceAttrib</span></span></a>. 206 </p> 207 </dd> 208 <dt> 209 <span class="term"> 210 <code class="constant">EGL_PIXEL_ASPECT_RATIO</code> 211 </span> 212 </dt> 213 <dd> 214 <p> 215 Returns the aspect ratio of an individual pixel (the 216 ratio of a pixel's width to its height). The value 217 returned is equal to the actual aspect ratio 218 multiplied by the constant value 219 <code class="constant">EGL_DISPLAY_SCALING</code>. 220 </p> 221 </dd> 222 <dt> 223 <span class="term"> 224 <code class="constant">EGL_RENDER_BUFFER</code> 225 </span> 226 </dt> 227 <dd> 228 <p> 229 Returns the buffer which client API rendering is 230 requested to use. For a window surface, this is the 231 same attribute value specified when the surface was 232 created. For a pbuffer surface, it is always 233 <code class="constant">EGL_BACK_BUFFER</code>. For a pixmap 234 surface, it is always 235 <code class="constant">EGL_SINGLE_BUFFER</code>. To determine 236 the actual buffer being rendered to by a context, 237 call 238 <a class="citerefentry" href="eglQueryContext.xhtml"><span class="citerefentry"><span class="refentrytitle">eglQueryContext</span></span></a>. 239 </p> 240 </dd> 241 <dt> 242 <span class="term"> 243 <code class="constant">EGL_SWAP_BEHAVIOR</code> 244 </span> 245 </dt> 246 <dd> 247 <p> 248 Returns the effect on the color buffer when posting 249 a surface with 250 <a class="citerefentry" href="eglSwapBuffers.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSwapBuffers</span></span></a>. 251 Swap behavior may be either 252 <code class="constant">EGL_BUFFER_PRESERVED</code> or 253 <code class="constant">EGL_BUFFER_DESTROYED</code>, as 254 described for 255 <a class="citerefentry" href="eglSurfaceAttrib.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSurfaceAttrib</span></span></a>. 256 </p> 257 </dd> 258 <dt> 259 <span class="term"> 260 <code class="constant">EGL_TEXTURE_FORMAT</code> 261 </span> 262 </dt> 263 <dd> 264 <p> 265 Returns format of texture. Possible values are 266 <code class="constant">EGL_NO_TEXTURE</code>, 267 <code class="constant">EGL_TEXTURE_RGB</code>, and 268 <code class="constant">EGL_TEXTURE_RGBA</code>. 269 </p> 270 </dd> 271 <dt> 272 <span class="term"> 273 <code class="constant">EGL_TEXTURE_TARGET</code> 274 </span> 275 </dt> 276 <dd> 277 <p> 278 Returns type of texture. Possible values are 279 <code class="constant">EGL_NO_TEXTURE</code>, or 280 <code class="constant">EGL_TEXTURE_2D</code>. 281 </p> 282 </dd> 283 <dt> 284 <span class="term"> 285 <code class="constant">EGL_VERTICAL_RESOLUTION</code> 286 </span> 287 </dt> 288 <dd> 289 <p> 290 Returns the vertical dot pitch of the display on 291 which a window surface is visible. The value 292 returned is equal to the actual dot pitch, in 293 pixels/meter, multiplied by the constant value 294 <code class="constant">EGL_DISPLAY_SCALING</code>. 295 </p> 296 </dd> 297 <dt> 298 <span class="term"> 299 <code class="constant">EGL_VG_ALPHA_FORMAT</code> 300 </span> 301 </dt> 302 <dd> 303 <p> 304 Returns the interpretation of alpha values used by 305 OpenVG when rendering to the surface, either 306 <code class="constant">EGL_VG_ALPHA_FORMAT_NONPRE</code> or 307 <code class="constant">EGL_VG_ALPHA_FORMAT_PRE</code>. 308 </p> 309 </dd> 310 <dt> 311 <span class="term"> 312 <code class="constant">EGL_VG_COLORSPACE</code> 313 </span> 314 </dt> 315 <dd> 316 <p> 317 Returns the color space used by OpenVG when rendering to 318 the surface, either 319 <code class="constant">EGL_VG_COLORSPACE_sRGB</code> or 320 <code class="constant">EGL_VG_COLORSPACE_LINEAR</code>. 321 </p> 322 </dd> 323 <dt> 324 <span class="term"> 325 <code class="constant">EGL_WIDTH</code> 326 </span> 327 </dt> 328 <dd> 329 <p> 330 Returns the width of the surface in pixels. 331 </p> 332 </dd> 333 </dl> 334 </div> 335 </div> 336 <div class="refsect1" id="notes"> 337 <h2>Notes</h2> 338 <p> 339 Attribute <code class="constant">EGL_GL_COLORSPACE</code> is supported 340 only if the EGL version is 1.5 or greater. 341 </p> 342 <p> 343 Attribute <code class="constant">EGL_MULTISAMPLE_RESOLVE</code> is 344 supported only if the EGL version is 1.4 or greater. 345 </p> 346 <p> 347 Attributes <code class="constant">EGL_DISPLAY_SCALING</code>. 348 <code class="constant">EGL_HORIZONTAL_RESOLUTION</code>, 349 <code class="constant">EGL_PIXEL_ASPECT_RATIO</code>, 350 <code class="constant">EGL_RENDER_BUFFER</code>, 351 <code class="constant">EGL_SWAP_BEHAVIOR</code>, and 352 <code class="constant">EGL_VERTICAL_RESOLUTION</code> are supported 353 only if the EGL version is 1.2 or greater. 354 </p> 355 <p> 356 Querying attributes <code class="constant">EGL_TEXTURE_FORMAT</code>, 357 <code class="constant">EGL_TEXTURE_TARGET</code>, 358 <code class="constant">EGL_MIPMAP_TEXTURE</code>, or 359 <code class="constant">EGL_MIPMAP_LEVEL</code> for a non-pbuffer 360 surface is not an error, but <em class="parameter"><code>value</code></em> is 361 not modified. 362 </p> 363 <p> 364 <code class="constant">EGL_DISPLAY_SCALING</code> is the constant 365 value 10000. Floating-point values such as resolution and 366 pixel aspect ratio are scaled by this value before being 367 returned as integers so that sufficient precision to be 368 meaningful will be retained in the returned value. 369 </p> 370 <p> 371 For an offscreen (pbuffer or pixmap) surface, or a surface 372 whose pixel dot pitch or aspect ratio are unknown, querying 373 <code class="constant">EGL_HORIZONTAL_RESOLUTION</code>, 374 <code class="constant">EGL_PIXEL_ASPECT_RATIO</code>, or 375 <code class="constant">EGL_VERTICAL_RESOLUTION</code> will return the 376 constant value <code class="constant">EGL_UNKNOWN</code> (-1). 377 </p> 378 </div> 379 <div class="refsect1" id="errors"> 380 <h2>Errors</h2> 381 <p> 382 <code class="constant">EGL_FALSE</code> is returned on failure, 383 <code class="constant">EGL_TRUE</code> otherwise. 384 <em class="parameter"><code>value</code></em> is not modified when 385 <code class="constant">EGL_FALSE</code> is returned. 386 </p> 387 <p> 388 <code class="constant">EGL_BAD_DISPLAY</code> is generated if 389 <em class="parameter"><code>display</code></em> is not an EGL display connection. 390 </p> 391 <p> 392 <code class="constant">EGL_NOT_INITIALIZED</code> is generated if 393 <em class="parameter"><code>display</code></em> has not been initialized. 394 </p> 395 <p> 396 <code class="constant">EGL_BAD_SURFACE</code> is generated if 397 <em class="parameter"><code>surface</code></em> is not an EGL surface. 398 </p> 399 <p> 400 <code class="constant">EGL_BAD_ATTRIBUTE</code> is generated if 401 <em class="parameter"><code>attribute</code></em> is not a valid surface attribute. 402 </p> 403 </div> 404 <div class="refsect1" id="seealso"> 405 <h2>See Also</h2> 406 <p> 407 <a class="citerefentry" href="eglCreatePbufferSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePbufferSurface</span></span></a>, 408 <a class="citerefentry" href="eglCreatePixmapSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePixmapSurface</span></span></a>, 409 <a class="citerefentry" href="eglCreateWindowSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreateWindowSurface</span></span></a>, 410 <a class="citerefentry" href="eglSurfaceAttrib.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSurfaceAttrib</span></span></a>, 411 <a class="citerefentry" href="eglSwapBuffers.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSwapBuffers</span></span></a> 412 </p> 413 </div> 414 <p> 415 </p> 416 <div class="refsect3" id="copyright"> 417 <img src="KhronosLogo.jpg"/> 418 <p> 419 Copyright © 2003-2014 The Khronos Group Inc. 420 Permission is hereby granted, free of charge, to any person obtaining a 421 copy of this software and/or associated documentation files (the 422 "Materials"), to deal in the Materials without restriction, including 423 without limitation the rights to use, copy, modify, merge, publish, 424 distribute, sublicense, and/or sell copies of the Materials, and to 425 permit persons to whom the Materials are furnished to do so, subject to 426 the condition that this copyright notice and permission notice shall be included 427 in all copies or substantial portions of the Materials. 428 </p> 429 </div> 430 <p> 431</p> 432 </div> 433 <footer/> 434 </body> 435</html> 436