1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> 3<!-- saved from url=(0013)about:internet --> 4<?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" xmlns:xlink="http://www.w3.org/1999/xlink" pref:renderer="mathplayer-dl"> 5 <head> 6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 7 <style xmlns="" type="text/css"> 8 /* This style sets a margin around the entire page */ 9 html, body { 10 margin: 10px; 11 } 12 13 p { 14 font: normal 16px verdana, sans-serif; 15 margin: 0; 16 padding-bottom:12px; 17 } 18 19 h1 { 20 font: bold 25px verdana, sans-serif; 21 margin-top: 0; 22 margin-bottom: 3px; 23 padding-top: 0; 24 padding-bottom: 0; 25 } 26 27 h2 { 28 font: bold 19px verdana, sans-serif; 29 margin-top: 28px; 30 margin-bottom: 3px; 31 padding-top: 0; 32 padding-bottom: 0; 33 } 34 35 h3 { 36 font: bold 19px verdana, sans-serif !important; 37 margin-top: 28px; 38 margin-bottom: 3px; 39 padding-top: 0; 40 padding-bottom: 0; 41 } 42 43 li { 44 font: normal 16px verdana, sans-serif; 45 margin-top: 0; 46 margin-bottom: 18px; 47 padding-top: 0; 48 padding-bottom: 0; 49 } 50 51 .pdparam { 52 font: italic 16px verdana, sans-serif; 53 } 54 55 .term { 56 font: italic 16px verdana, sans-serif; 57 font-weight: normal; 58 } 59 60 .type { 61 font: normal 16px verdana, sans-serif !important; 62 } 63 64 .parameter { 65 font-style: italic; 66 } 67 68 a:link, a:visited { 69 color: blue; 70 text-decoration: none; 71 font: normal 16px; 72 } 73 74 a:hover { 75 background-color: #FFFF99; 76 font: normal 16px; 77 } 78 79 div.funcsynopsis { 80 text-align: left; 81 background-color: #e6e6e6; 82 font: normal 16px verdana, sans-serif; 83 padding-top: 10px; 84 padding-bottom: 10px; 85 } 86 87 div.funcsynopsis table { 88 border-collapse: separate; 89 font: normal 16px verdana, sans-serif; 90 } 91 92 div.funcsynopsis td { 93 background-color: #e6e6e6; 94 border: 0 solid #000; 95 padding: 1px; 96 font: normal 16px verdana, sans-serif; 97 } 98 99 div.refsect1 { 100 font-family: verdana, sans-serif; 101 font-size: 16px; 102 } 103 104 code.constant { 105 font: normal 16px courier new, monospace !important; 106 } 107 108 span.errorname { 109 font: normal 16px verdana, sans-serif !important; 110 } 111 112 code.function { 113 font: bold 16px verdana, sans-serif !important; 114 } 115 116 b.fsfunc { 117 font: bold 16px verdana, sans-serif !important; 118 } 119 120 code.varname { 121 font: italic 16px verdana, sans-serif; 122 } 123 124 code.replaceable { 125 font: italic 16px courier new, monospace; 126 } 127 128 code.funcdef { 129 font: normal 16px verdana, sans-serif !important; 130 } 131 132 .citerefentry { 133 font: normal 16px verdana, sans-serif !important; 134 } 135 136 .parameter { 137 font-style: italic; 138 } 139 140 code.fsfunc { 141 font: normal 16px verdana, sans-serif !important; 142 } 143 144 /* PARAMETER: This style controls spacing between the terms in Parameter section */ 145 dt { 146 margin-top: 15px; 147 } 148 149 /* TABLES: These styles apply to all tables OTHER than the Synopsis and Example tables */ 150 div.refsect1 table { 151 width: 100%; 152 margin-top: 10px; 153 background-color: #FFF; 154 border-collapse: collapse; 155 border-color: #000; 156 border-width: 1px; 157 font: normal 16px verdana, sans-serif; 158 } 159 160 div.refsect1 th { 161 border-collapse: collapse; 162 border-color: #000; 163 border-width: 1px; 164 font: bold 16px verdana, sans-serif; 165 } 166 167 div.refsect1 td { 168 background-color: #FFF; 169 padding: 5px; 170 vertical-align: text-top; 171 border-collapse: collapse; 172 border-color: #000; 173 border-width: 1px; 174 font: normal 16px verdana, sans-serif; 175 } 176 177 div.refsect1 p{ 178 font: normal 16px verdana, sans-serif; 179 margin-top: 8px; 180 margin-bottom: 8px; 181 padding-top: 0; 182 padding-bottom: 0; 183 } 184 185 186 /* EXAMPLE: These styles apply only to the Example section */ 187 div.refsect2 { 188 font: normal 16px courier new, monospace !important; 189 } 190 191 div.refsect2 table { 192 margin-top: 0; 193 background-color: #e6e6e6; 194 width: 100%; 195 border: 0 solid #000; 196 padding: 2px; 197 font: normal 16px courier new, monospace !important; 198 } 199 200 div.refsect2 td { 201 background-color: #e6e6e6; 202 font: normal 16px courier new, monospace !important; 203 white-space:pre; 204 } 205 206 /* COPYRIGHT: This style formats the text of the copyright statement at the bottom of the page */ 207 div.refsect3 { 208 font: normal 11px verdana, sans-serif; 209 margin-top: 50px; 210 margin-bottom: 20px; 211 padding-top: 0; 212 padding-bottom: 0; 213 } 214 215</style> 216 <title>eglMakeCurrent</title> 217 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /> 218 </head> 219 <body> 220 <div class="refentry"> 221 <a id="eglMakeCurrent"></a> 222 <div class="titlepage"></div> 223 <div xmlns="" class="refnamediv"> 224 <h1>eglMakeCurrent</h1> 225 <p> 226 attach an EGL rendering context to EGL surfaces 227 </p> 228 </div> 229 <div class="refsynopsisdiv"> 230 <h2>C Specification</h2> 231 <div class="funcsynopsis"> 232 <table xmlns="" border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"> 233 <tr valign="bottom"> 234 <td> 235 <code xmlns="http://www.w3.org/1999/xhtml" class="funcdef">EGLBoolean <strong class="fsfunc">eglMakeCurrent</strong>(</code> 236 <td>EGLDisplay <var xmlns="http://www.w3.org/1999/xhtml" class="pdparam">display</var>, </td> 237 </td> 238 </tr> 239 <tr valign="top"> 240 <td> </td> 241 <td>EGLSurface <var xmlns="http://www.w3.org/1999/xhtml" class="pdparam">draw</var>, </td> 242 </tr> 243 <tr valign="top"> 244 <td> </td> 245 <td>EGLSurface <var xmlns="http://www.w3.org/1999/xhtml" class="pdparam">read</var>, </td> 246 </tr> 247 <tr valign="top"> 248 <td> </td> 249 <td>EGLContext <var xmlns="http://www.w3.org/1999/xhtml" class="pdparam">context</var><code>)</code></td> 250 </tr> 251 </table> 252 </div> 253 </div> 254 <div class="refsect1"> 255 <a id="parameters"></a> 256 <h2>Parameters</h2> 257 <div class="variablelist"> 258 <dl class="variablelist"> 259 <dt> 260 <span class="term"> 261 <em class="parameter"> 262 <code>display</code> 263 </em> 264 </span> 265 </dt> 266 <dd> 267 <p>Specifies the <acronym class="acronym">EGL</acronym> display connection.</p> 268 </dd> 269 <dt> 270 <span class="term"> 271 <em class="parameter"> 272 <code>draw</code> 273 </em> 274 </span> 275 </dt> 276 <dd> 277 <p>Specifies the <acronym class="acronym">EGL</acronym> draw surface.</p> 278 </dd> 279 <dt> 280 <span class="term"> 281 <em class="parameter"> 282 <code>read</code> 283 </em> 284 </span> 285 </dt> 286 <dd> 287 <p>Specifies the <acronym class="acronym">EGL</acronym> read surface.</p> 288 </dd> 289 <dt> 290 <span class="term"> 291 <em class="parameter"> 292 <code>context</code> 293 </em> 294 </span> 295 </dt> 296 <dd> 297 <p>Specifies the <acronym class="acronym">EGL</acronym> rendering context 298 to be attached to the surfaces. 299 </p> 300 </dd> 301 </dl> 302 </div> 303 </div> 304 <div class="refsect1"> 305 <a id="description"></a> 306 <h2>Description</h2> 307 <p> 308 <code class="function">eglMakeCurrent</code> binds <em class="parameter"><code>context</code></em> 309 to the current rendering thread and to the <em class="parameter"><code>draw</code></em> 310 and <em class="parameter"><code>read</code></em> surfaces. <em class="parameter"><code>draw</code></em> 311 is used for all GL operations except for any pixel data read back 312 (<a class="citerefentry" href="glReadPixels.html"><span class="citerefentry"><span class="refentrytitle">glReadPixels</span></span></a>, 313 <a class="citerefentry" href="glCopyTexImage2D.html"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>, and 314 <a class="citerefentry" href="glCopyTexSubImage2D.html"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>), 315 which is taken from the frame buffer values of 316 <em class="parameter"><code>read</code></em>. 317 </p> 318 <p> 319 If the calling thread has already a current rendering context, that 320 context is flushed and marked as no longer current. 321 </p> 322 <p> 323 The first time that <em class="parameter"><code>context</code></em> is made current, 324 the viewport and scissor dimensions are set to the size of the 325 <em class="parameter"><code>draw</code></em> surface. The viewport and 326 scissor are not modified when <em class="parameter"><code>context</code></em> is 327 subsequently made current. 328 </p> 329 <p> 330 To release the current context without assigning a new one, call 331 <code class="function">eglMakeCurrent</code> with <em class="parameter"><code>draw</code></em> 332 and <em class="parameter"><code>read</code></em> set to 333 <code class="constant">EGL_NO_SURFACE</code> and <em class="parameter"><code>context</code></em> 334 set to <code class="constant">EGL_NO_CONTEXT</code>. 335 </p> 336 <p> 337 Use 338 <a class="citerefentry" href="eglGetCurrentContext.html"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentContext</span></span></a>, 339 <a class="citerefentry" href="eglGetCurrentDisplay.html"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentDisplay</span></span></a>, and 340 <a class="citerefentry" href="eglGetCurrentSurface.html"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentSurface</span></span></a> 341 to query the current rendering context and associated display connection and surfaces. 342 </p> 343 </div> 344 <div class="refsect1"> 345 <a id="errors"></a> 346 <h2>Errors</h2> 347 <p> 348 <code class="constant">EGL_FALSE</code> is returned on failure, 349 <code class="constant">EGL_TRUE</code> otherwise. If <code class="constant">EGL_FALSE</code> 350 is returned, the previously current rendering context and 351 surfaces (if any) remain unchanged. 352 </p> 353 <p> 354 <code class="constant">EGL_BAD_DISPLAY</code> is generated if 355 <em class="parameter"><code>display</code></em> is not an EGL display connection. 356 </p> 357 <p> 358 <code class="constant">EGL_NOT_INITIALIZED</code> is generated if 359 <em class="parameter"><code>display</code></em> has not been initialized. 360 </p> 361 <p> 362 <code class="constant">EGL_BAD_SURFACE</code> is generated if 363 <em class="parameter"><code>draw</code></em> or <em class="parameter"><code>read</code></em> is not an 364 EGL surface. 365 </p> 366 <p> 367 <code class="constant">EGL_BAD_CONTEXT</code> is generated if 368 <em class="parameter"><code>context</code></em> is not an EGL rendering context. 369 </p> 370 <p> 371 <code class="constant">EGL_BAD_MATCH</code> is generated if 372 <em class="parameter"><code>draw</code></em> or 373 <em class="parameter"><code>read</code></em> 374 are not compatible with 375 <em class="parameter"><code>context</code></em>, or if 376 <em class="parameter"><code>context</code></em> is set to 377 <code class="constant">EGL_NO_CONTEXT</code> and 378 <em class="parameter"><code>draw</code></em> or 379 <em class="parameter"><code>read</code></em> 380 are not set to 381 <code class="constant">EGL_NO_SURFACE</code>, or if 382 <em class="parameter"><code>draw</code></em> or 383 <em class="parameter"><code>read</code></em> are set to 384 <code class="constant">EGL_NO_SURFACE</code> and 385 <em class="parameter"><code>context</code></em> is not set to 386 <code class="constant">EGL_NO_CONTEXT</code>. 387 </p> 388 <p> 389 <code class="constant">EGL_BAD_ACCESS</code> is generated if 390 <em class="parameter"><code>context</code></em> 391 is current to some other thread. 392 </p> 393 <p> 394 <code class="constant">EGL_BAD_NATIVE_PIXMAP</code> may be generated if 395 a native pixmap underlying either 396 <em class="parameter"><code>draw</code></em> or 397 <em class="parameter"><code>read</code></em> 398 is no longer valid. 399 </p> 400 <p> 401 <code class="constant">EGL_BAD_NATIVE_WINDOW</code> may be generated if 402 a native window underlying either 403 <em class="parameter"><code>draw</code></em> or 404 <em class="parameter"><code>read</code></em> 405 is no longer valid. 406 </p> 407 <p> 408 <code class="constant">EGL_BAD_CURRENT_SURFACE</code> is generated if 409 the previous context has unflushed commands and the previous surface 410 is no longer valid. 411 </p> 412 <p> 413 <code class="constant">EGL_BAD_ALLOC</code> may be generated if 414 allocation of ancillary buffers for <em class="parameter"><code>draw</code></em> or 415 <em class="parameter"><code>read</code></em> were delayed until 416 <code class="function">eglMakeCurrent</code> is called, and there are not 417 enough resources to allocate them. 418 </p> 419 <p> 420 <code class="constant">EGL_CONTEXT_LOST</code> is generated if a power management 421 event has occurred. The application must destroy all contexts and 422 reinitialise OpenGL ES state and objects to continue rendering. 423 </p> 424 </div> 425 <div class="refsect1"> 426 <a id="seealso"></a> 427 <h2>See Also</h2> 428 <p> 429 <a class="citerefentry" href="glReadPixels.html"><span class="citerefentry"><span class="refentrytitle">glReadPixels</span></span></a>, 430 <a class="citerefentry" href="glCopyTexImage2D.html"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>, 431 <a class="citerefentry" href="glCopyTexSubImage2D.html"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>, 432 <a class="citerefentry" href="eglCreateContext.html"><span class="citerefentry"><span class="refentrytitle">eglCreateContext</span></span></a>, 433 <a class="citerefentry" href="eglCreatePbufferSurface.html"><span class="citerefentry"><span class="refentrytitle">eglCreatePbufferSurface</span></span></a>, 434 <a class="citerefentry" href="eglCreatePixmapSurface.html"><span class="citerefentry"><span class="refentrytitle">eglCreatePixmapSurface</span></span></a>, 435 <a class="citerefentry" href="eglCreateWindowSurface.html"><span class="citerefentry"><span class="refentrytitle">eglCreateWindowSurface</span></span></a>, 436 <a class="citerefentry" href="eglGetCurrentContext.html"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentContext</span></span></a>, 437 <a class="citerefentry" href="eglGetCurrentDisplay.html"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentDisplay</span></span></a>, 438 <a class="citerefentry" href="eglGetCurrentSurface.html"><span class="citerefentry"><span class="refentrytitle">eglGetCurrentSurface</span></span></a>, 439 <a class="citerefentry" href="eglGetDisplay.html"><span class="citerefentry"><span class="refentrytitle">eglGetDisplay</span></span></a>, 440 <a class="citerefentry" href="eglInitialize.html"><span class="citerefentry"><span class="refentrytitle">eglInitialize</span></span></a> 441 </p> 442 </div> 443 <div xmlns="" class="refsect3" lang="en" xml:lang="en"><a xmlns="http://www.w3.org/1999/xhtml" id="Copyright"></a><h4 xmlns="http://www.w3.org/1999/xhtml"></h4><img xmlns="http://www.w3.org/1999/xhtml" src="KhronosLogo.jpg" /><p xmlns="http://www.w3.org/1999/xhtml"></p> 444Copyright © 2003-2014 The Khronos Group Inc. 445Permission is hereby granted, free of charge, to any person obtaining a 446copy of this software and/or associated documentation files (the 447"Materials"), to deal in the Materials without restriction, including 448without limitation the rights to use, copy, modify, merge, publish, 449distribute, sublicense, and/or sell copies of the Materials, and to 450permit persons to whom the Materials are furnished to do so, subject to 451the condition that this copyright notice and permission notice shall be included 452in all copies or substantial portions of the Materials. 453</div> 454 </div> 455 </body> 456</html> 457