102f4aeb0Sopenharmony_ci<?xml version="1.0" encoding="UTF-8"?> 202f4aeb0Sopenharmony_ci<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> 302f4aeb0Sopenharmony_ci<!-- saved from url=(0013)about:internet --> 402f4aeb0Sopenharmony_ci<?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" xmlns:xlink="http://www.w3.org/1999/xlink" pref:renderer="mathplayer-dl"> 502f4aeb0Sopenharmony_ci <head> 602f4aeb0Sopenharmony_ci <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 702f4aeb0Sopenharmony_ci <style xmlns="" type="text/css"> 802f4aeb0Sopenharmony_ci /* This style sets a margin around the entire page */ 902f4aeb0Sopenharmony_ci html, body { 1002f4aeb0Sopenharmony_ci margin: 10px; 1102f4aeb0Sopenharmony_ci } 1202f4aeb0Sopenharmony_ci 1302f4aeb0Sopenharmony_ci p { 1402f4aeb0Sopenharmony_ci font: normal 16px verdana, sans-serif; 1502f4aeb0Sopenharmony_ci margin: 0; 1602f4aeb0Sopenharmony_ci padding-bottom:12px; 1702f4aeb0Sopenharmony_ci } 1802f4aeb0Sopenharmony_ci 1902f4aeb0Sopenharmony_ci h1 { 2002f4aeb0Sopenharmony_ci font: bold 25px verdana, sans-serif; 2102f4aeb0Sopenharmony_ci margin-top: 0; 2202f4aeb0Sopenharmony_ci margin-bottom: 3px; 2302f4aeb0Sopenharmony_ci padding-top: 0; 2402f4aeb0Sopenharmony_ci padding-bottom: 0; 2502f4aeb0Sopenharmony_ci } 2602f4aeb0Sopenharmony_ci 2702f4aeb0Sopenharmony_ci h2 { 2802f4aeb0Sopenharmony_ci font: bold 19px verdana, sans-serif; 2902f4aeb0Sopenharmony_ci margin-top: 28px; 3002f4aeb0Sopenharmony_ci margin-bottom: 3px; 3102f4aeb0Sopenharmony_ci padding-top: 0; 3202f4aeb0Sopenharmony_ci padding-bottom: 0; 3302f4aeb0Sopenharmony_ci } 3402f4aeb0Sopenharmony_ci 3502f4aeb0Sopenharmony_ci h3 { 3602f4aeb0Sopenharmony_ci font: bold 19px verdana, sans-serif !important; 3702f4aeb0Sopenharmony_ci margin-top: 28px; 3802f4aeb0Sopenharmony_ci margin-bottom: 3px; 3902f4aeb0Sopenharmony_ci padding-top: 0; 4002f4aeb0Sopenharmony_ci padding-bottom: 0; 4102f4aeb0Sopenharmony_ci } 4202f4aeb0Sopenharmony_ci 4302f4aeb0Sopenharmony_ci li { 4402f4aeb0Sopenharmony_ci font: normal 16px verdana, sans-serif; 4502f4aeb0Sopenharmony_ci margin-top: 0; 4602f4aeb0Sopenharmony_ci margin-bottom: 18px; 4702f4aeb0Sopenharmony_ci padding-top: 0; 4802f4aeb0Sopenharmony_ci padding-bottom: 0; 4902f4aeb0Sopenharmony_ci } 5002f4aeb0Sopenharmony_ci 5102f4aeb0Sopenharmony_ci .pdparam { 5202f4aeb0Sopenharmony_ci font: italic 16px verdana, sans-serif; 5302f4aeb0Sopenharmony_ci } 5402f4aeb0Sopenharmony_ci 5502f4aeb0Sopenharmony_ci .term { 5602f4aeb0Sopenharmony_ci font: italic 16px verdana, sans-serif; 5702f4aeb0Sopenharmony_ci font-weight: normal; 5802f4aeb0Sopenharmony_ci } 5902f4aeb0Sopenharmony_ci 6002f4aeb0Sopenharmony_ci .type { 6102f4aeb0Sopenharmony_ci font: normal 16px verdana, sans-serif !important; 6202f4aeb0Sopenharmony_ci } 6302f4aeb0Sopenharmony_ci 6402f4aeb0Sopenharmony_ci .parameter { 6502f4aeb0Sopenharmony_ci font-style: italic; 6602f4aeb0Sopenharmony_ci } 6702f4aeb0Sopenharmony_ci 6802f4aeb0Sopenharmony_ci a:link, a:visited { 6902f4aeb0Sopenharmony_ci color: blue; 7002f4aeb0Sopenharmony_ci text-decoration: none; 7102f4aeb0Sopenharmony_ci font: normal 16px; 7202f4aeb0Sopenharmony_ci } 7302f4aeb0Sopenharmony_ci 7402f4aeb0Sopenharmony_ci a:hover { 7502f4aeb0Sopenharmony_ci background-color: #FFFF99; 7602f4aeb0Sopenharmony_ci font: normal 16px; 7702f4aeb0Sopenharmony_ci } 7802f4aeb0Sopenharmony_ci 7902f4aeb0Sopenharmony_ci div.funcsynopsis { 8002f4aeb0Sopenharmony_ci text-align: left; 8102f4aeb0Sopenharmony_ci background-color: #e6e6e6; 8202f4aeb0Sopenharmony_ci font: normal 16px verdana, sans-serif; 8302f4aeb0Sopenharmony_ci padding-top: 10px; 8402f4aeb0Sopenharmony_ci padding-bottom: 10px; 8502f4aeb0Sopenharmony_ci } 8602f4aeb0Sopenharmony_ci 8702f4aeb0Sopenharmony_ci div.funcsynopsis table { 8802f4aeb0Sopenharmony_ci border-collapse: separate; 8902f4aeb0Sopenharmony_ci font: normal 16px verdana, sans-serif; 9002f4aeb0Sopenharmony_ci } 9102f4aeb0Sopenharmony_ci 9202f4aeb0Sopenharmony_ci div.funcsynopsis td { 9302f4aeb0Sopenharmony_ci background-color: #e6e6e6; 9402f4aeb0Sopenharmony_ci border: 0 solid #000; 9502f4aeb0Sopenharmony_ci padding: 1px; 9602f4aeb0Sopenharmony_ci font: normal 16px verdana, sans-serif; 9702f4aeb0Sopenharmony_ci } 9802f4aeb0Sopenharmony_ci 9902f4aeb0Sopenharmony_ci div.refsect1 { 10002f4aeb0Sopenharmony_ci font-family: verdana, sans-serif; 10102f4aeb0Sopenharmony_ci font-size: 16px; 10202f4aeb0Sopenharmony_ci } 10302f4aeb0Sopenharmony_ci 10402f4aeb0Sopenharmony_ci code.constant { 10502f4aeb0Sopenharmony_ci font: normal 16px courier new, monospace !important; 10602f4aeb0Sopenharmony_ci } 10702f4aeb0Sopenharmony_ci 10802f4aeb0Sopenharmony_ci span.errorname { 10902f4aeb0Sopenharmony_ci font: normal 16px verdana, sans-serif !important; 11002f4aeb0Sopenharmony_ci } 11102f4aeb0Sopenharmony_ci 11202f4aeb0Sopenharmony_ci code.function { 11302f4aeb0Sopenharmony_ci font: bold 16px verdana, sans-serif !important; 11402f4aeb0Sopenharmony_ci } 11502f4aeb0Sopenharmony_ci 11602f4aeb0Sopenharmony_ci b.fsfunc { 11702f4aeb0Sopenharmony_ci font: bold 16px verdana, sans-serif !important; 11802f4aeb0Sopenharmony_ci } 11902f4aeb0Sopenharmony_ci 12002f4aeb0Sopenharmony_ci code.varname { 12102f4aeb0Sopenharmony_ci font: italic 16px verdana, sans-serif; 12202f4aeb0Sopenharmony_ci } 12302f4aeb0Sopenharmony_ci 12402f4aeb0Sopenharmony_ci code.replaceable { 12502f4aeb0Sopenharmony_ci font: italic 16px courier new, monospace; 12602f4aeb0Sopenharmony_ci } 12702f4aeb0Sopenharmony_ci 12802f4aeb0Sopenharmony_ci code.funcdef { 12902f4aeb0Sopenharmony_ci font: normal 16px verdana, sans-serif !important; 13002f4aeb0Sopenharmony_ci } 13102f4aeb0Sopenharmony_ci 13202f4aeb0Sopenharmony_ci .citerefentry { 13302f4aeb0Sopenharmony_ci font: normal 16px verdana, sans-serif !important; 13402f4aeb0Sopenharmony_ci } 13502f4aeb0Sopenharmony_ci 13602f4aeb0Sopenharmony_ci .parameter { 13702f4aeb0Sopenharmony_ci font-style: italic; 13802f4aeb0Sopenharmony_ci } 13902f4aeb0Sopenharmony_ci 14002f4aeb0Sopenharmony_ci code.fsfunc { 14102f4aeb0Sopenharmony_ci font: normal 16px verdana, sans-serif !important; 14202f4aeb0Sopenharmony_ci } 14302f4aeb0Sopenharmony_ci 14402f4aeb0Sopenharmony_ci /* PARAMETER: This style controls spacing between the terms in Parameter section */ 14502f4aeb0Sopenharmony_ci dt { 14602f4aeb0Sopenharmony_ci margin-top: 15px; 14702f4aeb0Sopenharmony_ci } 14802f4aeb0Sopenharmony_ci 14902f4aeb0Sopenharmony_ci /* TABLES: These styles apply to all tables OTHER than the Synopsis and Example tables */ 15002f4aeb0Sopenharmony_ci div.refsect1 table { 15102f4aeb0Sopenharmony_ci width: 100%; 15202f4aeb0Sopenharmony_ci margin-top: 10px; 15302f4aeb0Sopenharmony_ci background-color: #FFF; 15402f4aeb0Sopenharmony_ci border-collapse: collapse; 15502f4aeb0Sopenharmony_ci border-color: #000; 15602f4aeb0Sopenharmony_ci border-width: 1px; 15702f4aeb0Sopenharmony_ci font: normal 16px verdana, sans-serif; 15802f4aeb0Sopenharmony_ci } 15902f4aeb0Sopenharmony_ci 16002f4aeb0Sopenharmony_ci div.refsect1 th { 16102f4aeb0Sopenharmony_ci border-collapse: collapse; 16202f4aeb0Sopenharmony_ci border-color: #000; 16302f4aeb0Sopenharmony_ci border-width: 1px; 16402f4aeb0Sopenharmony_ci font: bold 16px verdana, sans-serif; 16502f4aeb0Sopenharmony_ci } 16602f4aeb0Sopenharmony_ci 16702f4aeb0Sopenharmony_ci div.refsect1 td { 16802f4aeb0Sopenharmony_ci background-color: #FFF; 16902f4aeb0Sopenharmony_ci padding: 5px; 17002f4aeb0Sopenharmony_ci vertical-align: text-top; 17102f4aeb0Sopenharmony_ci border-collapse: collapse; 17202f4aeb0Sopenharmony_ci border-color: #000; 17302f4aeb0Sopenharmony_ci border-width: 1px; 17402f4aeb0Sopenharmony_ci font: normal 16px verdana, sans-serif; 17502f4aeb0Sopenharmony_ci } 17602f4aeb0Sopenharmony_ci 17702f4aeb0Sopenharmony_ci div.refsect1 p{ 17802f4aeb0Sopenharmony_ci font: normal 16px verdana, sans-serif; 17902f4aeb0Sopenharmony_ci margin-top: 8px; 18002f4aeb0Sopenharmony_ci margin-bottom: 8px; 18102f4aeb0Sopenharmony_ci padding-top: 0; 18202f4aeb0Sopenharmony_ci padding-bottom: 0; 18302f4aeb0Sopenharmony_ci } 18402f4aeb0Sopenharmony_ci 18502f4aeb0Sopenharmony_ci 18602f4aeb0Sopenharmony_ci /* EXAMPLE: These styles apply only to the Example section */ 18702f4aeb0Sopenharmony_ci div.refsect2 { 18802f4aeb0Sopenharmony_ci font: normal 16px courier new, monospace !important; 18902f4aeb0Sopenharmony_ci } 19002f4aeb0Sopenharmony_ci 19102f4aeb0Sopenharmony_ci div.refsect2 table { 19202f4aeb0Sopenharmony_ci margin-top: 0; 19302f4aeb0Sopenharmony_ci background-color: #e6e6e6; 19402f4aeb0Sopenharmony_ci width: 100%; 19502f4aeb0Sopenharmony_ci border: 0 solid #000; 19602f4aeb0Sopenharmony_ci padding: 2px; 19702f4aeb0Sopenharmony_ci font: normal 16px courier new, monospace !important; 19802f4aeb0Sopenharmony_ci } 19902f4aeb0Sopenharmony_ci 20002f4aeb0Sopenharmony_ci div.refsect2 td { 20102f4aeb0Sopenharmony_ci background-color: #e6e6e6; 20202f4aeb0Sopenharmony_ci font: normal 16px courier new, monospace !important; 20302f4aeb0Sopenharmony_ci white-space:pre; 20402f4aeb0Sopenharmony_ci } 20502f4aeb0Sopenharmony_ci 20602f4aeb0Sopenharmony_ci /* COPYRIGHT: This style formats the text of the copyright statement at the bottom of the page */ 20702f4aeb0Sopenharmony_ci div.refsect3 { 20802f4aeb0Sopenharmony_ci font: normal 11px verdana, sans-serif; 20902f4aeb0Sopenharmony_ci margin-top: 50px; 21002f4aeb0Sopenharmony_ci margin-bottom: 20px; 21102f4aeb0Sopenharmony_ci padding-top: 0; 21202f4aeb0Sopenharmony_ci padding-bottom: 0; 21302f4aeb0Sopenharmony_ci } 21402f4aeb0Sopenharmony_ci 21502f4aeb0Sopenharmony_ci</style> 21602f4aeb0Sopenharmony_ci <title>eglIntro</title> 21702f4aeb0Sopenharmony_ci <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /> 21802f4aeb0Sopenharmony_ci </head> 21902f4aeb0Sopenharmony_ci <body> 22002f4aeb0Sopenharmony_ci <div class="refentry"> 22102f4aeb0Sopenharmony_ci <a id="eglIntro"></a> 22202f4aeb0Sopenharmony_ci <div class="titlepage"></div> 22302f4aeb0Sopenharmony_ci <div xmlns="" class="refnamediv"> 22402f4aeb0Sopenharmony_ci <h1>eglIntro</h1> 22502f4aeb0Sopenharmony_ci <p> 22602f4aeb0Sopenharmony_ci introduction to managing client API rendering through the 22702f4aeb0Sopenharmony_ci <acronym xmlns="http://www.w3.org/1999/xhtml" class="acronym">EGL</acronym> API. 22802f4aeb0Sopenharmony_ci </p> 22902f4aeb0Sopenharmony_ci </div> 23002f4aeb0Sopenharmony_ci <div class="refsect1"> 23102f4aeb0Sopenharmony_ci <a id="overview"></a> 23202f4aeb0Sopenharmony_ci <h2>Overview</h2> 23302f4aeb0Sopenharmony_ci <p> 23402f4aeb0Sopenharmony_ci The <em class="firstterm">Khronos Native Platform Graphics 23502f4aeb0Sopenharmony_ci Interface</em> (EGL) provides a means for rendering 23602f4aeb0Sopenharmony_ci using a <em class="firstterm">client API</em> such as OpenGL ES 23702f4aeb0Sopenharmony_ci (a 3D renderer for embedded systems), OpenGL (a functional 23802f4aeb0Sopenharmony_ci superset of OpenGL ES for desktop systems), and OpenVG (a 2D 23902f4aeb0Sopenharmony_ci vector graphics renderer) together with a native window 24002f4aeb0Sopenharmony_ci system, such as Microsoft Windows or the X Window System. 24102f4aeb0Sopenharmony_ci </p> 24202f4aeb0Sopenharmony_ci <p> 24302f4aeb0Sopenharmony_ci Depending on its implementation EGL might be more or less 24402f4aeb0Sopenharmony_ci tightly integrated into the native window system. Most EGL 24502f4aeb0Sopenharmony_ci functions require an EGL display connection, which can be 24602f4aeb0Sopenharmony_ci obtained by calling 24702f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglGetDisplay.html"><span class="citerefentry"><span class="refentrytitle">eglGetDisplay</span></span></a> 24802f4aeb0Sopenharmony_ci and passing in a native display handle or 24902f4aeb0Sopenharmony_ci <code class="constant">EGL_DEFAULT_DISPLAY</code>. To initialize and 25002f4aeb0Sopenharmony_ci query what EGL version is supported on the display 25102f4aeb0Sopenharmony_ci connection, call 25202f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglInitialize.html"><span class="citerefentry"><span class="refentrytitle">eglInitialize</span></span></a>. 25302f4aeb0Sopenharmony_ci </p> 25402f4aeb0Sopenharmony_ci <p> 25502f4aeb0Sopenharmony_ci Native window systems supporting EGL make a subset of their 25602f4aeb0Sopenharmony_ci visuals (which may also referred to as pixel formats, frame 25702f4aeb0Sopenharmony_ci buffer configurations, or other similar terms) available for 25802f4aeb0Sopenharmony_ci client API rendering. Windows and pixmaps created with these 25902f4aeb0Sopenharmony_ci visuals may also be rendered into using the native window 26002f4aeb0Sopenharmony_ci system API. 26102f4aeb0Sopenharmony_ci </p> 26202f4aeb0Sopenharmony_ci <p> 26302f4aeb0Sopenharmony_ci An EGL <em class="firstterm">surface</em> extends a native 26402f4aeb0Sopenharmony_ci window or pixmap with additional <em class="firstterm">auxillary 26502f4aeb0Sopenharmony_ci buffers</em>. These buffers include a color buffer, a 26602f4aeb0Sopenharmony_ci depth buffer, a stencil buffer, and an alpha mask buffer. 26702f4aeb0Sopenharmony_ci Some or all of the buffers listed are included in each EGL 26802f4aeb0Sopenharmony_ci frame buffer configuration. 26902f4aeb0Sopenharmony_ci </p> 27002f4aeb0Sopenharmony_ci <p> 27102f4aeb0Sopenharmony_ci EGL supports rendering into three types of surfaces: 27202f4aeb0Sopenharmony_ci windows, pixmaps and pixel buffers (pbuffers). EGL window 27302f4aeb0Sopenharmony_ci and pixmap surfaces are associated with corresponding 27402f4aeb0Sopenharmony_ci resources of the native window system. EGL pixel buffers are 27502f4aeb0Sopenharmony_ci EGL only resources, and do not accept rendering through the 27602f4aeb0Sopenharmony_ci native window system. 27702f4aeb0Sopenharmony_ci </p> 27802f4aeb0Sopenharmony_ci <p> 27902f4aeb0Sopenharmony_ci To render using a client API into an EGL surface, you must 28002f4aeb0Sopenharmony_ci determine the appropriate EGL frame buffer configuration, 28102f4aeb0Sopenharmony_ci which supports the rendering features the application 28202f4aeb0Sopenharmony_ci requires. 28302f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglChooseConfig.html"><span class="citerefentry"><span class="refentrytitle">eglChooseConfig</span></span></a> 28402f4aeb0Sopenharmony_ci returns an <span class="type">EGLConfig</span> matching the required 28502f4aeb0Sopenharmony_ci attributes, if any. A complete list of EGL frame buffer 28602f4aeb0Sopenharmony_ci configurations can be obtained by calling 28702f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglGetConfigs.html"><span class="citerefentry"><span class="refentrytitle">eglGetConfigs</span></span></a>. 28802f4aeb0Sopenharmony_ci Attributes of a particular EGL frame buffer configuration 28902f4aeb0Sopenharmony_ci can be queried by calling 29002f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglGetConfigAttrib.html"><span class="citerefentry"><span class="refentrytitle">eglGetConfigAttrib</span></span></a>. 29102f4aeb0Sopenharmony_ci </p> 29202f4aeb0Sopenharmony_ci <p> 29302f4aeb0Sopenharmony_ci For EGL window and pixmap surfaces, a suitable native window 29402f4aeb0Sopenharmony_ci or pixmap with a matching native visual must be created 29502f4aeb0Sopenharmony_ci first. For a given EGL frame buffer configuration, the 29602f4aeb0Sopenharmony_ci native visual type and ID can be retrieved with a call to 29702f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglGetConfigAttrib.html"><span class="citerefentry"><span class="refentrytitle">eglGetConfigAttrib</span></span></a>. 29802f4aeb0Sopenharmony_ci For pixel buffers, no underlying native resource is 29902f4aeb0Sopenharmony_ci required. 30002f4aeb0Sopenharmony_ci </p> 30102f4aeb0Sopenharmony_ci <p> 30202f4aeb0Sopenharmony_ci To create an EGL window surface from a native window, call 30302f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglCreateWindowSurface.html"><span class="citerefentry"><span class="refentrytitle">eglCreateWindowSurface</span></span></a>. 30402f4aeb0Sopenharmony_ci To create an EGL pixmap surface from a native pixmap, call 30502f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglCreatePixmapSurface.html"><span class="citerefentry"><span class="refentrytitle">eglCreatePixmapSurface</span></span></a>. 30602f4aeb0Sopenharmony_ci To create a pixel buffer (pbuffer) surface (which has no 30702f4aeb0Sopenharmony_ci associated native buffer), call 30802f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglCreatePbufferSurface.html"><span class="citerefentry"><span class="refentrytitle">eglCreatePbufferSurface</span></span></a> 30902f4aeb0Sopenharmony_ci To create a pixel buffer (pbuffer) surface whose color 31002f4aeb0Sopenharmony_ci buffer is provided by an OpenVG <span class="type">VGImage</span>, call 31102f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglCreatePbufferFromClientBuffer.html"><span class="citerefentry"><span class="refentrytitle">eglCreatePbufferFromClientBuffer</span></span></a>. 31202f4aeb0Sopenharmony_ci Use 31302f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglDestroySurface.html"><span class="citerefentry"><span class="refentrytitle">eglDestroySurface</span></span></a> 31402f4aeb0Sopenharmony_ci to release previously allocated resources. 31502f4aeb0Sopenharmony_ci </p> 31602f4aeb0Sopenharmony_ci <p> 31702f4aeb0Sopenharmony_ci An EGL rendering context is required to bind client API 31802f4aeb0Sopenharmony_ci rendering to an EGL surface. An EGL surface and an EGL 31902f4aeb0Sopenharmony_ci rendering context must have compatible EGL frame buffer 32002f4aeb0Sopenharmony_ci configurations. To create an EGL rendering context, call 32102f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglCreateContext.html"><span class="citerefentry"><span class="refentrytitle">eglCreateContext</span></span></a>. 32202f4aeb0Sopenharmony_ci The type of client API context created (OpenGL ES, OpenVG, 32302f4aeb0Sopenharmony_ci etc.) can be changed by first calling 32402f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglBindAPI.html"><span class="citerefentry"><span class="refentrytitle">eglBindAPI</span></span></a>. 32502f4aeb0Sopenharmony_ci </p> 32602f4aeb0Sopenharmony_ci <p> 32702f4aeb0Sopenharmony_ci An EGL rendering context may be bound to one or two EGL 32802f4aeb0Sopenharmony_ci surfaces by calling 32902f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglMakeCurrent.html"><span class="citerefentry"><span class="refentrytitle">eglMakeCurrent</span></span></a>. 33002f4aeb0Sopenharmony_ci This context/surface(s) association specifies the 33102f4aeb0Sopenharmony_ci <em class="firstterm">current context</em> and 33202f4aeb0Sopenharmony_ci <em class="firstterm">current surface</em>, and is used by all 33302f4aeb0Sopenharmony_ci client API rendering commands for the bound context until 33402f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglMakeCurrent.html"><span class="citerefentry"><span class="refentrytitle">eglMakeCurrent</span></span></a> 33502f4aeb0Sopenharmony_ci is called with different arguments. 33602f4aeb0Sopenharmony_ci </p> 33702f4aeb0Sopenharmony_ci <p> 33802f4aeb0Sopenharmony_ci Both native and client API commands may be used to operate 33902f4aeb0Sopenharmony_ci on certain surfaces, however, the two command streams are 34002f4aeb0Sopenharmony_ci not synchronized. Synchronization can be explicitly 34102f4aeb0Sopenharmony_ci specified using by calling 34202f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglWaitCLient.html"><span class="citerefentry"><span class="refentrytitle">eglWaitCLient</span></span></a>, 34302f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglWaitNative.html"><span class="citerefentry"><span class="refentrytitle">eglWaitNative</span></span></a>, 34402f4aeb0Sopenharmony_ci and possibly by calling other native window system commands. 34502f4aeb0Sopenharmony_ci </p> 34602f4aeb0Sopenharmony_ci </div> 34702f4aeb0Sopenharmony_ci <div class="refsect1"> 34802f4aeb0Sopenharmony_ci <a id="examples"></a> 34902f4aeb0Sopenharmony_ci <h2>Examples</h2> 35002f4aeb0Sopenharmony_ci <p> 35102f4aeb0Sopenharmony_ci Below is a minimal example of creating an RGBA-format window that 35202f4aeb0Sopenharmony_ci allows rendering with OpenGL ES. 35302f4aeb0Sopenharmony_ci The window is cleared to yellow when the program runs. For simplicity, 35402f4aeb0Sopenharmony_ci the program does not check for any errors. 35502f4aeb0Sopenharmony_ci </p> 35602f4aeb0Sopenharmony_ci <pre class="programlisting"> 35702f4aeb0Sopenharmony_ci#include <stdlib.h> 35802f4aeb0Sopenharmony_ci#include <unistd.h> 35902f4aeb0Sopenharmony_ci#include <EGL/egl.h> 36002f4aeb0Sopenharmony_ci#include <GLES/gl.h> 36102f4aeb0Sopenharmony_citypedef ... NativeWindowType; 36202f4aeb0Sopenharmony_ciextern NativeWindowType createNativeWindow(void); 36302f4aeb0Sopenharmony_cistatic EGLint const attribute_list[] = { 36402f4aeb0Sopenharmony_ci EGL_RED_SIZE, 1, 36502f4aeb0Sopenharmony_ci EGL_GREEN_SIZE, 1, 36602f4aeb0Sopenharmony_ci EGL_BLUE_SIZE, 1, 36702f4aeb0Sopenharmony_ci EGL_NONE 36802f4aeb0Sopenharmony_ci}; 36902f4aeb0Sopenharmony_ciint main(int argc, char ** argv) 37002f4aeb0Sopenharmony_ci{ 37102f4aeb0Sopenharmony_ci EGLDisplay display; 37202f4aeb0Sopenharmony_ci EGLConfig config; 37302f4aeb0Sopenharmony_ci EGLContext context; 37402f4aeb0Sopenharmony_ci EGLSurface surface; 37502f4aeb0Sopenharmony_ci NativeWindowType native_window; 37602f4aeb0Sopenharmony_ci EGLint num_config; 37702f4aeb0Sopenharmony_ci 37802f4aeb0Sopenharmony_ci /* get an EGL display connection */ 37902f4aeb0Sopenharmony_ci display = eglGetDisplay(EGL_DEFAULT_DISPLAY); 38002f4aeb0Sopenharmony_ci 38102f4aeb0Sopenharmony_ci /* initialize the EGL display connection */ 38202f4aeb0Sopenharmony_ci eglInitialize(display, NULL, NULL); 38302f4aeb0Sopenharmony_ci 38402f4aeb0Sopenharmony_ci /* get an appropriate EGL frame buffer configuration */ 38502f4aeb0Sopenharmony_ci eglChooseConfig(display, attribute_list, &config, 1, &num_config); 38602f4aeb0Sopenharmony_ci 38702f4aeb0Sopenharmony_ci /* create an EGL rendering context */ 38802f4aeb0Sopenharmony_ci context = eglCreateContext(display, config, EGL_NO_CONTEXT, NULL); 38902f4aeb0Sopenharmony_ci 39002f4aeb0Sopenharmony_ci /* create a native window */ 39102f4aeb0Sopenharmony_ci native_window = createNativeWindow(); 39202f4aeb0Sopenharmony_ci 39302f4aeb0Sopenharmony_ci /* create an EGL window surface */ 39402f4aeb0Sopenharmony_ci surface = eglCreateWindowSurface(display, config, native_window, NULL); 39502f4aeb0Sopenharmony_ci 39602f4aeb0Sopenharmony_ci /* connect the context to the surface */ 39702f4aeb0Sopenharmony_ci eglMakeCurrent(display, surface, surface, context); 39802f4aeb0Sopenharmony_ci 39902f4aeb0Sopenharmony_ci /* clear the color buffer */ 40002f4aeb0Sopenharmony_ci glClearColor(1.0, 1.0, 0.0, 1.0); 40102f4aeb0Sopenharmony_ci glClear(GL_COLOR_BUFFER_BIT); 40202f4aeb0Sopenharmony_ci glFlush(); 40302f4aeb0Sopenharmony_ci 40402f4aeb0Sopenharmony_ci eglSwapBuffers(display, surface); 40502f4aeb0Sopenharmony_ci 40602f4aeb0Sopenharmony_ci sleep(10); 40702f4aeb0Sopenharmony_ci return EXIT_SUCCESS; 40802f4aeb0Sopenharmony_ci} 40902f4aeb0Sopenharmony_ci</pre> 41002f4aeb0Sopenharmony_ci </div> 41102f4aeb0Sopenharmony_ci <div class="refsect1"> 41202f4aeb0Sopenharmony_ci <a id="usingeglextensions"></a> 41302f4aeb0Sopenharmony_ci <h2>Using EGL Extensions</h2> 41402f4aeb0Sopenharmony_ci <p> 41502f4aeb0Sopenharmony_ci All supported EGL extensions will have a corresponding definition in 41602f4aeb0Sopenharmony_ci <code class="filename">egl.h</code> and a token in the extensions string returned 41702f4aeb0Sopenharmony_ci by 41802f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglQueryString.html"><span class="citerefentry"><span class="refentrytitle">eglQueryString</span></span></a>. 41902f4aeb0Sopenharmony_ci </p> 42002f4aeb0Sopenharmony_ci </div> 42102f4aeb0Sopenharmony_ci <div class="refsect1"> 42202f4aeb0Sopenharmony_ci <a id="futureeglversions"></a> 42302f4aeb0Sopenharmony_ci <h2>Future EGL Versions</h2> 42402f4aeb0Sopenharmony_ci <p> 42502f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglInitialize.html"><span class="citerefentry"><span class="refentrytitle">eglInitialize</span></span></a> 42602f4aeb0Sopenharmony_ci and 42702f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglQueryString.html"><span class="citerefentry"><span class="refentrytitle">eglQueryString</span></span></a> 42802f4aeb0Sopenharmony_ci can be used to determine at run-time what version of EGL is available. 42902f4aeb0Sopenharmony_ci To check the EGL version at compile-time, test whether 43002f4aeb0Sopenharmony_ci <code class="constant">EGL_VERSION_<em class="replaceable"><code>x</code></em>_<em class="replaceable"><code>y</code></em></code> 43102f4aeb0Sopenharmony_ci is defined, where <em class="replaceable"><code>x</code></em> and 43202f4aeb0Sopenharmony_ci <em class="replaceable"><code>y</code></em> are the major and minor version 43302f4aeb0Sopenharmony_ci numbers. 43402f4aeb0Sopenharmony_ci </p> 43502f4aeb0Sopenharmony_ci </div> 43602f4aeb0Sopenharmony_ci <div class="refsect1"> 43702f4aeb0Sopenharmony_ci <a id="files"></a> 43802f4aeb0Sopenharmony_ci <h2>Files</h2> 43902f4aeb0Sopenharmony_ci <div class="variablelist"> 44002f4aeb0Sopenharmony_ci <dl class="variablelist"> 44102f4aeb0Sopenharmony_ci <dt> 44202f4aeb0Sopenharmony_ci <span class="term"> 44302f4aeb0Sopenharmony_ci <code class="filename">GLES/egl.h</code> 44402f4aeb0Sopenharmony_ci </span> 44502f4aeb0Sopenharmony_ci </dt> 44602f4aeb0Sopenharmony_ci <dd> 44702f4aeb0Sopenharmony_ci <p> 44802f4aeb0Sopenharmony_ci EGL header file 44902f4aeb0Sopenharmony_ci </p> 45002f4aeb0Sopenharmony_ci </dd> 45102f4aeb0Sopenharmony_ci </dl> 45202f4aeb0Sopenharmony_ci </div> 45302f4aeb0Sopenharmony_ci </div> 45402f4aeb0Sopenharmony_ci <div class="refsect1"> 45502f4aeb0Sopenharmony_ci <a id="seealso"></a> 45602f4aeb0Sopenharmony_ci <h2>See Also</h2> 45702f4aeb0Sopenharmony_ci <p> 45802f4aeb0Sopenharmony_ci 45902f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglBindAPI.html"><span class="citerefentry"><span class="refentrytitle">eglBindAPI</span></span></a>, 46002f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglChooseConfig.html"><span class="citerefentry"><span class="refentrytitle">eglChooseConfig</span></span></a>, 46102f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglCreateContext.html"><span class="citerefentry"><span class="refentrytitle">eglCreateContext</span></span></a>, 46202f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglCreatePbufferFromClientBuffer.html"><span class="citerefentry"><span class="refentrytitle">eglCreatePbufferFromClientBuffer</span></span></a>, 46302f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglCreatePbufferSurface.html"><span class="citerefentry"><span class="refentrytitle">eglCreatePbufferSurface</span></span></a>, 46402f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglCreatePixmapSurface.html"><span class="citerefentry"><span class="refentrytitle">eglCreatePixmapSurface</span></span></a>, 46502f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglCreateWindowSurface.html"><span class="citerefentry"><span class="refentrytitle">eglCreateWindowSurface</span></span></a>, 46602f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglDestroyContext.html"><span class="citerefentry"><span class="refentrytitle">eglDestroyContext</span></span></a>, 46702f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglDestroySurface.html"><span class="citerefentry"><span class="refentrytitle">eglDestroySurface</span></span></a>, 46802f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglGetConfigs.html"><span class="citerefentry"><span class="refentrytitle">eglGetConfigs</span></span></a>, 46902f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglGetDisplay.html"><span class="citerefentry"><span class="refentrytitle">eglGetDisplay</span></span></a>, 47002f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglInitialize.html"><span class="citerefentry"><span class="refentrytitle">eglInitialize</span></span></a>, 47102f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglMakeCurrent.html"><span class="citerefentry"><span class="refentrytitle">eglMakeCurrent</span></span></a>, 47202f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglQueryString.html"><span class="citerefentry"><span class="refentrytitle">eglQueryString</span></span></a>, 47302f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglSwapBuffers.html"><span class="citerefentry"><span class="refentrytitle">eglSwapBuffers</span></span></a>, 47402f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglTerminate.html"><span class="citerefentry"><span class="refentrytitle">eglTerminate</span></span></a>, 47502f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglWaitGL.html"><span class="citerefentry"><span class="refentrytitle">eglWaitGL</span></span></a>, 47602f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglWaitNative.html"><span class="citerefentry"><span class="refentrytitle">eglWaitNative</span></span></a> 47702f4aeb0Sopenharmony_ci </p> 47802f4aeb0Sopenharmony_ci </div> 47902f4aeb0Sopenharmony_ci <div xmlns="" class="refsect3" lang="en" xml:lang="en"><a xmlns="http://www.w3.org/1999/xhtml" id="Copyright"></a><h4 xmlns="http://www.w3.org/1999/xhtml"></h4><img xmlns="http://www.w3.org/1999/xhtml" src="KhronosLogo.jpg" /><p xmlns="http://www.w3.org/1999/xhtml"></p> 48002f4aeb0Sopenharmony_ciCopyright © 2003-2014 The Khronos Group Inc. 48102f4aeb0Sopenharmony_ciPermission is hereby granted, free of charge, to any person obtaining a 48202f4aeb0Sopenharmony_cicopy of this software and/or associated documentation files (the 48302f4aeb0Sopenharmony_ci"Materials"), to deal in the Materials without restriction, including 48402f4aeb0Sopenharmony_ciwithout limitation the rights to use, copy, modify, merge, publish, 48502f4aeb0Sopenharmony_cidistribute, sublicense, and/or sell copies of the Materials, and to 48602f4aeb0Sopenharmony_cipermit persons to whom the Materials are furnished to do so, subject to 48702f4aeb0Sopenharmony_cithe condition that this copyright notice and permission notice shall be included 48802f4aeb0Sopenharmony_ciin all copies or substantial portions of the Materials. 48902f4aeb0Sopenharmony_ci</div> 49002f4aeb0Sopenharmony_ci </div> 49102f4aeb0Sopenharmony_ci </body> 49202f4aeb0Sopenharmony_ci</html> 493