102f4aeb0Sopenharmony_ci<?xml version="1.0" encoding="UTF-8"?> 202f4aeb0Sopenharmony_ci<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" 302f4aeb0Sopenharmony_ci "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd"> 402f4aeb0Sopenharmony_ci<refentry xml:base="" id="eglSwapBuffers"> 502f4aeb0Sopenharmony_ci <refentryinfo> 602f4aeb0Sopenharmony_ci <copyright> 702f4aeb0Sopenharmony_ci <year>2003-2014</year> 802f4aeb0Sopenharmony_ci <holder>The Khronos Group Inc.</holder> 902f4aeb0Sopenharmony_ci </copyright> 1002f4aeb0Sopenharmony_ci </refentryinfo> 1102f4aeb0Sopenharmony_ci <refmeta> 1202f4aeb0Sopenharmony_ci <refentrytitle>eglSwapBuffers</refentrytitle> 1302f4aeb0Sopenharmony_ci <manvolnum>3G</manvolnum> 1402f4aeb0Sopenharmony_ci </refmeta> 1502f4aeb0Sopenharmony_ci <refnamediv> 1602f4aeb0Sopenharmony_ci <refname>eglSwapBuffers</refname> 1702f4aeb0Sopenharmony_ci <refpurpose> 1802f4aeb0Sopenharmony_ci post <acronym>EGL</acronym> surface color buffer to a native window 1902f4aeb0Sopenharmony_ci </refpurpose> 2002f4aeb0Sopenharmony_ci </refnamediv> 2102f4aeb0Sopenharmony_ci <refsynopsisdiv> 2202f4aeb0Sopenharmony_ci <title>C Specification</title> 2302f4aeb0Sopenharmony_ci <funcsynopsis> 2402f4aeb0Sopenharmony_ci <funcprototype> 2502f4aeb0Sopenharmony_ci <funcdef>EGLBoolean <function>eglSwapBuffers</function></funcdef> 2602f4aeb0Sopenharmony_ci <paramdef>EGLDisplay <parameter>display</parameter></paramdef> 2702f4aeb0Sopenharmony_ci <paramdef>EGLSurface <parameter>surface</parameter></paramdef> 2802f4aeb0Sopenharmony_ci </funcprototype> 2902f4aeb0Sopenharmony_ci </funcsynopsis> 3002f4aeb0Sopenharmony_ci </refsynopsisdiv> 3102f4aeb0Sopenharmony_ci <refsect1 id="parameters"><title>Parameters</title> 3202f4aeb0Sopenharmony_ci <variablelist> 3302f4aeb0Sopenharmony_ci <varlistentry> 3402f4aeb0Sopenharmony_ci <term><parameter>display</parameter></term> 3502f4aeb0Sopenharmony_ci <listitem> 3602f4aeb0Sopenharmony_ci <para> 3702f4aeb0Sopenharmony_ci Specifies the EGL display connection. 3802f4aeb0Sopenharmony_ci </para> 3902f4aeb0Sopenharmony_ci </listitem> 4002f4aeb0Sopenharmony_ci </varlistentry> 4102f4aeb0Sopenharmony_ci <varlistentry> 4202f4aeb0Sopenharmony_ci <term><parameter>surface</parameter></term> 4302f4aeb0Sopenharmony_ci <listitem> 4402f4aeb0Sopenharmony_ci <para> 4502f4aeb0Sopenharmony_ci Specifies the EGL drawing surface whose buffers are to be swapped. 4602f4aeb0Sopenharmony_ci </para> 4702f4aeb0Sopenharmony_ci </listitem> 4802f4aeb0Sopenharmony_ci </varlistentry> 4902f4aeb0Sopenharmony_ci </variablelist> 5002f4aeb0Sopenharmony_ci </refsect1> 5102f4aeb0Sopenharmony_ci <refsect1 id="description"><title>Description</title> 5202f4aeb0Sopenharmony_ci <para> 5302f4aeb0Sopenharmony_ci If <parameter>surface</parameter> is a window surface, 5402f4aeb0Sopenharmony_ci <function>eglSwapBuffers</function> posts its color buffer 5502f4aeb0Sopenharmony_ci to the associated native window. 5602f4aeb0Sopenharmony_ci </para> 5702f4aeb0Sopenharmony_ci <para> 5802f4aeb0Sopenharmony_ci The contents of ancillary buffers are always undefined after 5902f4aeb0Sopenharmony_ci calling <function>eglSwapBuffers</function>. The contents of 6002f4aeb0Sopenharmony_ci the color buffer are left unchanged if the value of the 6102f4aeb0Sopenharmony_ci <constant>EGL_SWAP_BEHAVIOR</constant> attribute of 6202f4aeb0Sopenharmony_ci <parameter>surface</parameter> is 6302f4aeb0Sopenharmony_ci <constant>EGL_BUFFER_PRESERVED</constant>, and are undefined 6402f4aeb0Sopenharmony_ci if the value is <constant>EGL_BUFFER_DESTROYED</constant>. 6502f4aeb0Sopenharmony_ci The value of <constant>EGL_SWAP_BEHAVIOR</constant> can be 6602f4aeb0Sopenharmony_ci set for some surfaces using 6702f4aeb0Sopenharmony_ci <citerefentry><refentrytitle>eglSurfaceAttrib</refentrytitle></citerefentry>. 6802f4aeb0Sopenharmony_ci </para> 6902f4aeb0Sopenharmony_ci <para> 7002f4aeb0Sopenharmony_ci <function>eglSwapBuffers</function> performs an implicit 7102f4aeb0Sopenharmony_ci flush operation on the context (<function>glFlush</function> 7202f4aeb0Sopenharmony_ci for an OpenGL ES or OpenGL context, 7302f4aeb0Sopenharmony_ci <function>vgFlush</function> for an OpenVG context) bound to 7402f4aeb0Sopenharmony_ci <parameter>surface</parameter> before swapping. Subsequent 7502f4aeb0Sopenharmony_ci client API commands may be issued on that context 7602f4aeb0Sopenharmony_ci immediately after calling 7702f4aeb0Sopenharmony_ci <function>eglSwapBuffers</function>, but are not executed 7802f4aeb0Sopenharmony_ci until the buffer exchange is completed. 7902f4aeb0Sopenharmony_ci </para> 8002f4aeb0Sopenharmony_ci <para> 8102f4aeb0Sopenharmony_ci If <parameter>surface</parameter> is a pixel buffer or a pixmap, 8202f4aeb0Sopenharmony_ci <function>eglSwapBuffers</function> 8302f4aeb0Sopenharmony_ci has no effect, and no error is generated. 8402f4aeb0Sopenharmony_ci </para> 8502f4aeb0Sopenharmony_ci </refsect1> 8602f4aeb0Sopenharmony_ci <refsect1 id="notes"><title>Notes</title> 8702f4aeb0Sopenharmony_ci <para> 8802f4aeb0Sopenharmony_ci Attribute <constant>EGL_SWAP_BEHAVIOR</constant> is 8902f4aeb0Sopenharmony_ci supported only if the EGL version is 1.2 or greater. In 9002f4aeb0Sopenharmony_ci earlier versions, behavior is as though the attribute 9102f4aeb0Sopenharmony_ci exists, and always has the value 9202f4aeb0Sopenharmony_ci <constant>EGL_BUFFER_DESTROYED</constant>. 9302f4aeb0Sopenharmony_ci </para> 9402f4aeb0Sopenharmony_ci <para> 9502f4aeb0Sopenharmony_ci The EGL 1.4 specification was updated to acknowledge that 9602f4aeb0Sopenharmony_ci ancillary buffers are not necessarily preserved after a 9702f4aeb0Sopenharmony_ci swap, and that the <constant>EGL_SWAP_BEHAVIOR</constant> 9802f4aeb0Sopenharmony_ci attribute applies only to the color buffer. This change in 9902f4aeb0Sopenharmony_ci the specification acknowledged the behavior of many shipping 10002f4aeb0Sopenharmony_ci implementations, and is not intended to result in behavior 10102f4aeb0Sopenharmony_ci changes in any existing implementation. Applications which 10202f4aeb0Sopenharmony_ci require preservation of ancillary buffers across a swap 10302f4aeb0Sopenharmony_ci should be aware that not all implementations can preserve 10402f4aeb0Sopenharmony_ci them, and that EGL 1.4 has no way to query whether or not 10502f4aeb0Sopenharmony_ci they are preserved. 10602f4aeb0Sopenharmony_ci </para> 10702f4aeb0Sopenharmony_ci </refsect1> 10802f4aeb0Sopenharmony_ci <refsect1 id="errors"><title>Errors</title> 10902f4aeb0Sopenharmony_ci <para> 11002f4aeb0Sopenharmony_ci <constant>EGL_FALSE</constant> is returned if swapping of the 11102f4aeb0Sopenharmony_ci surface buffers fails, <constant>EGL_TRUE</constant> otherwise. 11202f4aeb0Sopenharmony_ci </para> 11302f4aeb0Sopenharmony_ci <para> 11402f4aeb0Sopenharmony_ci <constant>EGL_BAD_DISPLAY</constant> is generated if 11502f4aeb0Sopenharmony_ci <parameter>display</parameter> is not an EGL display connection. 11602f4aeb0Sopenharmony_ci </para> 11702f4aeb0Sopenharmony_ci <para> 11802f4aeb0Sopenharmony_ci <constant>EGL_NOT_INITIALIZED</constant> is generated if 11902f4aeb0Sopenharmony_ci <parameter>display</parameter> has not been initialized. 12002f4aeb0Sopenharmony_ci </para> 12102f4aeb0Sopenharmony_ci <para> 12202f4aeb0Sopenharmony_ci <constant>EGL_BAD_SURFACE</constant> is generated if 12302f4aeb0Sopenharmony_ci <parameter>surface</parameter> is not an EGL drawing surface. 12402f4aeb0Sopenharmony_ci </para> 12502f4aeb0Sopenharmony_ci <para> 12602f4aeb0Sopenharmony_ci <constant>EGL_CONTEXT_LOST</constant> is generated if a power management 12702f4aeb0Sopenharmony_ci event has occurred. The application must destroy all contexts and 12802f4aeb0Sopenharmony_ci reinitialise OpenGL ES state and objects to continue rendering. 12902f4aeb0Sopenharmony_ci </para> 13002f4aeb0Sopenharmony_ci </refsect1> 13102f4aeb0Sopenharmony_ci <refsect1 id="seealso"><title>See Also</title> 13202f4aeb0Sopenharmony_ci <para> 13302f4aeb0Sopenharmony_ci <citerefentry><refentrytitle>glFlush</refentrytitle></citerefentry>, 13402f4aeb0Sopenharmony_ci <citerefentry><refentrytitle>eglCopyBuffers</refentrytitle></citerefentry> 13502f4aeb0Sopenharmony_ci </para> 13602f4aeb0Sopenharmony_ci </refsect1> 13702f4aeb0Sopenharmony_ci <refsect3 id="Copyright"><title></title> 13802f4aeb0Sopenharmony_ci <!-- Content included from copyright.inc.xsl --> 13902f4aeb0Sopenharmony_ci <imageobject> 14002f4aeb0Sopenharmony_ci <imagedata fileref="KhronosLogo.jpg" format="jpg" /> 14102f4aeb0Sopenharmony_ci </imageobject> 14202f4aeb0Sopenharmony_ci <para /> 14302f4aeb0Sopenharmony_ci </refsect3> 14402f4aeb0Sopenharmony_ci</refentry> 145