• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:base="" xml:id="eglBindAPI">
2    <info>
3         <copyright>
4             <year>2003-2018</year>
5             <holder>The Khronos Group Inc.</holder>
6         </copyright>
7    </info>
8    <refmeta>
9        <refentrytitle>eglBindAPI</refentrytitle>
10        <manvolnum>3G</manvolnum>
11    </refmeta>
12    <refnamediv>
13        <refname>eglBindAPI</refname>
14        <refpurpose>Set the current rendering API</refpurpose>
15    </refnamediv>
16    <refsynopsisdiv><title>C Specification</title>
17        <funcsynopsis>
18            <funcprototype>
19                <funcdef>EGLBoolean <function>eglBindAPI</function></funcdef>
20                <paramdef>EGLenum <parameter>api</parameter></paramdef>
21            </funcprototype>
22        </funcsynopsis>
23    </refsynopsisdiv>
24    <refsect1 xml:id="parameters"><title>Parameters</title>
25        <variablelist>
26        <varlistentry>
27            <term><parameter>api</parameter></term>
28            <listitem>
29                <para>
30                    Specifies the client API to bind, one of
31                    <constant>EGL_OPENGL_API</constant>,
32                    <constant>EGL_OPENGL_ES_API</constant>, or
33                    <constant>EGL_OPENVG_API</constant>.
34                </para>
35            </listitem>
36        </varlistentry>
37        </variablelist>
38    </refsect1>
39    <refsect1 xml:id="description"><title>Description</title>
40        <para>
41            <function>eglBindAPI</function> defines the current
42            rendering API for EGL in the thread it is called from. The
43            current rendering API is one of the client rendering APIs
44            supported by the EGL implementation, and affects the
45            behavior of other EGL commands including
46            <function>eglCreateContext</function>,
47            <function>eglGetCurrentContext</function>,
48            <function>eglGetCurrentDisplay</function>,
49            <function>eglGetCurrentSurface</function>,
50            <function>eglMakeCurrent</function>,
51            <function>eglSwapInterval</function>,
52            <function>eglWaitClient</function>, and
53            <function>eglWaitNative</function>.
54        </para>
55        <para>
56            If <parameter>api</parameter> is
57            <constant>EGL_OPENGL_API</constant>, the current rendering
58            API is set to the OpenGL API.
59        </para>
60        <para>
61            If <parameter>api</parameter> is
62            <constant>EGL_OPENGL_ES_API</constant>, the current
63            rendering API is set to the OpenGL ES API.
64        </para>
65        <para>
66            If <parameter>api</parameter> is
67            <constant>EGL_OPENVG_API</constant>, the current rendering
68            API is set to the OpenVG API.
69        </para>
70        <para>
71            If an error occurs, the current rendering API is unchanged.
72        </para>
73    </refsect1>
74    <refsect1 xml:id="notes"><title>Notes</title>
75        <para>
76            <function>eglBindAPI</function> and the corresponding
77            <constant>EGL_OPENGL_ES_API</constant> and
78            <constant>EGL_OPENVG_API</constant>
79            <parameter>api</parameter> parameters are supported only if
80            the EGL version is 1.2 or greater. The
81            <constant>EGL_OPENGL_API</constant> parameter is supported
82            only if the EGL version is 1.4 or greater.
83        </para>
84        <para>
85            The initial value of the current rendering API is
86            <constant>EGL_OPENGL_ES_API</constant> unless OpenGL ES is
87            not supported by an implementation, in which case the
88            initial value is <constant>EGL_NONE</constant> (however,
89            <constant>EGL_NONE</constant> is not a valid
90            <parameter>api</parameter> parameter to
91            <function>eglBindAPI</function>).
92        </para>
93        <para>
94            The current rendering API can be queried by calling
95            <function>eglQueryAPI</function>.
96        </para>
97    </refsect1>
98    <refsect1 xml:id="errors"><title>Errors</title>
99        <para>
100            <constant>EGL_FALSE</constant> is returned on failure.
101        </para>
102        <para>
103            <constant>EGL_BAD_PARAMETER</constant> is generated if
104            <parameter>api</parameter> is not one of the accepted
105            tokens, or if the specified client API is not supported by
106            the EGL implementation.
107        </para>
108    </refsect1>
109    <refsect1 xml:id="seealso"><title>See Also</title>
110        <para>
111            <citerefentry><refentrytitle>eglCreateContext</refentrytitle></citerefentry>,
112            <citerefentry><refentrytitle>eglGetCurrentContext</refentrytitle></citerefentry>,
113            <citerefentry><refentrytitle>eglGetCurrentDisplay</refentrytitle></citerefentry>,
114            <citerefentry><refentrytitle>eglGetCurrentSurface</refentrytitle></citerefentry>,
115            <citerefentry><refentrytitle>eglMakeCurrent</refentrytitle></citerefentry>,
116            <citerefentry><refentrytitle>eglQueryAPI</refentrytitle></citerefentry>,
117            <citerefentry><refentrytitle>eglSwapInterval</refentrytitle></citerefentry>,
118            <citerefentry><refentrytitle>eglWaitClient</refentrytitle></citerefentry>,
119            <citerefentry><refentrytitle>eglWaitNative</refentrytitle></citerefentry>
120        </para>
121    </refsect1>
122    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="copyright.xml"/>
123</refentry>
124