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.78.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 OpenGL and 193 OpenGL ES client APIs. 194 </p> 195 </dd> 196 <dt> 197 <span class="term"> 198 <code class="constant">EGL_ALPHA_SIZE</code> 199 </span> 200 </dt> 201 <dd> 202 <p> 203 Must be followed by a nonnegative integer that 204 indicates the desired size of the alpha component of 205 the color buffer, in bits. If this value is zero, 206 color buffers with the smallest alpha component size 207 are preferred. Otherwise, color buffers with the 208 largest alpha component of at least the specified 209 size are preferred. The default value is zero. 210 </p> 211 </dd> 212 <dt> 213 <span class="term"> 214 <code class="constant">EGL_BIND_TO_TEXTURE_RGB</code> 215 </span> 216 </dt> 217 <dd> 218 <p> 219 Must be followed by 220 <code class="constant">EGL_DONT_CARE</code>, 221 <code class="constant">EGL_TRUE</code>, or 222 <code class="constant">EGL_FALSE</code>. 223 If <code class="constant">EGL_TRUE</code> is specified, then 224 only frame buffer configurations that support 225 binding of color buffers to an OpenGL ES RGB texture 226 will be considered. Currently only frame buffer 227 configurations that support pbuffers allow this. The 228 default value is <code class="constant">EGL_DONT_CARE</code>. 229 </p> 230 </dd> 231 <dt> 232 <span class="term"> 233 <code class="constant">EGL_BIND_TO_TEXTURE_RGBA</code> 234 </span> 235 </dt> 236 <dd> 237 <p> 238 Must be followed by one of 239 <code class="constant">EGL_DONT_CARE</code>, 240 <code class="constant">EGL_TRUE</code>, or 241 <code class="constant">EGL_FALSE</code>. 242 If <code class="constant">EGL_TRUE</code> is specified, then 243 only frame buffer configurations that support 244 binding of color buffers to an OpenGL ES RGBA 245 texture will be considered. Currently only frame 246 buffer configurations that support pbuffers allow 247 this. The default value is 248 <code class="constant">EGL_DONT_CARE</code>. 249 </p> 250 </dd> 251 <dt> 252 <span class="term"> 253 <code class="constant">EGL_BLUE_SIZE</code> 254 </span> 255 </dt> 256 <dd> 257 <p> 258 Must be followed by a nonnegative integer that 259 indicates the desired size of the blue component of 260 the color buffer, in bits. If this value is zero, 261 color buffers with the smallest blue component size 262 are preferred. Otherwise, color buffers with the 263 largest blue component of at least the specified 264 size are preferred. The default value is zero. 265 </p> 266 </dd> 267 <dt> 268 <span class="term"> 269 <code class="constant">EGL_BUFFER_SIZE</code> 270 </span> 271 </dt> 272 <dd> 273 <p> 274 Must be followed by a nonnegative integer that 275 indicates the desired color buffer size, in bits. 276 The smallest color buffers of at least the specified 277 size are preferred. The default value is zero. 278 </p> 279 <p> 280 The color buffer size is the sum of 281 <code class="constant">EGL_RED_SIZE</code>, 282 <code class="constant">EGL_GREEN_SIZE</code>, 283 <code class="constant">EGL_BLUE_SIZE</code>, and 284 <code class="constant">EGL_ALPHA_SIZE</code>, and does not 285 include any padding bits which may be present in the 286 pixel format. It is usually preferable to specify 287 desired sizes for these color components 288 individually. 289 </p> 290 </dd> 291 <dt> 292 <span class="term"> 293 <code class="constant">EGL_COLOR_BUFFER_TYPE</code> 294 </span> 295 </dt> 296 <dd> 297 <p> 298 Must be followed by one of 299 <code class="constant">EGL_RGB_BUFFER</code> or 300 <code class="constant">EGL_LUMINANCE_BUFFER</code>. 301 </p> 302 <p> 303 <code class="constant">EGL_RGB_BUFFER</code> indicates 304 an RGB color buffer; in this case, 305 attributes <code class="constant">EGL_RED_SIZE</code>, 306 <code class="constant">EGL_GREEN_SIZE</code> and 307 <code class="constant">EGL_BLUE_SIZE</code> must be non-zero, and 308 <code class="constant">EGL_LUMINANCE_SIZE</code> must be zero. 309 </p> 310 <p> 311 <code class="constant">EGL_LUMINANCE_BUFFER</code> indicates a luminance color 312 buffer. In this case <code class="constant">EGL_RED_SIZE</code>, 313 <code class="constant">EGL_GREEN_SIZE</code>, 314 <code class="constant">EGL_BLUE_SIZE</code> must be zero, and 315 <code class="constant">EGL_LUMINANCE_SIZE</code> must be non-zero. 316 </p> 317 <p> 318 For both RGB and luminance color buffers, 319 <code class="constant">EGL_ALPHA_SIZE</code> may be zero or 320 non-zero. 321 </p> 322 </dd> 323 <dt> 324 <span class="term"> 325 <code class="constant">EGL_CONFIG_CAVEAT</code> 326 </span> 327 </dt> 328 <dd> 329 <p> 330 Must be followed by 331 <code class="constant">EGL_DONT_CARE</code>, 332 <code class="constant">EGL_NONE</code>, 333 <code class="constant">EGL_SLOW_CONFIG</code>, or 334 <code class="constant">EGL_NON_CONFORMANT_CONFIG</code>. 335 </p> 336 <p> 337 If <code class="constant">EGL_DONT_CARE</code> is specified, 338 then configs are not matched for this attribute. The 339 default value is <code class="constant">EGL_DONT_CARE</code>. 340 </p> 341 <p> 342 If <code class="constant">EGL_NONE</code> is specified, then 343 configs are matched for this attribute, but only 344 configs with no caveats (neither 345 <code class="constant">EGL_SLOW_CONFIG</code> or 346 <code class="constant">EGL_NON_CONFORMANT_CONFIG</code>) will 347 be considered. 348 </p> 349 <p> 350 If <code class="constant">EGL_SLOW_CONFIG</code> is 351 specified, then only slow configs configurations 352 will be considered. The meaning of``slow'' is 353 implementation-dependent, but typically indicates a 354 non-hardware-accelerated (software) implementation. 355 </p> 356 <p> 357 If <code class="constant">EGL_NON_CONFORMANT_CONFIG</code> is 358 specified, then only configs supporting 359 non-conformant OpenGL ES contexts will be 360 considered. 361 </p> 362 <p> 363 If the EGL version is 1.3 or later, caveat 364 <code class="constant">EGL_NON_CONFORMANT_CONFIG</code> is 365 obsolete, since the same information can be 366 specified via the 367 <code class="constant">EGL_CONFORMANT</code> attribute on a 368 per-client-API basis, not just for OpenGL ES. 369 </p> 370 </dd> 371 <dt> 372 <span class="term"> 373 <code class="constant">EGL_CONFIG_ID</code> 374 </span> 375 </dt> 376 <dd> 377 <p> 378 Must be followed by a valid integer ID that 379 indicates the desired EGL frame buffer 380 configuration. When a 381 <code class="constant">EGL_CONFIG_ID</code> is specified, all 382 other attributes are ignored. The default value is 383 <code class="constant">EGL_DONT_CARE</code>. 384 </p> 385 <p> 386 The meaning of config IDs is 387 implementation-dependent. They are used only to 388 uniquely identify different frame buffer 389 configurations. 390 </p> 391 </dd> 392 <dt> 393 <span class="term"> 394 <code class="constant">EGL_CONFORMANT</code> 395 </span> 396 </dt> 397 <dd> 398 <p> 399 Must be followed by a bitmask indicating which types 400 of client API contexts created with respect to the 401 frame buffer configuration config must pass the 402 required conformance tests for that API. Mask bits 403 include: 404 </p> 405 <div class="variablelist"> 406 <dl class="variablelist"> 407 <dt> 408 <span class="term"> 409 <code class="constant">EGL_OPENGL_BIT</code> 410 </span> 411 </dt> 412 <dd> 413 <p> 414 Config supports creating OpenGL contexts. 415 </p> 416 </dd> 417 <dt> 418 <span class="term"> 419 <code class="constant">EGL_OPENGL_ES_BIT</code> 420 </span> 421 </dt> 422 <dd> 423 <p> 424 Config supports creating OpenGL ES 1.0 425 and/or 1.1 contexts. 426 </p> 427 </dd> 428 <dt> 429 <span class="term"> 430 <code class="constant">EGL_OPENGL_ES2_BIT</code> 431 </span> 432 </dt> 433 <dd> 434 <p> 435 Config supports creating OpenGL ES 2.0 contexts. 436 </p> 437 </dd> 438 <dt> 439 <span class="term"> 440 <code class="constant">EGL_OPENVG_BIT</code> 441 </span> 442 </dt> 443 <dd> 444 <p> 445 Config supports creating OpenVG contexts. 446 </p> 447 </dd> 448 </dl> 449 </div> 450 <p> 451 For example, if the bitmask is set to 452 <code class="constant">EGL_OPENGL_ES_BIT</code>, only frame 453 buffer configurations that support creating 454 conformant OpenGL ES contexts will match. The 455 default value is zero. 456 </p> 457 <p> 458 Most EGLConfigs should be conformant for all 459 supported client APIs, and it is rarely desirable to 460 select a nonconformant config. Conformance 461 requirements limit the number of non-conformant 462 configs that an implementation can define. 463 </p> 464 </dd> 465 <dt> 466 <span class="term"> 467 <code class="constant">EGL_DEPTH_SIZE</code> 468 </span> 469 </dt> 470 <dd> 471 <p> 472 Must be followed by a nonnegative integer that 473 indicates the desired depth buffer size, in bits. 474 The smallest depth buffers of at least the specified 475 size is preferred. If the desired size is zero, 476 frame buffer configurations with no depth buffer are 477 preferred. The default value is zero. 478 </p> 479 <p> 480 The depth buffer is used only by OpenGL and OpenGL 481 ES client APIs. 482 </p> 483 </dd> 484 <dt> 485 <span class="term"> 486 <code class="constant">EGL_GREEN_SIZE</code> 487 </span> 488 </dt> 489 <dd> 490 <p> 491 Must be followed by a nonnegative integer that 492 indicates the desired size of the green component of 493 the color buffer, in bits. If this value is zero, 494 color buffers with the smallest green component size 495 are preferred. Otherwise, color buffers with the 496 largest green component of at least the specified 497 size are preferred. The default value is zero. 498 </p> 499 </dd> 500 <dt> 501 <span class="term"> 502 <code class="constant">EGL_LEVEL</code> 503 </span> 504 </dt> 505 <dd> 506 <p> 507 Must be followed by an integer buffer level 508 specification. This specification is honored 509 exactly. Buffer level zero corresponds to the 510 default frame buffer of the display. Buffer level 511 one is the first overlay frame buffer, level two the 512 second overlay frame buffer, and so on. Negative 513 buffer levels correspond to underlay frame buffers. 514 The default value is zero. 515 </p> 516 <p> 517 Most imlementations do not support overlay or 518 underlay planes (buffer levels other than zero). 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