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">eglChooseConfig - 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="eglChooseConfig"> 11 <div class="titlepage"/> 12 <div class="refnamediv"> 13 <h2>Name</h2> 14 <p>eglChooseConfig — 15 return a list of EGL frame buffer configurations that match specified attributes 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">eglChooseConfig</strong>(</code> 25 </td> 26 <td>EGLDisplay <var class="pdparam">display</var>, </td> 27 </tr> 28 <tr> 29 <td> </td> 30 <td>EGLint const * <var class="pdparam">attrib_list</var>, </td> 31 </tr> 32 <tr> 33 <td> </td> 34 <td>EGLConfig * <var class="pdparam">configs</var>, </td> 35 </tr> 36 <tr> 37 <td> </td> 38 <td>EGLint <var class="pdparam">config_size</var>, </td> 39 </tr> 40 <tr> 41 <td> </td> 42 <td>EGLint * <var class="pdparam">num_config</var><code>)</code>;</td> 43 </tr> 44 </table> 45 <div class="funcprototype-spacer"> </div> 46 </div> 47 </div> 48 <div class="refsect1" id="parameters"> 49 <h2>Parameters</h2> 50 <div class="variablelist"> 51 <dl class="variablelist"> 52 <dt> 53 <span class="term"> 54 <em class="parameter"> 55 <code>display</code> 56 </em> 57 </span> 58 </dt> 59 <dd> 60 <p>Specifies the EGL display connection.</p> 61 </dd> 62 <dt> 63 <span class="term"> 64 <em class="parameter"> 65 <code>attrib_list</code> 66 </em> 67 </span> 68 </dt> 69 <dd> 70 <p>Specifies attributes required to match by configs.</p> 71 </dd> 72 <dt> 73 <span class="term"> 74 <em class="parameter"> 75 <code>configs</code> 76 </em> 77 </span> 78 </dt> 79 <dd> 80 <p>Returns an array of frame buffer configurations.</p> 81 </dd> 82 <dt> 83 <span class="term"> 84 <em class="parameter"> 85 <code>config_size</code> 86 </em> 87 </span> 88 </dt> 89 <dd> 90 <p>Specifies the size of the array of frame buffer configurations.</p> 91 </dd> 92 <dt> 93 <span class="term"> 94 <em class="parameter"> 95 <code>num_config</code> 96 </em> 97 </span> 98 </dt> 99 <dd> 100 <p>Returns the number of frame buffer configurations returned.</p> 101 </dd> 102 </dl> 103 </div> 104 </div> 105 <div class="refsect1" id="description"> 106 <h2>Description</h2> 107 <p> 108 <code class="function">eglChooseConfig</code> returns in 109 <em class="parameter"><code>configs</code></em> a list of all 110 <abbr class="acronym">EGL</abbr> frame buffer configurations that 111 match the attributes specified in 112 <em class="parameter"><code>attrib_list</code></em>. The returned 113 <span class="type">EGLConfig</span>s can be used in any 114 <abbr class="acronym">EGL</abbr> function that requires an 115 <abbr class="acronym">EGL</abbr> frame buffer configuration. 116 </p> 117 <p> 118 If <em class="parameter"><code>configs</code></em> is not 119 <code class="constant">NULL</code>, up to 120 <em class="parameter"><code>config_size</code></em> configs will be returned 121 in the array pointed to by <em class="parameter"><code>configs</code></em>. 122 The number of configs actually returned will be returned in 123 *<em class="parameter"><code>num_config</code></em>. 124 </p> 125 <p> 126 If <em class="parameter"><code>configs</code></em> is 127 <code class="constant">NULL</code>, no configs will be returned in 128 <em class="parameter"><code>configs</code></em>. Instead, the total number of 129 configs matching <em class="parameter"><code>attrib_list</code></em> will be 130 returned in *<em class="parameter"><code>num_config</code></em>. In this case 131 <em class="parameter"><code>config_size</code></em> is ignored. This form of 132 <code class="function">eglChooseConfig</code> is used to determine 133 the number of matching frame buffer configurations, followed 134 by allocating an array of <span class="type">EGLConfig</span> to pass 135 into another call to <code class="function">eglChooseConfig</code> 136 with all other parameters unchanged. 137 </p> 138 <p> 139 All attributes in <em class="parameter"><code>attrib_list</code></em>, 140 including boolean attributes, are immediately followed by 141 the corresponding desired value. The list is terminated with 142 <code class="constant">EGL_NONE</code>. If an attribute is not 143 specified in <em class="parameter"><code>attrib_list</code></em> then the 144 default value (see below) is used (and the attribute is said 145 to be specified implicitly). For example, if 146 <code class="constant">EGL_DEPTH_SIZE</code> is not specified then it 147 is assumed to be zero. For some attributes, the default is 148 <code class="constant">EGL_DONT_CARE</code> meaning that any value is 149 OK for this attribute, so the attribute will not be checked. 150 </p> 151 <p> 152 Attributes are matched in an attribute-specific manner. Some 153 of the attributes, such as <code class="constant">EGL_LEVEL</code>, 154 must match the specified value exactly. Others, such as, 155 <code class="constant">EGL_RED_SIZE</code> must meet or exceed the 156 specified minimum values. If more than one EGL frame buffer 157 configuration matching all attributes is found, then a list 158 of configurations, sorted according to the ``best'' match 159 criteria, is returned. The match criteria for each attribute 160 and the exact sorting order is defined below. 161 </p> 162 <p> 163 For the bitmask attributes 164 <code class="constant">EGL_CONFORMANT</code>, 165 <code class="constant">EGL_RENDERABLE_TYPE</code>, and 166 <code class="constant">EGL_SURFACE_TYPE</code>, only the nonzero bits 167 of the mask are considered when matching. Any bits that are 168 zero in the specified bitmask attribute value may be either 169 zero or one in the resulting config's attribute value. 170 </p> 171 <p> 172 Attributes which may appear in 173 <em class="parameter"><code>attrib_list</code></em>, and their descriptions 174 and allowed values, are: 175 </p> 176 <div class="variablelist"> 177 <dl class="variablelist"> 178 <dt> 179 <span class="term"> 180 <code class="constant">EGL_ALPHA_MASK_SIZE</code> 181 </span> 182 </dt> 183 <dd> 184 <p> 185 Must be followed by a nonnegative integer that 186 indicates the desired alpha mask buffer size, in 187 bits. The smallest alpha mask buffers of at least 188 the specified size are preferred. The default value 189 is zero. 190 </p> 191 <p> 192 The alpha mask buffer is used only by OpenVG. 193 </p> 194 </dd> 195 <dt> 196 <span class="term"> 197 <code class="constant">EGL_ALPHA_SIZE</code> 198 </span> 199 </dt> 200 <dd> 201 <p> 202 Must be followed by a nonnegative integer that 203 indicates the desired size of the alpha component of 204 the color buffer, in bits. If this value is zero, 205 color buffers with the smallest alpha component size 206 are preferred. Otherwise, color buffers with the 207 largest alpha component of at least the specified 208 size are preferred. The default value is zero. 209 </p> 210 </dd> 211 <dt> 212 <span class="term"> 213 <code class="constant">EGL_BIND_TO_TEXTURE_RGB</code> 214 </span> 215 </dt> 216 <dd> 217 <p> 218 Must be followed by 219 <code class="constant">EGL_DONT_CARE</code>, 220 <code class="constant">EGL_TRUE</code>, or 221 <code class="constant">EGL_FALSE</code>. 222 If <code class="constant">EGL_TRUE</code> is specified, then 223 only frame buffer configurations that support 224 binding of color buffers to an OpenGL ES RGB texture 225 will be considered. Currently only frame buffer 226 configurations that support pbuffers allow this. The 227 default value is <code class="constant">EGL_DONT_CARE</code>. 228 </p> 229 </dd> 230 <dt> 231 <span class="term"> 232 <code class="constant">EGL_BIND_TO_TEXTURE_RGBA</code> 233 </span> 234 </dt> 235 <dd> 236 <p> 237 Must be followed by one of 238 <code class="constant">EGL_DONT_CARE</code>, 239 <code class="constant">EGL_TRUE</code>, or 240 <code class="constant">EGL_FALSE</code>. 241 If <code class="constant">EGL_TRUE</code> is specified, then 242 only frame buffer configurations that support 243 binding of color buffers to an OpenGL ES RGBA 244 texture will be considered. Currently only frame 245 buffer configurations that support pbuffers allow 246 this. The default value is 247 <code class="constant">EGL_DONT_CARE</code>. 248 </p> 249 </dd> 250 <dt> 251 <span class="term"> 252 <code class="constant">EGL_BLUE_SIZE</code> 253 </span> 254 </dt> 255 <dd> 256 <p> 257 Must be followed by a nonnegative integer that 258 indicates the desired size of the blue component of 259 the color buffer, in bits. If this value is zero, 260 color buffers with the smallest blue component size 261 are preferred. Otherwise, color buffers with the 262 largest blue component of at least the specified 263 size are preferred. The default value is zero. 264 </p> 265 </dd> 266 <dt> 267 <span class="term"> 268 <code class="constant">EGL_BUFFER_SIZE</code> 269 </span> 270 </dt> 271 <dd> 272 <p> 273 Must be followed by a nonnegative integer that 274 indicates the desired color buffer size, in bits. 275 The smallest color buffers of at least the specified 276 size are preferred. The default value is zero. 277 </p> 278 <p> 279 The color buffer size is the sum of 280 <code class="constant">EGL_RED_SIZE</code>, 281 <code class="constant">EGL_GREEN_SIZE</code>, 282 <code class="constant">EGL_BLUE_SIZE</code>, and 283 <code class="constant">EGL_ALPHA_SIZE</code>, and does not 284 include any padding bits which may be present in the 285 pixel format. It is usually preferable to specify 286 desired sizes for these color components 287 individually. 288 </p> 289 </dd> 290 <dt> 291 <span class="term"> 292 <code class="constant">EGL_COLOR_BUFFER_TYPE</code> 293 </span> 294 </dt> 295 <dd> 296 <p> 297 Must be followed by one of 298 <code class="constant">EGL_RGB_BUFFER</code> or 299 <code class="constant">EGL_LUMINANCE_BUFFER</code>. 300 </p> 301 <p> 302 <code class="constant">EGL_RGB_BUFFER</code> indicates 303 an RGB color buffer; in this case, 304 attributes <code class="constant">EGL_RED_SIZE</code>, 305 <code class="constant">EGL_GREEN_SIZE</code> and 306 <code class="constant">EGL_BLUE_SIZE</code> must be non-zero, and 307 <code class="constant">EGL_LUMINANCE_SIZE</code> must be zero. 308 </p> 309 <p> 310 <code class="constant">EGL_LUMINANCE_BUFFER</code> indicates a luminance color 311 buffer. In this case <code class="constant">EGL_RED_SIZE</code>, 312 <code class="constant">EGL_GREEN_SIZE</code>, 313 <code class="constant">EGL_BLUE_SIZE</code> must be zero, and 314 <code class="constant">EGL_LUMINANCE_SIZE</code> must be non-zero. 315 </p> 316 <p> 317 For both RGB and luminance color buffers, 318 <code class="constant">EGL_ALPHA_SIZE</code> may be zero or 319 non-zero. 320 </p> 321 </dd> 322 <dt> 323 <span class="term"> 324 <code class="constant">EGL_CONFIG_CAVEAT</code> 325 </span> 326 </dt> 327 <dd> 328 <p> 329 Must be followed by 330 <code class="constant">EGL_DONT_CARE</code>, 331 <code class="constant">EGL_NONE</code>, 332 <code class="constant">EGL_SLOW_CONFIG</code>, or 333 <code class="constant">EGL_NON_CONFORMANT_CONFIG</code>. 334 </p> 335 <p> 336 If <code class="constant">EGL_DONT_CARE</code> is specified, 337 then configs are not matched for this attribute. The 338 default value is <code class="constant">EGL_DONT_CARE</code>. 339 </p> 340 <p> 341 If <code class="constant">EGL_NONE</code> is specified, then 342 configs are matched for this attribute, but only 343 configs with no caveats (neither 344 <code class="constant">EGL_SLOW_CONFIG</code> or 345 <code class="constant">EGL_NON_CONFORMANT_CONFIG</code>) will 346 be considered. 347 </p> 348 <p> 349 If <code class="constant">EGL_SLOW_CONFIG</code> is 350 specified, then only slow configs configurations 351 will be considered. The meaning of``slow'' is 352 implementation-dependent, but typically indicates a 353 non-hardware-accelerated (software) implementation. 354 </p> 355 <p> 356 If <code class="constant">EGL_NON_CONFORMANT_CONFIG</code> is 357 specified, then only configs supporting 358 non-conformant OpenGL ES contexts will be 359 considered. 360 </p> 361 <p> 362 If the EGL version is 1.3 or later, caveat 363 <code class="constant">EGL_NON_CONFORMANT_CONFIG</code> is 364 obsolete, since the same information can be 365 specified via the 366 <code class="constant">EGL_CONFORMANT</code> attribute on a 367 per-client-API basis, not just for OpenGL ES. 368 </p> 369 </dd> 370 <dt> 371 <span class="term"> 372 <code class="constant">EGL_CONFIG_ID</code> 373 </span> 374 </dt> 375 <dd> 376 <p> 377 Must be followed by a valid integer ID that 378 indicates the desired EGL frame buffer 379 configuration. When a 380 <code class="constant">EGL_CONFIG_ID</code> is specified, all 381 other attributes are ignored. The default value is 382 <code class="constant">EGL_DONT_CARE</code>. 383 </p> 384 <p> 385 The meaning of config IDs is 386 implementation-dependent. They are used only to 387 uniquely identify different frame buffer 388 configurations. 389 </p> 390 </dd> 391 <dt> 392 <span class="term"> 393 <code class="constant">EGL_CONFORMANT</code> 394 </span> 395 </dt> 396 <dd> 397 <p> 398 Must be followed by a bitmask indicating which types 399 of client API contexts created with respect to the 400 frame buffer configuration config must pass the 401 required conformance tests for that API. Mask bits 402 include: 403 </p> 404 <div class="variablelist"> 405 <dl class="variablelist"> 406 <dt> 407 <span class="term"> 408 <code class="constant">EGL_OPENGL_BIT</code> 409 </span> 410 </dt> 411 <dd> 412 <p> 413 Config supports creating OpenGL contexts. 414 </p> 415 </dd> 416 <dt> 417 <span class="term"> 418 <code class="constant">EGL_OPENGL_ES_BIT</code> 419 </span> 420 </dt> 421 <dd> 422 <p> 423 Config supports creating OpenGL ES 1.0 424 and/or 1.1 contexts. 425 </p> 426 </dd> 427 <dt> 428 <span class="term"> 429 <code class="constant">EGL_OPENGL_ES2_BIT</code> 430 </span> 431 </dt> 432 <dd> 433 <p> 434 Config supports creating OpenGL ES 2.0 contexts. 435 </p> 436 </dd> 437 <dt> 438 <span class="term"> 439 <code class="constant">EGL_OPENVG_BIT</code> 440 </span> 441 </dt> 442 <dd> 443 <p> 444 Config supports creating OpenVG contexts. 445 </p> 446 </dd> 447 </dl> 448 </div> 449 <p> 450 For example, if the bitmask is set to 451 <code class="constant">EGL_OPENGL_ES_BIT</code>, only frame 452 buffer configurations that support creating 453 conformant OpenGL ES contexts will match. The 454 default value is zero. 455 </p> 456 <p> 457 Most EGLConfigs should be conformant for all 458 supported client APIs, and it is rarely desirable to 459 select a nonconformant config. Conformance 460 requirements limit the number of non-conformant 461 configs that an implementation can define. 462 </p> 463 </dd> 464 <dt> 465 <span class="term"> 466 <code class="constant">EGL_DEPTH_SIZE</code> 467 </span> 468 </dt> 469 <dd> 470 <p> 471 Must be followed by a nonnegative integer that 472 indicates the desired depth buffer size, in bits. 473 The smallest depth buffers of at least the specified 474 size is preferred. If the desired size is zero, 475 frame buffer configurations with no depth buffer are 476 preferred. The default value is zero. 477 </p> 478 <p> 479 The depth buffer is used only by OpenGL and OpenGL 480 ES client APIs. 481 </p> 482 </dd> 483 <dt> 484 <span class="term"> 485 <code class="constant">EGL_GREEN_SIZE</code> 486 </span> 487 </dt> 488 <dd> 489 <p> 490 Must be followed by a nonnegative integer that 491 indicates the desired size of the green component of 492 the color buffer, in bits. If this value is zero, 493 color buffers with the smallest green component size 494 are preferred. Otherwise, color buffers with the 495 largest green component of at least the specified 496 size are preferred. The default value is zero. 497 </p> 498 </dd> 499 <dt> 500 <span class="term"> 501 <code class="constant">EGL_LEVEL</code> 502 </span> 503 </dt> 504 <dd> 505 <p> 506 Must be followed by an integer buffer level 507 specification. This specification is honored 508 exactly. Buffer level zero corresponds to the 509 default frame buffer of the display. Buffer level 510 one is the first overlay frame buffer, level two the 511 second overlay frame buffer, and so on. Negative 512 buffer levels correspond to underlay frame buffers. 513 The default value is zero. 514 </p> 515 <p> 516 Most platforms do not support buffer levels other than 517 zero. The behavior of windows placed in overlay and 518 underlay planes depends on the underlying platform. 519 </p> 520 </dd> 521 <dt> 522 <span class="term"> 523 <code class="constant">EGL_LUMINANCE_SIZE</code> 524 </span> 525 </dt> 526 <dd> 527 <p> 528 Must be followed by a nonnegative integer that 529 indicates the desired size of the luminance 530 component of the color buffer, in bits. If this 531 value is zero, color buffers with the smallest 532 luminance component size are preferred. Otherwise, 533 color buffers with the largest luminance component 534 of at least the specified size are preferred. The 535 default value is zero. 536 </p> 537 </dd> 538 <dt> 539 <span class="term"> 540 <code class="constant">EGL_MATCH_NATIVE_PIXMAP</code> 541 </span> 542 </dt> 543 <dd> 544 <p> 545 Must be followed by the handle of a valid native 546 pixmap, cast to <span class="type">EGLint</span>, or 547 <code class="constant">EGL_NONE</code>. If the value is not 548 <code class="constant">EGL_NONE</code>, only configs which 549 support creating pixmap surfaces with this pixmap 550 using 551 <a class="citerefentry" href="eglCreatePixmapSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePixmapSurface</span></span></a> 552 will match this attribute. If the value is 553 <code class="constant">EGL_NONE</code>, then configs are not 554 matched for this attribute. The default value is 555 <code class="constant">EGL_NONE</code>. 556 </p> 557 <p> 558 <code class="constant">EGL_MATCH_NATIVE_PIXMAP</code> was 559 introduced due to the difficulty of determining an 560 <span class="type">EGLConfig</span> compatibile with a native 561 pixmap using only color component sizes. 562 </p> 563 </dd> 564 <dt> 565 <span class="term"> 566 <code class="constant">EGL_NATIVE_RENDERABLE</code> 567 </span> 568 </dt> 569 <dd> 570 <p> 571 Must be followed by 572 <code class="constant">EGL_DONT_CARE</code>, 573 <code class="constant">EGL_TRUE</code>, or 574 <code class="constant">EGL_FALSE</code>. 575 If <code class="constant">EGL_TRUE</code> is specified, then 576 only frame buffer configurations that allow native 577 rendering into the surface will be considered. The 578 default value is <code class="constant">EGL_DONT_CARE</code>. 579 </p> 580 </dd> 581 <dt> 582 <span class="term"> 583 <code class="constant">EGL_MAX_SWAP_INTERVAL</code> 584 </span> 585 </dt> 586 <dd> 587 <p> 588 Must be followed by a integer that indicates the 589 maximum value that can be passed to 590 <a class="citerefentry" href="eglSwapInterval.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSwapInterval</span></span></a>. 591 The default value is 592 <code class="constant">EGL_DONT_CARE</code>. 593 </p> 594 </dd> 595 <dt> 596 <span class="term"> 597 <code class="constant">EGL_MIN_SWAP_INTERVAL</code> 598 </span> 599 </dt> 600 <dd> 601 <p> 602 Must be followed by a integer that indicates the 603 minimum value that can be passed to eglSwapInterval. 604 The default value is <code class="constant">EGL_DONT_CARE</code>. 605 </p> 606 </dd> 607 <dt> 608 <span class="term"> 609 <code class="constant">EGL_RED_SIZE</code> 610 </span> 611 </dt> 612 <dd> 613 <p> 614 Must be followed by a nonnegative integer that 615 indicates the desired size of the red component of 616 the color buffer, in bits. If this value is zero, 617 color buffers with the smallest red component size 618 are preferred. Otherwise, color buffers with the 619 largest red component of at least the specified size 620 are preferred. The default value is zero. 621 </p> 622 </dd> 623 <dt> 624 <span class="term"> 625 <code class="constant">EGL_SAMPLE_BUFFERS</code> 626 </span> 627 </dt> 628 <dd> 629 <p> 630 Must be followed by the minimum acceptable number of 631 multisample buffers. Configurations with the 632 smallest number of multisample buffers that meet or 633 exceed this minimum number are preferred. Currently 634 operation with more than one multisample buffer is 635 undefined, so only values of zero or one will 636 produce a match. The default value is zero. 637 </p> 638 </dd> 639 <dt> 640 <span class="term"> 641 <code class="constant">EGL_SAMPLES</code> 642 </span> 643 </dt> 644 <dd> 645 <p> 646 Must be followed by the minimum number of 647 samples required in multisample buffers. 648 Configurations with the smallest number of 649 samples that meet or exceed the specified 650 minimum number are preferred. Note that it is 651 possible for color samples in the multisample 652 buffer to have fewer bits than colors in the 653 main color buffers. However, multisampled 654 colors maintain at least as much color 655 resolution in aggregate as the main color 656 buffers. 657 </p> 658 </dd> 659 <dt> 660 <span class="term"> 661 <code class="constant">EGL_STENCIL_SIZE</code> 662 </span> 663 </dt> 664 <dd> 665 <p> 666 Must be followed by a nonnegative integer that 667 indicates the desired stencil buffer size, in bits. 668 The smallest stencil buffers of at least the 669 specified size are preferred. If the desired size is 670 zero, frame buffer configurations with no stencil 671 buffer are preferred. The default value is zero. 672 </p> 673 <p> 674 The stencil buffer is used only by OpenGL and 675 OpenGL ES client APIs. 676 </p> 677 </dd> 678 <dt> 679 <span class="term"> 680 <code class="constant">EGL_RENDERABLE_TYPE</code> 681 </span> 682 </dt> 683 <dd> 684 <p> 685 Must be followed by a bitmask indicating which types 686 of client API contexts the frame buffer 687 configuration must support creating with 688 <a class="citerefentry" href="eglCreateContext.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreateContext</span></span></a>). 689 Mask bits are the same as for attribute 690 <code class="constant">EGL_CONFORMANT</code>. The default 691 value is <code class="constant">EGL_OPENGL_ES_BIT</code>. 692 </p> 693 </dd> 694 <dt> 695 <span class="term"> 696 <code class="constant">EGL_SURFACE_TYPE</code> 697 </span> 698 </dt> 699 <dd> 700 <p> 701 Must be followed by a bitmask indicating which EGL 702 surface types and capabilities the frame buffer 703 configuration must support. Mask bits include: 704 </p> 705 <div class="variablelist"> 706 <dl class="variablelist"> 707 <dt> 708 <span class="term"> 709 <code class="constant">EGL_MULTISAMPLE_RESOLVE_BOX_BIT</code> 710 </span> 711 </dt> 712 <dd> 713 <p> 714 Config allows specifying box filtered 715 multisample resolve behavior with 716 <a class="citerefentry" href="eglSurfaceAttrib.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSurfaceAttrib</span></span></a>. 717 </p> 718 </dd> 719 <dt> 720 <span class="term"> 721 <code class="constant">EGL_PBUFFER_BIT</code> 722 </span> 723 </dt> 724 <dd> 725 <p> 726 Config supports creating pixel buffer surfaces. 727 </p> 728 </dd> 729 <dt> 730 <span class="term"> 731 <code class="constant">EGL_PIXMAP_BIT</code> 732 </span> 733 </dt> 734 <dd> 735 <p> 736 Config supports creating pixmap surfaces. 737 </p> 738 </dd> 739 <dt> 740 <span class="term"> 741 <code class="constant">EGL_SWAP_BEHAVIOR_PRESERVED_BIT</code> 742 </span> 743 </dt> 744 <dd> 745 <p> 746 Config allows setting swap behavior for 747 color buffers with 748 <a class="citerefentry" href="eglSurfaceAttrib.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSurfaceAttrib</span></span></a>. 749 </p> 750 </dd> 751 <dt> 752 <span class="term"> 753 <code class="constant">EGL_VG_ALPHA_FORMAT_PRE_BIT</code> 754 </span> 755 </dt> 756 <dd> 757 <p> 758 Config allows specifying OpenVG rendering 759 with premultiplied alpha values at surface 760 creation time (see 761 <a class="citerefentry" href="eglCreatePbufferSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePbufferSurface</span></span></a>, 762 <a class="citerefentry" href="eglCreatePixmapSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePixmapSurface</span></span></a>, 763 and 764 <a class="citerefentry" href="eglCreateWindowSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreateWindowSurface</span></span></a>). 765 </p> 766 </dd> 767 <dt> 768 <span class="term"> 769 <code class="constant">EGL_VG_COLORSPACE_LINEAR_BIT</code> 770 </span> 771 </dt> 772 <dd> 773 <p> 774 Config allows specifying OpenVG rendering in 775 a linear colorspace at surface creation time 776 (see 777 <a class="citerefentry" href="eglCreatePbufferSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePbufferSurface</span></span></a>, 778 <a class="citerefentry" href="eglCreatePixmapSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePixmapSurface</span></span></a>, 779 and 780 <a class="citerefentry" href="eglCreateWindowSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreateWindowSurface</span></span></a>). 781 </p> 782 </dd> 783 <dt> 784 <span class="term"> 785 <code class="constant">EGL_WINDOW_BIT</code> 786 </span> 787 </dt> 788 <dd> 789 <p> 790 Config supports creating window surfaces. 791 </p> 792 </dd> 793 </dl> 794 </div> 795 <p> 796 For example, if the bitmask is set to 797 <code class="constant">EGL_WINDOW_BIT</code> | 798 <code class="constant">EGL_PIXMAP_BIT</code>, 799 only frame buffer configurations that support both 800 windows and pixmaps will be considered. The default 801 value is <code class="constant">EGL_WINDOW_BIT</code>. 802 </p> 803 </dd> 804 <dt> 805 <span class="term"> 806 <code class="constant">EGL_TRANSPARENT_TYPE</code> 807 </span> 808 </dt> 809 <dd> 810 <p> 811 Must be followed by one of 812 <code class="constant">EGL_NONE</code> or 813 <code class="constant">EGL_TRANSPARENT_RGB</code>. If 814 <code class="constant">EGL_NONE</code> is specified, then 815 only opaque frame buffer configurations will be 816 considered. If 817 <code class="constant">EGL_TRANSPARENT_RGB</code> is 818 specified, then only transparent frame buffer 819 configurations will be considered. The default value 820 is <code class="constant">EGL_NONE</code>. 821 </p> 822 <p> 823 Most implementations support only opaque frame 824 buffer configurations. 825 </p> 826 </dd> 827 <dt> 828 <span class="term"> 829 <code class="constant">EGL_TRANSPARENT_RED_VALUE</code> 830 </span> 831 </dt> 832 <dd> 833 <p> 834 Must be followed by an integer value indicating the 835 transparent red value. The value must be between 836 zero and the maximum color buffer value for red. 837 Only frame buffer configurations that use the 838 specified transparent red value will be considered. 839 The default value is 840 <code class="constant">EGL_DONT_CARE</code>. 841 </p> 842 <p> 843 This attribute is ignored unless 844 <code class="constant">EGL_TRANSPARENT_TYPE</code> is included in 845 <em class="parameter"><code>attrib_list</code></em> and specified as 846 <code class="constant">EGL_TRANSPARENT_RGB</code>. 847 </p> 848 </dd> 849 <dt> 850 <span class="term"> 851 <code class="constant">EGL_TRANSPARENT_GREEN_VALUE</code> 852 </span> 853 </dt> 854 <dd> 855 <p> 856 Must be followed by an integer value indicating the 857 transparent green value. The value must be between 858 zero and the maximum color buffer value for green. 859 Only frame buffer configurations that use the 860 specified transparent green value will be 861 considered. The default value is 862 <code class="constant">EGL_DONT_CARE</code>. 863 </p> 864 <p> 865 This attribute is ignored unless 866 <code class="constant">EGL_TRANSPARENT_TYPE</code> is included in 867 <em class="parameter"><code>attrib_list</code></em> and specified as 868 <code class="constant">EGL_TRANSPARENT_RGB</code>. 869 </p> 870 </dd> 871 <dt> 872 <span class="term"> 873 <code class="constant">EGL_TRANSPARENT_BLUE_VALUE</code> 874 </span> 875 </dt> 876 <dd> 877 <p> 878 Must be followed by an integer value indicating the 879 transparent blue value. The value must be between 880 zero and the maximum color buffer value for blue. 881 Only frame buffer configurations that use the 882 specified transparent blue value will be considered. 883 The default value is 884 <code class="constant">EGL_DONT_CARE</code>. 885 </p> 886 <p> 887 This attribute is ignored unless 888 <code class="constant">EGL_TRANSPARENT_TYPE</code> is included in 889 <em class="parameter"><code>attrib_list</code></em> and specified as 890 <code class="constant">EGL_TRANSPARENT_RGB</code>. 891 </p> 892 </dd> 893 </dl> 894 </div> 895 <p> 896 When more than one EGL frame buffer configuration matches 897 the specified attributes, a list of matching configurations 898 is returned. The list is sorted according to the following 899 precedence rules, which are applied in ascending order 900 (i.e., configurations that are considered equal by a lower 901 numbered rule are sorted by the higher numbered rule): 902 </p> 903 <div class="orderedlist"> 904 <ol class="orderedlist" type="1"> 905 <li class="listitem"> 906 <p> 907 Special: by <code class="constant">EGL_CONFIG_CAVEAT</code>, 908 where the precedence is <code class="constant">EGL_NONE</code>, 909 <code class="constant">EGL_SLOW_CONFIG</code>, and 910 <code class="constant">EGL_NON_CONFORMANT_CONFIG</code>. 911 </p> 912 </li> 913 <li class="listitem"> 914 <p> 915 Special: by <code class="constant">EGL_COLOR_BUFFER_TYPE</code>, 916 where the precedence is 917 <code class="constant">EGL_RGB_BUFFER</code>, 918 <code class="constant">EGL_LUMINANCE_BUFFER</code>. 919 </p> 920 </li> 921 <li class="listitem"> 922 <p> 923 Special: by larger total number of color bits (for an 924 RGB color buffer, this is the sum of 925 <code class="constant">EGL_RED_SIZE</code>, 926 <code class="constant">EGL_GREEN_SIZE</code>, 927 <code class="constant">EGL_BLUE_SIZE</code>, and 928 <code class="constant">EGL_ALPHA_SIZE</code>; for a luminance 929 color buffer, the sum of 930 <code class="constant">EGL_LUMINANCE_SIZE</code> and 931 <code class="constant">EGL_ALPHA_SIZE</code>). If the requested 932 number of bits in <em class="parameter"><code>attrib_list</code></em> is 933 <code class="constant">0</code> or 934 <code class="constant">EGL_DONT_CARE</code> for a particular 935 color component, then the number of bits for that 936 component is not considered. 937 </p> 938 <p> 939 This sort rule places configs with deeper color buffers 940 before configs with shallower color buffers, which may 941 be counterintuitive. 942 </p> 943 </li> 944 <li class="listitem"> 945 <p> 946 Smaller <code class="constant">EGL_BUFFER_SIZE</code>. 947 </p> 948 </li> 949 <li class="listitem"> 950 <p> 951 Smaller <code class="constant">EGL_SAMPLE_BUFFERS</code>. 952 </p> 953 </li> 954 <li class="listitem"> 955 <p> 956 Smaller <code class="constant">EGL_SAMPLES</code>. 957 </p> 958 </li> 959 <li class="listitem"> 960 <p> 961 Smaller <code class="constant">EGL_DEPTH_SIZE</code>. 962 </p> 963 </li> 964 <li class="listitem"> 965 <p> 966 Smaller <code class="constant">EGL_STENCIL_SIZE</code>. 967 </p> 968 </li> 969 <li class="listitem"> 970 <p> 971 Smaller <code class="constant">EGL_ALPHA_MASK_SIZE</code>. 972 </p> 973 </li> 974 <li class="listitem"> 975 <p> 976 Special: <code class="constant">EGL_NATIVE_VISUAL_TYPE</code> 977 (the actual sort order is implementation-defined, 978 depending on the meaning of native visual types). 979 </p> 980 </li> 981 <li class="listitem"> 982 <p> 983 Smaller <code class="constant">EGL_CONFIG_ID</code> (this is 984 always the last sorting rule, and guarantees a unique 985 ordering). 986 </p> 987 </li> 988 </ol> 989 </div> 990 <p> 991 <span class="type">EGLConfigs</span> are not sorted with respect to the 992 attributes <code class="constant">EGL_BIND_TO_TEXTURE_RGB</code>, 993 <code class="constant">EGL_BIND_TO_TEXTURE_RGBA</code>, 994 <code class="constant">EGL_CONFORMANT</code>, 995 <code class="constant">EGL_LEVEL</code>, 996 <code class="constant">EGL_NATIVE_RENDERABLE</code>, 997 <code class="constant">EGL_MAX_SWAP_INTERVAL</code>, 998 <code class="constant">EGL_MIN_SWAP_INTERVAL</code>, 999 <code class="constant">EGL_RENDERABLE_TYPE</code>, 1000 <code class="constant">EGL_SURFACE_TYPE</code>, 1001 <code class="constant">EGL_TRANSPARENT_TYPE</code>, 1002 <code class="constant">EGL_TRANSPARENT_RED_VALUE</code>, 1003 <code class="constant">EGL_TRANSPARENT_GREEN_VALUE</code>, and 1004 <code class="constant">EGL_TRANSPARENT_BLUE_VALUE</code>. 1005 </p> 1006 </div> 1007 <div class="refsect1" id="examples"> 1008 <h2>Examples</h2> 1009 <p> 1010 The following example specifies a frame buffer configuration 1011 in the normal frame buffer (not an overlay or underlay). The 1012 returned frame buffer configuration supports a color buffer 1013 with at least 4 bits each of red, green and blue, and 1014 possibly no alpha bits. The code shown in the example may or 1015 may not have a depth buffer, or a stencil buffer. 1016 </p> 1017 <pre class="programlisting">EGLint const attrib_list[] = { 1018 EGL_RED_SIZE, 4, 1019 EGL_GREEN_SIZE, 4, 1020 EGL_BLUE_SIZE, 4, 1021 EGL_NONE 1022};</pre> 1023 </div> 1024 <div class="refsect1" id="notes"> 1025 <h2>Notes</h2> 1026 <p> 1027 <code class="constant">EGL_RENDERABLE_TYPE</code> bit 1028 <code class="constant">EGL_OPENGL_BIT</code>, and 1029 <code class="constant">EGL_SURFACE_TYPE</code> bits 1030 <code class="constant">EGL_MULTISAMPLE_RESOLVE_BOX_BIT</code> and 1031 <code class="constant">EGL_SWAP_BEHAVIOR_PRESERVED_BIT</code> are 1032 supported only if the EGL version is 1.4 or greater. 1033 </p> 1034 <p> 1035 <code class="constant">EGL_CONFORMANT</code>, 1036 <code class="constant">EGL_MATCH_NATIVE_PIXMAP</code>, 1037 <code class="constant">EGL_RENDERABLE_TYPE</code> bit 1038 <code class="constant">EGL_OPENGL_ES2_BIT</code>, and 1039 <code class="constant">EGL_SURFACE_TYPE</code> bits 1040 <code class="constant">EGL_VG_ALPHA_FORMAT_PRE_BIT</code> and 1041 <code class="constant">EGL_VG_COLORSPACE_LINEAR_BIT</code> are 1042 supported only if the EGL version is 1.3 or greater. 1043 </p> 1044 <p> 1045 <code class="constant">EGL_ALPHA_MASK_SIZE</code>, 1046 <code class="constant">EGL_COLOR_BUFFER_TYPE</code>, 1047 <code class="constant">EGL_LUMINANCE_SIZE</code>, 1048 <code class="constant">EGL_RENDERABLE_TYPE</code>, and 1049 <code class="constant">EGL_RENDERABLE_TYPE</code> bits 1050 <code class="constant">EGL_OPENGL_ES_BIT</code> and 1051 <code class="constant">EGL_OPENVG_BIT</code> are supported only if 1052 the EGL version is 1.2 or greater. 1053 </p> 1054 <p> 1055 If OpenGL or OpenGL ES rendering is supported for a 1056 luminance color buffer, it is treated as RGB rendering with 1057 the value of <code class="constant">GL_RED_BITS</code> equal to 1058 <code class="constant">EGL_LUMINANCE_SIZE</code> and the values of 1059 <code class="constant">GL_GREEN_BITS</code> and 1060 <code class="constant">GL_BLUE_BITS</code> equal to zero. The red 1061 component of fragments is written to the luminance channel 1062 of the color buffer while the green and blue components are 1063 discarded. 1064 </p> 1065 <p> 1066 <a class="citerefentry" href="eglGetConfigs.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetConfigs</span></span></a> 1067 and 1068 <a class="citerefentry" href="eglGetConfigAttrib.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetConfigAttrib</span></span></a> 1069 can be used to implement selection algorithms other than the 1070 generic one implemented by 1071 <code class="function">eglChooseConfig</code>. Call 1072 <a class="citerefentry" href="eglGetConfigs.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetConfigs</span></span></a> 1073 to retrieve all the frame buffer configurations, or 1074 alternatively, all the frame buffer configurations with a 1075 particular set of attributes. Next call 1076 <a class="citerefentry" href="eglGetConfigAttrib.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetConfigAttrib</span></span></a> 1077 to retrieve additional attributes for the frame buffer 1078 configurations and then select between them. 1079 </p> 1080 <p> 1081 EGL implementors are strongly discouraged, but not 1082 proscribed, from changing the selection algorithm used by 1083 <code class="function">eglChooseConfig</code>. Therefore, selections 1084 may change from release to release of the client-side 1085 library. 1086 </p> 1087 </div> 1088 <div class="refsect1" id="errors"> 1089 <h2>Errors</h2> 1090 <p> 1091 <code class="constant">EGL_FALSE</code> is returned on failure, 1092 <code class="constant">EGL_TRUE</code> otherwise. 1093 <em class="parameter"><code>configs</code></em> and 1094 <em class="parameter"><code>num_config</code></em> are not modified when 1095 <code class="constant">EGL_FALSE</code> is returned. 1096 </p> 1097 <p> 1098 <code class="constant">EGL_BAD_DISPLAY</code> is generated if 1099 <em class="parameter"><code>display</code></em> is not an EGL display connection. 1100 </p> 1101 <p> 1102 <code class="constant">EGL_BAD_ATTRIBUTE</code> is generated if 1103 <em class="parameter"><code>attribute_list</code></em> contains an invalid frame buffer 1104 configuration attribute or an 1105 attribute value that is unrecognized or out of range. 1106 </p> 1107 <p> 1108 <code class="constant">EGL_NOT_INITIALIZED</code> is generated if 1109 <em class="parameter"><code>display</code></em> has not been initialized. 1110 </p> 1111 <p> 1112 <code class="constant">EGL_BAD_PARAMETER</code> is generated if 1113 <em class="parameter"><code>num_config</code></em> is <code class="constant">NULL</code>. 1114 </p> 1115 </div> 1116 <div class="refsect1" id="seealso"> 1117 <h2>See Also</h2> 1118 <p> 1119 <a class="citerefentry" href="eglCreateContext.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreateContext</span></span></a>, 1120 <a class="citerefentry" href="eglCreatePbufferSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePbufferSurface</span></span></a>, 1121 <a class="citerefentry" href="eglCreatePixmapSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePixmapSurface</span></span></a>, 1122 <a class="citerefentry" href="eglCreateWindowSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreateWindowSurface</span></span></a>, 1123 <a class="citerefentry" href="eglGetConfigs.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetConfigs</span></span></a>, 1124 <a class="citerefentry" href="eglGetConfigAttrib.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetConfigAttrib</span></span></a>, 1125 <a class="citerefentry" href="eglSurfaceAttrib.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSurfaceAttrib</span></span></a>, 1126 <a class="citerefentry" href="eglSwapInterval.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSwapInterval</span></span></a> 1127 </p> 1128 </div> 1129 <p> 1130 </p> 1131 <div class="refsect3" id="copyright"> 1132 <img src="KhronosLogo.jpg"/> 1133 <p> 1134 Copyright © 2003-2014 The Khronos Group Inc. 1135 Permission is hereby granted, free of charge, to any person obtaining a 1136 copy of this software and/or associated documentation files (the 1137 "Materials"), to deal in the Materials without restriction, including 1138 without limitation the rights to use, copy, modify, merge, publish, 1139 distribute, sublicense, and/or sell copies of the Materials, and to 1140 permit persons to whom the Materials are furnished to do so, subject to 1141 the condition that this copyright notice and permission notice shall be included 1142 in all copies or substantial portions of the Materials. 1143 </p> 1144 </div> 1145 <p> 1146</p> 1147 </div> 1148 <footer/> 1149 </body> 1150</html> 1151