• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3                            "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4<refentry xml:base="" id="eglSwapBuffers">
5    <refentryinfo>
6         <copyright>
7             <year>2003-2014</year>
8             <holder>The Khronos Group Inc.</holder>
9         </copyright>
10    </refentryinfo>
11    <refmeta>
12        <refentrytitle>eglSwapBuffers</refentrytitle>
13        <manvolnum>3G</manvolnum>
14    </refmeta>
15    <refnamediv>
16        <refname>eglSwapBuffers</refname>
17        <refpurpose>
18            post <acronym>EGL</acronym> surface color buffer to a native window
19        </refpurpose>
20    </refnamediv>
21    <refsynopsisdiv>
22        <title>C Specification</title>
23        <funcsynopsis>
24            <funcprototype>
25                <funcdef>EGLBoolean <function>eglSwapBuffers</function></funcdef>
26                <paramdef>EGLDisplay <parameter>display</parameter></paramdef>
27                <paramdef>EGLSurface <parameter>surface</parameter></paramdef>
28            </funcprototype>
29        </funcsynopsis>
30    </refsynopsisdiv>
31    <refsect1 id="parameters"><title>Parameters</title>
32        <variablelist>
33            <varlistentry>
34                <term><parameter>display</parameter></term>
35                <listitem>
36                    <para>
37                        Specifies the EGL display connection.
38                    </para>
39                </listitem>
40            </varlistentry>
41            <varlistentry>
42                <term><parameter>surface</parameter></term>
43                <listitem>
44                    <para>
45                        Specifies the EGL drawing surface whose buffers are to be swapped.
46                    </para>
47                </listitem>
48            </varlistentry>
49        </variablelist>
50    </refsect1>
51    <refsect1 id="description"><title>Description</title>
52        <para>
53            If <parameter>surface</parameter> is a window surface,
54            <function>eglSwapBuffers</function> posts its color buffer
55            to the associated native window.
56        </para>
57        <para>
58            The contents of ancillary buffers are always undefined after
59            calling <function>eglSwapBuffers</function>. The contents of
60            the color buffer are left unchanged if the value of the
61            <constant>EGL_SWAP_BEHAVIOR</constant> attribute of
62            <parameter>surface</parameter> is
63            <constant>EGL_BUFFER_PRESERVED</constant>, and are undefined
64            if the value is <constant>EGL_BUFFER_DESTROYED</constant>.
65            The value of <constant>EGL_SWAP_BEHAVIOR</constant> can be
66            set for some surfaces using
67            <citerefentry><refentrytitle>eglSurfaceAttrib</refentrytitle></citerefentry>.
68        </para>
69        <para>
70            <function>eglSwapBuffers</function> performs an implicit
71            flush operation on the context (<function>glFlush</function>
72            for an OpenGL ES or OpenGL context,
73            <function>vgFlush</function> for an OpenVG context) bound to
74            <parameter>surface</parameter> before swapping. Subsequent
75            client API commands may be issued on that context
76            immediately after calling
77            <function>eglSwapBuffers</function>, but are not executed
78            until the buffer exchange is completed.
79        </para>
80        <para>
81            If <parameter>surface</parameter> is a pixel buffer or a pixmap,
82            <function>eglSwapBuffers</function>
83            has no effect, and no error is generated.
84        </para>
85    </refsect1>
86    <refsect1 id="notes"><title>Notes</title>
87        <para>
88            Attribute <constant>EGL_SWAP_BEHAVIOR</constant> is
89            supported only if the EGL version is 1.2 or greater. In
90            earlier versions, behavior is as though the attribute
91            exists, and always has the value
92            <constant>EGL_BUFFER_DESTROYED</constant>.
93        </para>
94        <para>
95            The EGL 1.4 specification was updated to acknowledge that
96            ancillary buffers are not necessarily preserved after a
97            swap, and that the <constant>EGL_SWAP_BEHAVIOR</constant>
98            attribute applies only to the color buffer. This change in
99            the specification acknowledged the behavior of many shipping
100            implementations, and is not intended to result in behavior
101            changes in any existing implementation. Applications which
102            require preservation of ancillary buffers across a swap
103            should be aware that not all implementations can preserve
104            them, and that EGL 1.4 has no way to query whether or not
105            they are preserved.
106        </para>
107    </refsect1>
108    <refsect1 id="errors"><title>Errors</title>
109        <para>
110            <constant>EGL_FALSE</constant> is returned if swapping of the
111            surface buffers fails, <constant>EGL_TRUE</constant> otherwise.
112        </para>
113        <para>
114            <constant>EGL_BAD_DISPLAY</constant> is generated if
115            <parameter>display</parameter> is not an EGL display connection.
116        </para>
117        <para>
118            <constant>EGL_NOT_INITIALIZED</constant> is generated if
119            <parameter>display</parameter> has not been initialized.
120        </para>
121        <para>
122            <constant>EGL_BAD_SURFACE</constant> is generated if
123            <parameter>surface</parameter> is not an EGL drawing surface.
124        </para>
125        <para>
126            <constant>EGL_CONTEXT_LOST</constant> is generated if a power management
127            event has occurred. The application must destroy all contexts and
128            reinitialise OpenGL ES state and objects to continue rendering.
129        </para>
130    </refsect1>
131    <refsect1 id="seealso"><title>See Also</title>
132        <para>
133            <citerefentry><refentrytitle>glFlush</refentrytitle></citerefentry>,
134            <citerefentry><refentrytitle>eglCopyBuffers</refentrytitle></citerefentry>
135        </para>
136    </refsect1>
137    <refsect3 id="Copyright"><title></title>
138        <!-- Content included from copyright.inc.xsl -->
139        <imageobject>
140                <imagedata fileref="KhronosLogo.jpg" format="jpg" />
141        </imageobject>
142        <para />
143    </refsect3>
144</refentry>
145