102f4aeb0Sopenharmony_ci<?xml version="1.0" encoding="UTF-8" standalone="no"?> 202f4aeb0Sopenharmony_ci<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"> 302f4aeb0Sopenharmony_ci <head> 402f4aeb0Sopenharmony_ci <title xmlns:xlink="http://www.w3.org/1999/xlink">eglBindTexImage - EGL Reference Pages</title> 502f4aeb0Sopenharmony_ci <link rel="stylesheet" type="text/css" href="khronos-man.css"/> 602f4aeb0Sopenharmony_ci <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/> 702f4aeb0Sopenharmony_ci </head> 802f4aeb0Sopenharmony_ci <body> 902f4aeb0Sopenharmony_ci <header/> 1002f4aeb0Sopenharmony_ci <div class="refentry" id="eglBindTexImage"> 1102f4aeb0Sopenharmony_ci <div class="titlepage"/> 1202f4aeb0Sopenharmony_ci <div class="refnamediv"> 1302f4aeb0Sopenharmony_ci <h2>Name</h2> 1402f4aeb0Sopenharmony_ci <p>eglBindTexImage — 1502f4aeb0Sopenharmony_ci Defines a two-dimensional texture image 1602f4aeb0Sopenharmony_ci </p> 1702f4aeb0Sopenharmony_ci </div> 1802f4aeb0Sopenharmony_ci <div class="refsynopsisdiv"> 1902f4aeb0Sopenharmony_ci <h2>C Specification</h2> 2002f4aeb0Sopenharmony_ci <div class="funcsynopsis"> 2102f4aeb0Sopenharmony_ci <table style="border: 0; cellspacing: 0; cellpadding: 0;" class="funcprototype-table"> 2202f4aeb0Sopenharmony_ci <tr> 2302f4aeb0Sopenharmony_ci <td> 2402f4aeb0Sopenharmony_ci <code class="funcdef">EGLBoolean <strong class="fsfunc">eglBindTexImage</strong>(</code> 2502f4aeb0Sopenharmony_ci </td> 2602f4aeb0Sopenharmony_ci <td>EGLDisplay <var class="pdparam">display</var>, </td> 2702f4aeb0Sopenharmony_ci </tr> 2802f4aeb0Sopenharmony_ci <tr> 2902f4aeb0Sopenharmony_ci <td> </td> 3002f4aeb0Sopenharmony_ci <td>EGLSurface <var class="pdparam">surface</var>, </td> 3102f4aeb0Sopenharmony_ci </tr> 3202f4aeb0Sopenharmony_ci <tr> 3302f4aeb0Sopenharmony_ci <td> </td> 3402f4aeb0Sopenharmony_ci <td>EGLint <var class="pdparam">buffer</var><code>)</code>;</td> 3502f4aeb0Sopenharmony_ci </tr> 3602f4aeb0Sopenharmony_ci </table> 3702f4aeb0Sopenharmony_ci <div class="funcprototype-spacer"> </div> 3802f4aeb0Sopenharmony_ci </div> 3902f4aeb0Sopenharmony_ci </div> 4002f4aeb0Sopenharmony_ci <div class="refsect1" id="parameters"> 4102f4aeb0Sopenharmony_ci <h2>Parameters</h2> 4202f4aeb0Sopenharmony_ci <div class="variablelist"> 4302f4aeb0Sopenharmony_ci <dl class="variablelist"> 4402f4aeb0Sopenharmony_ci <dt> 4502f4aeb0Sopenharmony_ci <span class="term"> 4602f4aeb0Sopenharmony_ci <em class="parameter"> 4702f4aeb0Sopenharmony_ci <code>display</code> 4802f4aeb0Sopenharmony_ci </em> 4902f4aeb0Sopenharmony_ci </span> 5002f4aeb0Sopenharmony_ci </dt> 5102f4aeb0Sopenharmony_ci <dd> 5202f4aeb0Sopenharmony_ci <p>Specifies the EGL display connection.</p> 5302f4aeb0Sopenharmony_ci </dd> 5402f4aeb0Sopenharmony_ci <dt> 5502f4aeb0Sopenharmony_ci <span class="term"> 5602f4aeb0Sopenharmony_ci <em class="parameter"> 5702f4aeb0Sopenharmony_ci <code>surface</code> 5802f4aeb0Sopenharmony_ci </em> 5902f4aeb0Sopenharmony_ci </span> 6002f4aeb0Sopenharmony_ci </dt> 6102f4aeb0Sopenharmony_ci <dd> 6202f4aeb0Sopenharmony_ci <p> 6302f4aeb0Sopenharmony_ci Specifies the EGL surface. 6402f4aeb0Sopenharmony_ci </p> 6502f4aeb0Sopenharmony_ci </dd> 6602f4aeb0Sopenharmony_ci <dt> 6702f4aeb0Sopenharmony_ci <span class="term"> 6802f4aeb0Sopenharmony_ci <em class="parameter"> 6902f4aeb0Sopenharmony_ci <code>buffer</code> 7002f4aeb0Sopenharmony_ci </em> 7102f4aeb0Sopenharmony_ci </span> 7202f4aeb0Sopenharmony_ci </dt> 7302f4aeb0Sopenharmony_ci <dd> 7402f4aeb0Sopenharmony_ci <p>Specifies the texture image data.</p> 7502f4aeb0Sopenharmony_ci </dd> 7602f4aeb0Sopenharmony_ci </dl> 7702f4aeb0Sopenharmony_ci </div> 7802f4aeb0Sopenharmony_ci </div> 7902f4aeb0Sopenharmony_ci <div class="refsect1" id="description"> 8002f4aeb0Sopenharmony_ci <h2>Description</h2> 8102f4aeb0Sopenharmony_ci <p> 8202f4aeb0Sopenharmony_ci The texture image consists of the image data in <em class="parameter"><code>buffer</code></em> for the specified surface, and need not be copied. 8302f4aeb0Sopenharmony_ci </p> 8402f4aeb0Sopenharmony_ci <p> 8502f4aeb0Sopenharmony_ci The texture target, the texture format and the size of the texture components are derived from 8602f4aeb0Sopenharmony_ci attributes of the specified surface, which must be a pbuffer supporting one of the 8702f4aeb0Sopenharmony_ci <code class="constant">EGL_BIND_TO_TEXTURE_RGB</code> or <code class="constant">EGL_BIND_TO_TEXTURE_RGBA</code> attributes. 8802f4aeb0Sopenharmony_ci </p> 8902f4aeb0Sopenharmony_ci <p> 9002f4aeb0Sopenharmony_ci The pbuffer attribute <code class="constant">EGL_TEXTURE_FORMAT</code> determines the base internal format 9102f4aeb0Sopenharmony_ci of the texture. 9202f4aeb0Sopenharmony_ci </p> 9302f4aeb0Sopenharmony_ci <p> 9402f4aeb0Sopenharmony_ci The texture target is derived from the <code class="constant">EGL_TEXTURE_TARGET</code> attribute of surface. 9502f4aeb0Sopenharmony_ci If the attribute value is <code class="constant">EGL_TEXTURE_2D</code>, then <em class="parameter"><code>buffer</code></em> defines a texture for 9602f4aeb0Sopenharmony_ci the two-dimensional texture object which is bound to the current context (hereafter 9702f4aeb0Sopenharmony_ci referred to as the current texture object). 9802f4aeb0Sopenharmony_ci </p> 9902f4aeb0Sopenharmony_ci <p> 10002f4aeb0Sopenharmony_ci If <em class="parameter"><code>display</code></em> and <em class="parameter"><code>surface</code></em> are the display and surface for the calling thread's current 10102f4aeb0Sopenharmony_ci context, <code class="function">eglBindTexImage</code> performs an implicit <a class="citerefentry" href="glFlush.xhtml"><span class="citerefentry"><span class="refentrytitle">glFlush</span></span></a>. 10202f4aeb0Sopenharmony_ci For other surfaces, <code class="function">eglBindTexImage</code> waits for all effects from previously issued OpenGL ES commands 10302f4aeb0Sopenharmony_ci drawing to the surface to complete before defining the texture image, as 10402f4aeb0Sopenharmony_ci though <a class="citerefentry" href="glFinish.xhtml"><span class="citerefentry"><span class="refentrytitle">glFinish</span></span></a> were called on the last context to which that surface were bound. 10502f4aeb0Sopenharmony_ci </p> 10602f4aeb0Sopenharmony_ci <p> 10702f4aeb0Sopenharmony_ci After <code class="function">eglBindTexImage</code> is called, the specified surface is no longer available 10802f4aeb0Sopenharmony_ci for reading or writing. Any read operation, such as <a class="citerefentry" href="glReadPixels.xhtml"><span class="citerefentry"><span class="refentrytitle">glReadPixels</span></span></a> or 10902f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglCopyBuffers.xhtml"><span class="citerefentry"><span class="refentrytitle">eglCopyBuffers</span></span></a>, which reads values from any of the surface's color buffers or ancillary 11002f4aeb0Sopenharmony_ci buffers will produce indeterminate results. In addition, draw operations that are 11102f4aeb0Sopenharmony_ci done to the surface before its color buffer is released from the texture produce indeterminate 11202f4aeb0Sopenharmony_ci results. Specifically, if the surface is current to a context and thread 11302f4aeb0Sopenharmony_ci then rendering commands will be processed and the context state will be updated, 11402f4aeb0Sopenharmony_ci but the surface may or may not be written. 11502f4aeb0Sopenharmony_ci </p> 11602f4aeb0Sopenharmony_ci <p> 11702f4aeb0Sopenharmony_ci Texture mipmap levels are automatically generated when all of the following 11802f4aeb0Sopenharmony_ci conditions are met while calling <code class="function">eglBindTexImage</code>: 11902f4aeb0Sopenharmony_ci </p> 12002f4aeb0Sopenharmony_ci <div class="itemizedlist"> 12102f4aeb0Sopenharmony_ci <ul class="itemizedlist" style="list-style-type: disc; "> 12202f4aeb0Sopenharmony_ci <li class="listitem"> 12302f4aeb0Sopenharmony_ci <p> 12402f4aeb0Sopenharmony_ci The <code class="constant">EGL_MIPMAP_TEXTURE</code> attribute of the pbuffer being bound is 12502f4aeb0Sopenharmony_ci <code class="constant">EGL_TRUE</code>. 12602f4aeb0Sopenharmony_ci </p> 12702f4aeb0Sopenharmony_ci </li> 12802f4aeb0Sopenharmony_ci <li class="listitem"> 12902f4aeb0Sopenharmony_ci <p> 13002f4aeb0Sopenharmony_ci The OpenGL ES texture parameter <code class="constant">GL_GENERATE_MIPMAP</code> is <code class="constant">GL_TRUE</code> for 13102f4aeb0Sopenharmony_ci the currently bound texture. 13202f4aeb0Sopenharmony_ci </p> 13302f4aeb0Sopenharmony_ci </li> 13402f4aeb0Sopenharmony_ci <li class="listitem"> 13502f4aeb0Sopenharmony_ci <p> 13602f4aeb0Sopenharmony_ci The value of the <code class="constant">EGL_MIPMAP_LEVEL</code> attribute of the pbuffer being bound is 13702f4aeb0Sopenharmony_ci equal to the value of the texture parameter <code class="constant">GL_TEXTURE_BASE_LEVEL</code>. 13802f4aeb0Sopenharmony_ci In this case, additional mipmap levels are generated as described in section 3.8 13902f4aeb0Sopenharmony_ci of the OpenGL ES 1.1 Specification. 14002f4aeb0Sopenharmony_ci </p> 14102f4aeb0Sopenharmony_ci </li> 14202f4aeb0Sopenharmony_ci </ul> 14302f4aeb0Sopenharmony_ci </div> 14402f4aeb0Sopenharmony_ci <p> 14502f4aeb0Sopenharmony_ci In this case, additional mipmap levels are generated as described in section 3.8 14602f4aeb0Sopenharmony_ci of the OpenGL ES 1.1 Specification. 14702f4aeb0Sopenharmony_ci </p> 14802f4aeb0Sopenharmony_ci </div> 14902f4aeb0Sopenharmony_ci <div class="refsect1" id="notes"> 15002f4aeb0Sopenharmony_ci <h2>Notes</h2> 15102f4aeb0Sopenharmony_ci <p> 15202f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglSwapBuffers.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSwapBuffers</span></span></a> has no effect if it is 15302f4aeb0Sopenharmony_ci called on a bound surface. 15402f4aeb0Sopenharmony_ci </p> 15502f4aeb0Sopenharmony_ci <p> 15602f4aeb0Sopenharmony_ci Any existing images associated with the different mipmap levels of the texture object 15702f4aeb0Sopenharmony_ci are freed (it is as if <a class="citerefentry" href="glTexImage.xhtml"><span class="citerefentry"><span class="refentrytitle">glTexImage</span></span></a> 15802f4aeb0Sopenharmony_ci was called with an image of zero width). 15902f4aeb0Sopenharmony_ci </p> 16002f4aeb0Sopenharmony_ci <p> 16102f4aeb0Sopenharmony_ci The color buffer is bound to a texture object. If the texture object is 16202f4aeb0Sopenharmony_ci shared between contexts, then the color buffer is also shared. If a texture object is 16302f4aeb0Sopenharmony_ci deleted before <a class="citerefentry" href="eglReleaseTexImage.xhtml"><span class="citerefentry"><span class="refentrytitle">eglReleaseTexImage</span></span></a> is called, then the color buffer is released and 16402f4aeb0Sopenharmony_ci the surface is made available for reading and writing. 16502f4aeb0Sopenharmony_ci </p> 16602f4aeb0Sopenharmony_ci <p> 16702f4aeb0Sopenharmony_ci It is not an error to call <a class="citerefentry" href="glTexImage2D.xhtml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a> or 16802f4aeb0Sopenharmony_ci <a class="citerefentry" href="glCopyTexImage2D.xhtml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a> to replace an 16902f4aeb0Sopenharmony_ci image of a texture object that has a color buffer bound to it. However, these calls 17002f4aeb0Sopenharmony_ci will cause the color buffer to be released back to the surface and new memory will 17102f4aeb0Sopenharmony_ci be allocated for the texture. Note that the color buffer is released even if the image 17202f4aeb0Sopenharmony_ci that is being defined is a mipmap level that was not defined by the color buffer. 17302f4aeb0Sopenharmony_ci </p> 17402f4aeb0Sopenharmony_ci <p> 17502f4aeb0Sopenharmony_ci <code class="function">eglBindTexImage</code> is ignored if there is no current rendering context. 17602f4aeb0Sopenharmony_ci </p> 17702f4aeb0Sopenharmony_ci </div> 17802f4aeb0Sopenharmony_ci <div class="refsect1" id="errors"> 17902f4aeb0Sopenharmony_ci <h2>Errors</h2> 18002f4aeb0Sopenharmony_ci <p> 18102f4aeb0Sopenharmony_ci <code class="constant">EGL_BAD_ACCESS</code> is generated if 18202f4aeb0Sopenharmony_ci <em class="parameter"><code>buffer</code></em> is already bound to a texture. 18302f4aeb0Sopenharmony_ci </p> 18402f4aeb0Sopenharmony_ci <p> 18502f4aeb0Sopenharmony_ci <code class="constant">EGL_BAD_MATCH</code> is generated if the 18602f4aeb0Sopenharmony_ci surface attribute <code class="constant">EGL_TEXTURE_FORMAT</code> is 18702f4aeb0Sopenharmony_ci set to <code class="constant">EGL_NO_TEXTURE</code>. 18802f4aeb0Sopenharmony_ci </p> 18902f4aeb0Sopenharmony_ci <p> 19002f4aeb0Sopenharmony_ci <code class="constant">EGL_BAD_MATCH</code> is generated if 19102f4aeb0Sopenharmony_ci <em class="parameter"><code>buffer</code></em> is not a valid buffer 19202f4aeb0Sopenharmony_ci (currently only <code class="constant">EGL_BACK_BUFFER</code> may be 19302f4aeb0Sopenharmony_ci specified). 19402f4aeb0Sopenharmony_ci </p> 19502f4aeb0Sopenharmony_ci <p> 19602f4aeb0Sopenharmony_ci <code class="constant">EGL_BAD_SURFACE</code> is generated if 19702f4aeb0Sopenharmony_ci <em class="parameter"><code>surface</code></em> is not an EGL surface, or is 19802f4aeb0Sopenharmony_ci not a pbuffer surface supporting texture binding. 19902f4aeb0Sopenharmony_ci </p> 20002f4aeb0Sopenharmony_ci </div> 20102f4aeb0Sopenharmony_ci <div class="refsect1" id="seealso"> 20202f4aeb0Sopenharmony_ci <h2>See Also</h2> 20302f4aeb0Sopenharmony_ci <p> 20402f4aeb0Sopenharmony_ci <a class="citerefentry" href="eglReleaseTexImage.xhtml"><span class="citerefentry"><span class="refentrytitle">eglReleaseTexImage</span></span></a> 20502f4aeb0Sopenharmony_ci </p> 20602f4aeb0Sopenharmony_ci </div> 20702f4aeb0Sopenharmony_ci <p> 20802f4aeb0Sopenharmony_ci </p> 20902f4aeb0Sopenharmony_ci <div class="refsect3" id="copyright"> 21002f4aeb0Sopenharmony_ci <img src="KhronosLogo.jpg"/> 21102f4aeb0Sopenharmony_ci <p> 21202f4aeb0Sopenharmony_ci Copyright © 2003-2014 The Khronos Group Inc. 21302f4aeb0Sopenharmony_ci Permission is hereby granted, free of charge, to any person obtaining a 21402f4aeb0Sopenharmony_ci copy of this software and/or associated documentation files (the 21502f4aeb0Sopenharmony_ci "Materials"), to deal in the Materials without restriction, including 21602f4aeb0Sopenharmony_ci without limitation the rights to use, copy, modify, merge, publish, 21702f4aeb0Sopenharmony_ci distribute, sublicense, and/or sell copies of the Materials, and to 21802f4aeb0Sopenharmony_ci permit persons to whom the Materials are furnished to do so, subject to 21902f4aeb0Sopenharmony_ci the condition that this copyright notice and permission notice shall be included 22002f4aeb0Sopenharmony_ci in all copies or substantial portions of the Materials. 22102f4aeb0Sopenharmony_ci </p> 22202f4aeb0Sopenharmony_ci </div> 22302f4aeb0Sopenharmony_ci <p> 22402f4aeb0Sopenharmony_ci</p> 22502f4aeb0Sopenharmony_ci </div> 22602f4aeb0Sopenharmony_ci <footer/> 22702f4aeb0Sopenharmony_ci </body> 22802f4aeb0Sopenharmony_ci</html> 229