1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title xmlns:xlink="http://www.w3.org/1999/xlink">eglBindAPI - EGL Reference Pages</title> 5 <link rel="stylesheet" type="text/css" href="khronos-man.css"/> 6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/> 7 </head> 8 <body> 9 <header/> 10 <div class="refentry" id="eglBindAPI"> 11 <div class="titlepage"/> 12 <div class="refnamediv"> 13 <h2>Name</h2> 14 <p>eglBindAPI — Set the current rendering API</p> 15 </div> 16 <div class="refsynopsisdiv"> 17 <h2>C Specification</h2> 18 <div class="funcsynopsis"> 19 <table style="border: 0; cellspacing: 0; cellpadding: 0;" class="funcprototype-table"> 20 <tr> 21 <td> 22 <code class="funcdef">EGLBoolean <strong class="fsfunc">eglBindAPI</strong>(</code> 23 </td> 24 <td>EGLenum <var class="pdparam">api</var><code>)</code>;</td> 25 </tr> 26 </table> 27 <div class="funcprototype-spacer"> </div> 28 </div> 29 </div> 30 <div class="refsect1" id="parameters"> 31 <h2>Parameters</h2> 32 <div class="variablelist"> 33 <dl class="variablelist"> 34 <dt> 35 <span class="term"> 36 <em class="parameter"> 37 <code>api</code> 38 </em> 39 </span> 40 </dt> 41 <dd> 42 <p> 43 Specifies the client API to bind, one of 44 <code class="constant">EGL_OPENGL_API</code>, 45 <code class="constant">EGL_OPENGL_ES_API</code>, or 46 <code class="constant">EGL_OPENVG_API</code>. 47 </p> 48 </dd> 49 </dl> 50 </div> 51 </div> 52 <div class="refsect1" id="description"> 53 <h2>Description</h2> 54 <p> 55 <code class="function">eglBindAPI</code> defines the current 56 rendering API for EGL in the thread it is called from. The 57 current rendering API is one of the client rendering APIs 58 supported by the EGL implementation, and affects the 59 behavior of other EGL commands including 60 <code class="function">eglCreateContext</code>, 61 <code class="function">eglGetCurrentContext</code>, 62 <code class="function">eglGetCurrentDisplay</code>, 63 <code class="function">eglGetCurrentSurface</code>, 64 <code class="function">eglMakeCurrent</code>, 65 <code class="function">eglSwapInterval</code>, 66 <code class="function">eglWaitClient</code>, and 67 <code class="function">eglWaitNative</code>. 68 </p> 69 <p> 70 If <em class="parameter"><code>api</code></em> is 71 <code class="constant">EGL_OPENGL_API</code>, the current rendering 72 API is set to the OpenGL API. 73 </p> 74 <p> 75 If <em class="parameter"><code>api</code></em> is 76 <code class="constant">EGL_OPENGL_ES_API</code>, the current 77 rendering API is set to the OpenGL ES API. 78 </p> 79 <p> 80 If <em class="parameter"><code>api</code></em> is 81 <code class="constant">EGL_OPENVG_API</code>, the current rendering 82 API is set to the OpenVG API. 83 </p> 84 <p> 85 If an error occurs, the current rendering API is unchanged. 86 </p> 87 </div> 88 <div class="refsect1" id="notes"> 89 <h2>Notes</h2> 90 <p> 91 <code class="function">eglBindAPI</code> and the corresponding 92 <code class="constant">EGL_OPENGL_ES_API</code> and 93 <code class="constant">EGL_OPENVG_API</code> 94 <em class="parameter"><code>api</code></em> parameters are supported only if 95 the EGL version is 1.2 or greater. The 96 <code class="constant">EGL_OPENGL_API</code> parameter is supported 97 only if the EGL version is 1.4 or greater. 98 </p> 99 <p> 100 The initial value of the current rendering API is 101 <code class="constant">EGL_OPENGL_ES_API</code> unless OpenGL ES is 102 not supported by an implementation, in which case the 103 initial value is <code class="constant">EGL_NONE</code> (however, 104 <code class="constant">EGL_NONE</code> is not a valid 105 <em class="parameter"><code>api</code></em> parameter to 106 <code class="function">eglBindAPI</code>). 107 </p> 108 <p> 109 The current rendering API can be queried by calling 110 <code class="function">eglQueryAPI</code>. 111 </p> 112 </div> 113 <div class="refsect1" id="errors"> 114 <h2>Errors</h2> 115 <p> 116 <code class="constant">EGL_FALSE</code> is returned on failure. 117 </p> 118 <p> 119 <code class="constant">EGL_BAD_PARAMETER</code> is generated if 120 <em class="parameter"><code>api</code></em> is not one of the accepted 121 tokens, or if the specified client API is not supported by 122 the EGL implementation. 123 </p> 124 </div> 125 <div class="refsect1" id="seealso"> 126 <h2>See Also</h2> 127 <p> 128 <a class="citerefentry" href="eglCreateContext.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCreateContext</span></span></a>, 129 <a class="citerefentry" href="eglGetCurrentContext.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentContext</span></span></a>, 130 <a class="citerefentry" href="eglGetCurrentDisplay.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentDisplay</span></span></a>, 131 <a class="citerefentry" href="eglGetCurrentSurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentSurface</span></span></a>, 132 <a class="citerefentry" href="eglMakeCurrent.xhtml"><span class="citerefentry"><span class="refentrytitle">eglMakeCurrent</span></span></a>, 133 <a class="citerefentry" href="eglQueryAPI.xhtml"><span class="citerefentry"><span class="refentrytitle">eglQueryAPI</span></span></a>, 134 <a class="citerefentry" href="eglSwapInterval.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSwapInterval</span></span></a>, 135 <a class="citerefentry" href="eglWaitClient.xhtml"><span class="citerefentry"><span class="refentrytitle">eglWaitClient</span></span></a>, 136 <a class="citerefentry" href="eglWaitNative.xhtml"><span class="citerefentry"><span class="refentrytitle">eglWaitNative</span></span></a> 137 </p> 138 </div> 139 <p> 140 </p> 141 <div class="refsect3" id="copyright"> 142 <img src="KhronosLogo.jpg"/> 143 <p> 144 Copyright © 2003-2014 The Khronos Group Inc. 145 Permission is hereby granted, free of charge, to any person obtaining a 146 copy of this software and/or associated documentation files (the 147 "Materials"), to deal in the Materials without restriction, including 148 without limitation the rights to use, copy, modify, merge, publish, 149 distribute, sublicense, and/or sell copies of the Materials, and to 150 permit persons to whom the Materials are furnished to do so, subject to 151 the condition that this copyright notice and permission notice shall be included 152 in all copies or substantial portions of the Materials. 153 </p> 154 </div> 155 <p> 156</p> 157 </div> 158 <footer/> 159 </body> 160</html> 161