102f4aeb0Sopenharmony_ci<?xml version="1.0" encoding="UTF-8" standalone="no"?>
202f4aeb0Sopenharmony_ci<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml">
302f4aeb0Sopenharmony_ci  <head>
402f4aeb0Sopenharmony_ci    <title xmlns:xlink="http://www.w3.org/1999/xlink">eglMakeCurrent - EGL Reference Pages</title>
502f4aeb0Sopenharmony_ci    <link rel="stylesheet" type="text/css" href="khronos-man.css"/>
602f4aeb0Sopenharmony_ci    <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/>
702f4aeb0Sopenharmony_ci  </head>
802f4aeb0Sopenharmony_ci  <body>
902f4aeb0Sopenharmony_ci    <header/>
1002f4aeb0Sopenharmony_ci    <div class="refentry" id="eglMakeCurrent">
1102f4aeb0Sopenharmony_ci      <div class="titlepage"/>
1202f4aeb0Sopenharmony_ci      <div class="refnamediv">
1302f4aeb0Sopenharmony_ci        <h2>Name</h2>
1402f4aeb0Sopenharmony_ci        <p>eglMakeCurrent — 
1502f4aeb0Sopenharmony_ci            attach an EGL rendering context to EGL surfaces
1602f4aeb0Sopenharmony_ci        </p>
1702f4aeb0Sopenharmony_ci      </div>
1802f4aeb0Sopenharmony_ci      <div class="refsynopsisdiv">
1902f4aeb0Sopenharmony_ci        <h2>C Specification</h2>
2002f4aeb0Sopenharmony_ci        <div class="funcsynopsis">
2102f4aeb0Sopenharmony_ci          <table style="border: 0; cellspacing: 0; cellpadding: 0;" class="funcprototype-table">
2202f4aeb0Sopenharmony_ci            <tr>
2302f4aeb0Sopenharmony_ci              <td>
2402f4aeb0Sopenharmony_ci                <code class="funcdef">EGLBoolean <strong class="fsfunc">eglMakeCurrent</strong>(</code>
2502f4aeb0Sopenharmony_ci              </td>
2602f4aeb0Sopenharmony_ci              <td>EGLDisplay <var class="pdparam">display</var>, </td>
2702f4aeb0Sopenharmony_ci            </tr>
2802f4aeb0Sopenharmony_ci            <tr>
2902f4aeb0Sopenharmony_ci              <td> </td>
3002f4aeb0Sopenharmony_ci              <td>EGLSurface <var class="pdparam">draw</var>, </td>
3102f4aeb0Sopenharmony_ci            </tr>
3202f4aeb0Sopenharmony_ci            <tr>
3302f4aeb0Sopenharmony_ci              <td> </td>
3402f4aeb0Sopenharmony_ci              <td>EGLSurface <var class="pdparam">read</var>, </td>
3502f4aeb0Sopenharmony_ci            </tr>
3602f4aeb0Sopenharmony_ci            <tr>
3702f4aeb0Sopenharmony_ci              <td> </td>
3802f4aeb0Sopenharmony_ci              <td>EGLContext <var class="pdparam">context</var><code>)</code>;</td>
3902f4aeb0Sopenharmony_ci            </tr>
4002f4aeb0Sopenharmony_ci          </table>
4102f4aeb0Sopenharmony_ci          <div class="funcprototype-spacer"> </div>
4202f4aeb0Sopenharmony_ci        </div>
4302f4aeb0Sopenharmony_ci      </div>
4402f4aeb0Sopenharmony_ci      <div class="refsect1" id="parameters">
4502f4aeb0Sopenharmony_ci        <h2>Parameters</h2>
4602f4aeb0Sopenharmony_ci        <div class="variablelist">
4702f4aeb0Sopenharmony_ci          <dl class="variablelist">
4802f4aeb0Sopenharmony_ci            <dt>
4902f4aeb0Sopenharmony_ci              <span class="term">
5002f4aeb0Sopenharmony_ci                <em class="parameter">
5102f4aeb0Sopenharmony_ci                  <code>display</code>
5202f4aeb0Sopenharmony_ci                </em>
5302f4aeb0Sopenharmony_ci              </span>
5402f4aeb0Sopenharmony_ci            </dt>
5502f4aeb0Sopenharmony_ci            <dd>
5602f4aeb0Sopenharmony_ci              <p>Specifies the <abbr class="acronym">EGL</abbr> display connection.</p>
5702f4aeb0Sopenharmony_ci            </dd>
5802f4aeb0Sopenharmony_ci            <dt>
5902f4aeb0Sopenharmony_ci              <span class="term">
6002f4aeb0Sopenharmony_ci                <em class="parameter">
6102f4aeb0Sopenharmony_ci                  <code>draw</code>
6202f4aeb0Sopenharmony_ci                </em>
6302f4aeb0Sopenharmony_ci              </span>
6402f4aeb0Sopenharmony_ci            </dt>
6502f4aeb0Sopenharmony_ci            <dd>
6602f4aeb0Sopenharmony_ci              <p>Specifies the <abbr class="acronym">EGL</abbr> draw surface.</p>
6702f4aeb0Sopenharmony_ci            </dd>
6802f4aeb0Sopenharmony_ci            <dt>
6902f4aeb0Sopenharmony_ci              <span class="term">
7002f4aeb0Sopenharmony_ci                <em class="parameter">
7102f4aeb0Sopenharmony_ci                  <code>read</code>
7202f4aeb0Sopenharmony_ci                </em>
7302f4aeb0Sopenharmony_ci              </span>
7402f4aeb0Sopenharmony_ci            </dt>
7502f4aeb0Sopenharmony_ci            <dd>
7602f4aeb0Sopenharmony_ci              <p>Specifies the <abbr class="acronym">EGL</abbr> read surface.</p>
7702f4aeb0Sopenharmony_ci            </dd>
7802f4aeb0Sopenharmony_ci            <dt>
7902f4aeb0Sopenharmony_ci              <span class="term">
8002f4aeb0Sopenharmony_ci                <em class="parameter">
8102f4aeb0Sopenharmony_ci                  <code>context</code>
8202f4aeb0Sopenharmony_ci                </em>
8302f4aeb0Sopenharmony_ci              </span>
8402f4aeb0Sopenharmony_ci            </dt>
8502f4aeb0Sopenharmony_ci            <dd>
8602f4aeb0Sopenharmony_ci              <p>Specifies the <abbr class="acronym">EGL</abbr> rendering context
8702f4aeb0Sopenharmony_ci                        to be attached to the surfaces.
8802f4aeb0Sopenharmony_ci                    </p>
8902f4aeb0Sopenharmony_ci            </dd>
9002f4aeb0Sopenharmony_ci          </dl>
9102f4aeb0Sopenharmony_ci        </div>
9202f4aeb0Sopenharmony_ci      </div>
9302f4aeb0Sopenharmony_ci      <div class="refsect1" id="description">
9402f4aeb0Sopenharmony_ci        <h2>Description</h2>
9502f4aeb0Sopenharmony_ci        <p>
9602f4aeb0Sopenharmony_ci            <code class="function">eglMakeCurrent</code> binds <em class="parameter"><code>context</code></em>
9702f4aeb0Sopenharmony_ci            to the current rendering thread and to the <em class="parameter"><code>draw</code></em>
9802f4aeb0Sopenharmony_ci            and <em class="parameter"><code>read</code></em> surfaces.
9902f4aeb0Sopenharmony_ci        </p>
10002f4aeb0Sopenharmony_ci        <p>
10102f4aeb0Sopenharmony_ci            For an OpenGL or OpenGL ES context, <em class="parameter"><code>draw</code></em>
10202f4aeb0Sopenharmony_ci            is used for all operations except for any pixel data read back or copied
10302f4aeb0Sopenharmony_ci            (<a class="citerefentry" href="glReadPixels.xhtml"><span class="citerefentry"><span class="refentrytitle">glReadPixels</span></span></a>,
10402f4aeb0Sopenharmony_ci            <a class="citerefentry" href="glCopyTexImage2D.xhtml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>, and
10502f4aeb0Sopenharmony_ci            <a class="citerefentry" href="glCopyTexSubImage2D.xhtml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>),
10602f4aeb0Sopenharmony_ci            which is taken from the frame buffer values of
10702f4aeb0Sopenharmony_ci            <em class="parameter"><code>read</code></em>. Note that the same
10802f4aeb0Sopenharmony_ci            <span class="type">EGLSurface</span> may be specified for both draw and read.
10902f4aeb0Sopenharmony_ci        </p>
11002f4aeb0Sopenharmony_ci        <p>
11102f4aeb0Sopenharmony_ci            For an OpenVG context, the same <span class="type">EGLSurface</span> must be
11202f4aeb0Sopenharmony_ci            specified for both <em class="parameter"><code>draw</code></em> and
11302f4aeb0Sopenharmony_ci            <em class="parameter"><code>read</code></em>.
11402f4aeb0Sopenharmony_ci        </p>
11502f4aeb0Sopenharmony_ci        <p>
11602f4aeb0Sopenharmony_ci            If the calling thread has already a current rendering context of
11702f4aeb0Sopenharmony_ci            the same client API type as <em class="parameter"><code>context</code></em>, then
11802f4aeb0Sopenharmony_ci            that context is flushed and marked as no longer current.
11902f4aeb0Sopenharmony_ci            <em class="parameter"><code>context</code></em> is then made the current context
12002f4aeb0Sopenharmony_ci            for the calling thread. For purposes of
12102f4aeb0Sopenharmony_ci            <code class="function">eglMakeCurrent</code>, the client API type of all
12202f4aeb0Sopenharmony_ci            OpenGL ES and OpenGL contexts is considered the same. In other
12302f4aeb0Sopenharmony_ci            words, if any OpenGL ES context is currently bound and
12402f4aeb0Sopenharmony_ci            <em class="parameter"><code>context</code></em> is an OpenGL context, or if any
12502f4aeb0Sopenharmony_ci            OpenGL context is currently bound and
12602f4aeb0Sopenharmony_ci            <em class="parameter"><code>context</code></em> is an OpenGL ES context, the
12702f4aeb0Sopenharmony_ci            currently bound context will be made no longer current and
12802f4aeb0Sopenharmony_ci            <em class="parameter"><code>context</code></em> will be made current.
12902f4aeb0Sopenharmony_ci        </p>
13002f4aeb0Sopenharmony_ci        <p>
13102f4aeb0Sopenharmony_ci            OpenGL and OpenGL ES buffer mappings created by e.g.
13202f4aeb0Sopenharmony_ci            <code class="function">glMapBuffer</code> are not affected by
13302f4aeb0Sopenharmony_ci            <code class="function">eglMakeCurrent</code>; they persist whether the
13402f4aeb0Sopenharmony_ci            context owning the buffer is current or not.
13502f4aeb0Sopenharmony_ci        </p>
13602f4aeb0Sopenharmony_ci        <p>
13702f4aeb0Sopenharmony_ci            If <em class="parameter"><code>draw</code></em> is destroyed after
13802f4aeb0Sopenharmony_ci            <code class="function">eglMakeCurrent</code> is called, then subsequent
13902f4aeb0Sopenharmony_ci            rendering commands will be processed and the context state will
14002f4aeb0Sopenharmony_ci            be updated, but the surface contents become undefined. If
14102f4aeb0Sopenharmony_ci            <em class="parameter"><code>read</code></em> is destroyed after
14202f4aeb0Sopenharmony_ci            <code class="function">eglMakeCurrent</code> then pixel values
14302f4aeb0Sopenharmony_ci            <em class="parameter"><code>read</code></em> from the framebuffer (e.g., as
14402f4aeb0Sopenharmony_ci            result of calling glReadPixels) are undefined. If a native
14502f4aeb0Sopenharmony_ci            window or pixmap underlying the <em class="parameter"><code>draw</code></em> or
14602f4aeb0Sopenharmony_ci            <em class="parameter"><code>read</code></em> surfaces is destroyed, rendering and
14702f4aeb0Sopenharmony_ci            <em class="parameter"><code>read</code></em>back are handled as above.
14802f4aeb0Sopenharmony_ci        </p>
14902f4aeb0Sopenharmony_ci        <p>
15002f4aeb0Sopenharmony_ci            To release the current context without assigning a new one, set
15102f4aeb0Sopenharmony_ci            <em class="parameter"><code>context</code></em> to
15202f4aeb0Sopenharmony_ci            <code class="constant">EGL_NO_CONTEXT</code> and set
15302f4aeb0Sopenharmony_ci            <em class="parameter"><code>draw</code></em> and <em class="parameter"><code>read</code></em> to
15402f4aeb0Sopenharmony_ci            <code class="constant">EGL_NO_SURFACE</code> . The currently bound
15502f4aeb0Sopenharmony_ci            context for the client API specified by the current rendering
15602f4aeb0Sopenharmony_ci            API is flushed and marked as no longer current, and there will
15702f4aeb0Sopenharmony_ci            be no current context for that client API after
15802f4aeb0Sopenharmony_ci            <code class="function">eglMakeCurrent</code> returns. This is the only
15902f4aeb0Sopenharmony_ci            case in which <code class="function">eglMakeCurrent</code> respects the
16002f4aeb0Sopenharmony_ci            current rendering API. In all other cases, the client API
16102f4aeb0Sopenharmony_ci            affected is determined by <em class="parameter"><code>context</code></em>. This
16202f4aeb0Sopenharmony_ci            is the only case where an uninitialized display may be passed to
16302f4aeb0Sopenharmony_ci            <code class="function">eglMakeCurrent</code>.
16402f4aeb0Sopenharmony_ci        </p>
16502f4aeb0Sopenharmony_ci        <p>
16602f4aeb0Sopenharmony_ci            If ctx is not <code class="constant">EGL_NO_CONTEXT</code>, then both
16702f4aeb0Sopenharmony_ci            <em class="parameter"><code>draw</code></em> and <em class="parameter"><code>read</code></em> must
16802f4aeb0Sopenharmony_ci            not be <code class="constant">EGL_NO_SURFACE</code> unless
16902f4aeb0Sopenharmony_ci            <em class="parameter"><code>context</code></em> is a context which supports being
17002f4aeb0Sopenharmony_ci            bound without read and draw surfaces. In this case the context
17102f4aeb0Sopenharmony_ci            is made current without a default framebuffer. The meaning of
17202f4aeb0Sopenharmony_ci            this is defined by the client API of the supporting context (see
17302f4aeb0Sopenharmony_ci            chapter 4 of the OpenGL 3.0 Specification, and the
17402f4aeb0Sopenharmony_ci            <code class="constant">GL_OES_surfaceless_context</code> OpenGL ES
17502f4aeb0Sopenharmony_ci            extension.).
17602f4aeb0Sopenharmony_ci        </p>
17702f4aeb0Sopenharmony_ci        <p>
17802f4aeb0Sopenharmony_ci            The first time a OpenGL or OpenGL ES context is made current the
17902f4aeb0Sopenharmony_ci            viewport and scissor dimensions are set to the size of the
18002f4aeb0Sopenharmony_ci            <em class="parameter"><code>draw</code></em> surface (as though
18102f4aeb0Sopenharmony_ci            <code class="function">glViewport</code>(0,0,w,h) and
18202f4aeb0Sopenharmony_ci            <code class="function">glScissor</code>(0,0,<em class="parameter"><code>w</code></em>,<em class="parameter"><code>h</code></em>)
18302f4aeb0Sopenharmony_ci            were called, where <em class="parameter"><code>w</code></em> and
18402f4aeb0Sopenharmony_ci            <em class="parameter"><code>h</code></em> are the width and height of the
18502f4aeb0Sopenharmony_ci            surface, respectively). However, the viewport and scissor
18602f4aeb0Sopenharmony_ci            dimensions are not modified when <em class="parameter"><code>context</code></em>
18702f4aeb0Sopenharmony_ci            is subsequently made current. The client is responsible for
18802f4aeb0Sopenharmony_ci            resetting the viewport and scissor in this case.
18902f4aeb0Sopenharmony_ci        </p>
19002f4aeb0Sopenharmony_ci        <p>
19102f4aeb0Sopenharmony_ci            The first time <em class="parameter"><code>context</code></em> is made current,
19202f4aeb0Sopenharmony_ci            if it is without a default framebuffer (e.g. both
19302f4aeb0Sopenharmony_ci            <em class="parameter"><code>draw</code></em> and <em class="parameter"><code>read</code></em> are
19402f4aeb0Sopenharmony_ci            <code class="constant">EGL_NO_SURFACE</code> ), then the viewport and
19502f4aeb0Sopenharmony_ci            scissor regions are set as though
19602f4aeb0Sopenharmony_ci            <code class="function">glViewport</code>(0,0,0,0) and
19702f4aeb0Sopenharmony_ci            <code class="function">glScissor</code>(0,0,0,0) were called.
19802f4aeb0Sopenharmony_ci        </p>
19902f4aeb0Sopenharmony_ci        <p>
20002f4aeb0Sopenharmony_ci            Implementations may delay allocation of auxiliary buffers for a
20102f4aeb0Sopenharmony_ci            surface until they are required by a context (which may result
20202f4aeb0Sopenharmony_ci            in the <code class="constant">EGL_BAD_ALLOC</code> error described
20302f4aeb0Sopenharmony_ci            above). Once allocated, however, auxiliary buffers and their
20402f4aeb0Sopenharmony_ci            contents persist until a surface is deleted.
20502f4aeb0Sopenharmony_ci        </p>
20602f4aeb0Sopenharmony_ci        <p>
20702f4aeb0Sopenharmony_ci            Use
20802f4aeb0Sopenharmony_ci            <a class="citerefentry" href="eglGetCurrentContext.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentContext</span></span></a>,
20902f4aeb0Sopenharmony_ci            <a class="citerefentry" href="eglGetCurrentDisplay.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentDisplay</span></span></a>, and
21002f4aeb0Sopenharmony_ci            <a class="citerefentry" href="eglGetCurrentSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentSurface</span></span></a>
21102f4aeb0Sopenharmony_ci            to query the current rendering context and associated display connection and surfaces.
21202f4aeb0Sopenharmony_ci        </p>
21302f4aeb0Sopenharmony_ci      </div>
21402f4aeb0Sopenharmony_ci      <div class="refsect1" id="errors">
21502f4aeb0Sopenharmony_ci        <h2>Errors</h2>
21602f4aeb0Sopenharmony_ci        <p>
21702f4aeb0Sopenharmony_ci            If <em class="parameter"><code>draw</code></em> or <em class="parameter"><code>read</code></em>
21802f4aeb0Sopenharmony_ci            are not compatible with <em class="parameter"><code>context</code></em>, then an
21902f4aeb0Sopenharmony_ci            <code class="constant">EGL_BAD_MATCH</code> error is generated.
22002f4aeb0Sopenharmony_ci        </p>
22102f4aeb0Sopenharmony_ci        <p>
22202f4aeb0Sopenharmony_ci            If <em class="parameter"><code>context</code></em> is current to some other
22302f4aeb0Sopenharmony_ci            thread, or if either <em class="parameter"><code>draw</code></em> or
22402f4aeb0Sopenharmony_ci            <em class="parameter"><code>read</code></em> are bound to contexts in another
22502f4aeb0Sopenharmony_ci            thread, an <code class="constant">EGL_BAD_ACCESS</code> error is
22602f4aeb0Sopenharmony_ci            generated.
22702f4aeb0Sopenharmony_ci        </p>
22802f4aeb0Sopenharmony_ci        <p>
22902f4aeb0Sopenharmony_ci            If binding <em class="parameter"><code>context</code></em> would exceed the
23002f4aeb0Sopenharmony_ci            number of current contexts of that client API type supported by
23102f4aeb0Sopenharmony_ci            the implementation, an <code class="constant">EGL_BAD_ACCESS</code> error
23202f4aeb0Sopenharmony_ci            is generated.
23302f4aeb0Sopenharmony_ci        </p>
23402f4aeb0Sopenharmony_ci        <p>
23502f4aeb0Sopenharmony_ci            If either <em class="parameter"><code>draw</code></em> or
23602f4aeb0Sopenharmony_ci            <em class="parameter"><code>read</code></em> are pbuffers created with
23702f4aeb0Sopenharmony_ci            <code class="function">eglCreatePbufferFromClientBuffer</code>, and the
23802f4aeb0Sopenharmony_ci            underlying bound client API buffers are in use by the client API
23902f4aeb0Sopenharmony_ci            that created them, an <code class="constant">EGL_BAD_ACCESS</code> error
24002f4aeb0Sopenharmony_ci            is generated.
24102f4aeb0Sopenharmony_ci        </p>
24202f4aeb0Sopenharmony_ci        <p>
24302f4aeb0Sopenharmony_ci            If <em class="parameter"><code>context</code></em> is not a valid context and is
24402f4aeb0Sopenharmony_ci            not <code class="constant">EGL_NO_CONTEXT</code>, an
24502f4aeb0Sopenharmony_ci            <code class="constant">EGL_BAD_CONTEXT</code> error is generated.
24602f4aeb0Sopenharmony_ci        </p>
24702f4aeb0Sopenharmony_ci        <p>
24802f4aeb0Sopenharmony_ci            If either <em class="parameter"><code>draw</code></em> or
24902f4aeb0Sopenharmony_ci            <em class="parameter"><code>read</code></em> are not valid EGL surfaces and are
25002f4aeb0Sopenharmony_ci            not <code class="constant">EGL_NO_SURFACE</code>, an
25102f4aeb0Sopenharmony_ci            <code class="constant">EGL_BAD_SURFACE</code> error is generated.
25202f4aeb0Sopenharmony_ci        </p>
25302f4aeb0Sopenharmony_ci        <p>
25402f4aeb0Sopenharmony_ci            If <em class="parameter"><code>context</code></em> is
25502f4aeb0Sopenharmony_ci            <code class="constant">EGL_NO_CONTEXT</code> and either
25602f4aeb0Sopenharmony_ci            <em class="parameter"><code>draw</code></em> or <em class="parameter"><code>read</code></em> are
25702f4aeb0Sopenharmony_ci            not <code class="constant">EGL_NO_SURFACE</code>, an
25802f4aeb0Sopenharmony_ci            <code class="constant">EGL_BAD_MATCH</code> error is generated.
25902f4aeb0Sopenharmony_ci        </p>
26002f4aeb0Sopenharmony_ci        <p>
26102f4aeb0Sopenharmony_ci            If either of <em class="parameter"><code>draw</code></em> or
26202f4aeb0Sopenharmony_ci            <em class="parameter"><code>read</code></em> is a valid surface and the other is
26302f4aeb0Sopenharmony_ci            <code class="constant">EGL_NO_SURFACE</code>, an
26402f4aeb0Sopenharmony_ci            <code class="constant">EGL_BAD_MATCH</code> error is generated.
26502f4aeb0Sopenharmony_ci        </p>
26602f4aeb0Sopenharmony_ci        <p>
26702f4aeb0Sopenharmony_ci            If <em class="parameter"><code>context</code></em> does not support being bound
26802f4aeb0Sopenharmony_ci            without <em class="parameter"><code>read</code></em> and
26902f4aeb0Sopenharmony_ci            <em class="parameter"><code>draw</code></em> surfaces, and both
27002f4aeb0Sopenharmony_ci            <em class="parameter"><code>draw</code></em> and <em class="parameter"><code>read</code></em> are
27102f4aeb0Sopenharmony_ci            <code class="constant">EGL_NO_SURFACE</code>, an
27202f4aeb0Sopenharmony_ci            <code class="constant">EGL_BAD_MATCH</code> error is generated.
27302f4aeb0Sopenharmony_ci        </p>
27402f4aeb0Sopenharmony_ci        <p>
27502f4aeb0Sopenharmony_ci            If a native window underlying either <em class="parameter"><code>draw</code></em>
27602f4aeb0Sopenharmony_ci            or <em class="parameter"><code>read</code></em> is no longer valid, an
27702f4aeb0Sopenharmony_ci            <code class="constant">EGL_BAD_NATIVE_WINDOW</code> error is generated.
27802f4aeb0Sopenharmony_ci        </p>
27902f4aeb0Sopenharmony_ci        <p>
28002f4aeb0Sopenharmony_ci            If <em class="parameter"><code>draw</code></em> and <em class="parameter"><code>read</code></em>
28102f4aeb0Sopenharmony_ci            cannot fit into graphics memory simultaneously, an
28202f4aeb0Sopenharmony_ci            <code class="constant">EGL_BAD_MATCH</code> error is generated.
28302f4aeb0Sopenharmony_ci        </p>
28402f4aeb0Sopenharmony_ci        <p>
28502f4aeb0Sopenharmony_ci            If the previous context of the calling thread has unflushed
28602f4aeb0Sopenharmony_ci            commands, and the previous surface is no longer valid, an
28702f4aeb0Sopenharmony_ci            <code class="constant">EGL_BAD_CURRENT_SURFACE</code> error is generated.
28802f4aeb0Sopenharmony_ci        </p>
28902f4aeb0Sopenharmony_ci        <p>
29002f4aeb0Sopenharmony_ci            If the ancillary buffers for <em class="parameter"><code>draw</code></em> and
29102f4aeb0Sopenharmony_ci            <em class="parameter"><code>read</code></em> cannot be allocated, an
29202f4aeb0Sopenharmony_ci            <code class="constant">EGL_BAD_ALLOC</code> error is generated.
29302f4aeb0Sopenharmony_ci        </p>
29402f4aeb0Sopenharmony_ci        <p>
29502f4aeb0Sopenharmony_ci            If a power management event has occurred, an
29602f4aeb0Sopenharmony_ci            <code class="constant">EGL_CONTEXT_LOST</code> error is generated.
29702f4aeb0Sopenharmony_ci        </p>
29802f4aeb0Sopenharmony_ci        <p>
29902f4aeb0Sopenharmony_ci            If any of the following are true:
30002f4aeb0Sopenharmony_ci
30102f4aeb0Sopenharmony_ci            </p>
30202f4aeb0Sopenharmony_ci        <div class="itemizedlist">
30302f4aeb0Sopenharmony_ci          <ul class="itemizedlist" style="list-style-type: disc; ">
30402f4aeb0Sopenharmony_ci            <li class="listitem">
30502f4aeb0Sopenharmony_ci              <p>
30602f4aeb0Sopenharmony_ci                    <em class="parameter"><code>context</code></em> is not
30702f4aeb0Sopenharmony_ci                    <code class="constant">EGL_NO_CONTEXT</code>
30802f4aeb0Sopenharmony_ci                </p>
30902f4aeb0Sopenharmony_ci            </li>
31002f4aeb0Sopenharmony_ci            <li class="listitem">
31102f4aeb0Sopenharmony_ci              <p>
31202f4aeb0Sopenharmony_ci                    <em class="parameter"><code>read</code></em> is not
31302f4aeb0Sopenharmony_ci                    <code class="constant">EGL_NO_SURFACE</code>
31402f4aeb0Sopenharmony_ci                </p>
31502f4aeb0Sopenharmony_ci            </li>
31602f4aeb0Sopenharmony_ci            <li class="listitem">
31702f4aeb0Sopenharmony_ci              <p>
31802f4aeb0Sopenharmony_ci                    <em class="parameter"><code>draw</code></em> is not
31902f4aeb0Sopenharmony_ci                    <code class="constant">EGL_NO_SURFACE</code>
32002f4aeb0Sopenharmony_ci                </p>
32102f4aeb0Sopenharmony_ci            </li>
32202f4aeb0Sopenharmony_ci          </ul>
32302f4aeb0Sopenharmony_ci        </div>
32402f4aeb0Sopenharmony_ci        <p>
32502f4aeb0Sopenharmony_ci
32602f4aeb0Sopenharmony_ci            then an <code class="constant">EGL_NOT_INITIALIZED</code> error is
32702f4aeb0Sopenharmony_ci            generated if <em class="parameter"><code>display</code></em> is a valid but
32802f4aeb0Sopenharmony_ci            uninitialized display.
32902f4aeb0Sopenharmony_ci        </p>
33002f4aeb0Sopenharmony_ci        <p>
33102f4aeb0Sopenharmony_ci            As with other commands taking <span class="type">EGLDisplay</span>
33202f4aeb0Sopenharmony_ci            parameters, if <em class="parameter"><code>display</code></em> is not a valid
33302f4aeb0Sopenharmony_ci            <span class="type">EGLDisplay</span> handle, an
33402f4aeb0Sopenharmony_ci            <code class="constant">EGL_BAD_DISPLAY</code> error is generated. (Some
33502f4aeb0Sopenharmony_ci            implementations have chosen to allow
33602f4aeb0Sopenharmony_ci            <code class="constant">EGL_NO_DISPLAY</code> as a valid
33702f4aeb0Sopenharmony_ci            <em class="parameter"><code>display</code></em> parameter for
33802f4aeb0Sopenharmony_ci            <code class="function">eglMakeCurrent</code>. This behavior is not
33902f4aeb0Sopenharmony_ci            portable to all EGL implementations, and should be considered as
34002f4aeb0Sopenharmony_ci            an undocumented vendor extension).
34102f4aeb0Sopenharmony_ci        </p>
34202f4aeb0Sopenharmony_ci      </div>
34302f4aeb0Sopenharmony_ci      <div class="refsect1" id="seealso">
34402f4aeb0Sopenharmony_ci        <h2>See Also</h2>
34502f4aeb0Sopenharmony_ci        <p>
34602f4aeb0Sopenharmony_ci            <a class="citerefentry" href="glReadPixels.xhtml"><span class="citerefentry"><span class="refentrytitle">glReadPixels</span></span></a>,
34702f4aeb0Sopenharmony_ci            <a class="citerefentry" href="glCopyTexImage2D.xhtml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>,
34802f4aeb0Sopenharmony_ci            <a class="citerefentry" href="glCopyTexSubImage2D.xhtml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>,
34902f4aeb0Sopenharmony_ci            <a class="citerefentry" href="eglCreateContext.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreateContext</span></span></a>,
35002f4aeb0Sopenharmony_ci            <a class="citerefentry" href="eglCreatePbufferSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePbufferSurface</span></span></a>,
35102f4aeb0Sopenharmony_ci            <a class="citerefentry" href="eglCreatePixmapSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreatePixmapSurface</span></span></a>,
35202f4aeb0Sopenharmony_ci            <a class="citerefentry" href="eglCreateWindowSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreateWindowSurface</span></span></a>,
35302f4aeb0Sopenharmony_ci            <a class="citerefentry" href="eglGetCurrentContext.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentContext</span></span></a>,
35402f4aeb0Sopenharmony_ci            <a class="citerefentry" href="eglGetCurrentDisplay.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentDisplay</span></span></a>,
35502f4aeb0Sopenharmony_ci            <a class="citerefentry" href="eglGetCurrentSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentSurface</span></span></a>,
35602f4aeb0Sopenharmony_ci            <a class="citerefentry" href="eglGetDisplay.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetDisplay</span></span></a>,
35702f4aeb0Sopenharmony_ci            <a class="citerefentry" href="eglInitialize.xhtml"><span class="citerefentry"><span class="refentrytitle">eglInitialize</span></span></a>
35802f4aeb0Sopenharmony_ci        </p>
35902f4aeb0Sopenharmony_ci      </div>
36002f4aeb0Sopenharmony_ci      <p>
36102f4aeb0Sopenharmony_ci    </p>
36202f4aeb0Sopenharmony_ci      <div class="refsect3" id="copyright">
36302f4aeb0Sopenharmony_ci        <img src="KhronosLogo.jpg"/>
36402f4aeb0Sopenharmony_ci        <p>
36502f4aeb0Sopenharmony_ci            Copyright © 2003-2014 The Khronos Group Inc.
36602f4aeb0Sopenharmony_ci            Permission is hereby granted, free of charge, to any person obtaining a
36702f4aeb0Sopenharmony_ci            copy of this software and/or associated documentation files (the
36802f4aeb0Sopenharmony_ci            "Materials"), to deal in the Materials without restriction, including
36902f4aeb0Sopenharmony_ci            without limitation the rights to use, copy, modify, merge, publish,
37002f4aeb0Sopenharmony_ci            distribute, sublicense, and/or sell copies of the Materials, and to
37102f4aeb0Sopenharmony_ci            permit persons to whom the Materials are furnished to do so, subject to
37202f4aeb0Sopenharmony_ci            the condition that this copyright notice and permission notice shall be included
37302f4aeb0Sopenharmony_ci            in all copies or substantial portions of the Materials.
37402f4aeb0Sopenharmony_ci        </p>
37502f4aeb0Sopenharmony_ci      </div>
37602f4aeb0Sopenharmony_ci      <p>
37702f4aeb0Sopenharmony_ci</p>
37802f4aeb0Sopenharmony_ci    </div>
37902f4aeb0Sopenharmony_ci    <footer/>
38002f4aeb0Sopenharmony_ci  </body>
38102f4aeb0Sopenharmony_ci</html>
382