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