102f4aeb0Sopenharmony_ci<?xml version="1.0" encoding="UTF-8"?> 202f4aeb0Sopenharmony_ci<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" 302f4aeb0Sopenharmony_ci "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd"> 402f4aeb0Sopenharmony_ci<refentry xml:base="" id="eglBindTexImage"> 502f4aeb0Sopenharmony_ci <refentryinfo> 602f4aeb0Sopenharmony_ci <copyright> 702f4aeb0Sopenharmony_ci <year>2003-2014</year> 802f4aeb0Sopenharmony_ci <holder>The Khronos Group Inc.</holder> 902f4aeb0Sopenharmony_ci </copyright> 1002f4aeb0Sopenharmony_ci </refentryinfo> 1102f4aeb0Sopenharmony_ci <refmeta> 1202f4aeb0Sopenharmony_ci <refentrytitle>eglBindTexImage</refentrytitle> 1302f4aeb0Sopenharmony_ci <manvolnum>3G</manvolnum> 1402f4aeb0Sopenharmony_ci </refmeta> 1502f4aeb0Sopenharmony_ci <refnamediv> 1602f4aeb0Sopenharmony_ci <refname>eglBindTexImage</refname> 1702f4aeb0Sopenharmony_ci <refpurpose> 1802f4aeb0Sopenharmony_ci Defines a two-dimensional texture image 1902f4aeb0Sopenharmony_ci </refpurpose> 2002f4aeb0Sopenharmony_ci </refnamediv> 2102f4aeb0Sopenharmony_ci <refsynopsisdiv> 2202f4aeb0Sopenharmony_ci <title>C Specification</title> 2302f4aeb0Sopenharmony_ci <funcsynopsis> 2402f4aeb0Sopenharmony_ci <funcprototype> 2502f4aeb0Sopenharmony_ci <funcdef>EGLBoolean <function>eglBindTexImage</function></funcdef> 2602f4aeb0Sopenharmony_ci <paramdef>EGLDisplay <parameter>display</parameter></paramdef> 2702f4aeb0Sopenharmony_ci <paramdef>EGLSurface <parameter>surface</parameter></paramdef> 2802f4aeb0Sopenharmony_ci <paramdef>EGLint <parameter>buffer</parameter></paramdef> 2902f4aeb0Sopenharmony_ci </funcprototype> 3002f4aeb0Sopenharmony_ci </funcsynopsis> 3102f4aeb0Sopenharmony_ci </refsynopsisdiv> 3202f4aeb0Sopenharmony_ci <refsect1 id="parameters"><title>Parameters</title> 3302f4aeb0Sopenharmony_ci <variablelist> 3402f4aeb0Sopenharmony_ci <varlistentry> 3502f4aeb0Sopenharmony_ci <term><parameter>display</parameter></term> 3602f4aeb0Sopenharmony_ci <listitem><para>Specifies the EGL display connection.</para></listitem> 3702f4aeb0Sopenharmony_ci </varlistentry> 3802f4aeb0Sopenharmony_ci <varlistentry> 3902f4aeb0Sopenharmony_ci <term><parameter>surface</parameter></term> 4002f4aeb0Sopenharmony_ci <listitem> 4102f4aeb0Sopenharmony_ci <para> 4202f4aeb0Sopenharmony_ci Specifies the EGL surface. 4302f4aeb0Sopenharmony_ci </para> 4402f4aeb0Sopenharmony_ci </listitem> 4502f4aeb0Sopenharmony_ci </varlistentry> 4602f4aeb0Sopenharmony_ci <varlistentry> 4702f4aeb0Sopenharmony_ci <term><parameter>buffer</parameter></term> 4802f4aeb0Sopenharmony_ci <listitem><para>Specifies the texture image data.</para></listitem> 4902f4aeb0Sopenharmony_ci </varlistentry> 5002f4aeb0Sopenharmony_ci </variablelist> 5102f4aeb0Sopenharmony_ci </refsect1> 5202f4aeb0Sopenharmony_ci <refsect1 id="description"><title>Description</title> 5302f4aeb0Sopenharmony_ci <para> 5402f4aeb0Sopenharmony_ci The texture image consists of the image data in <parameter>buffer</parameter> for the specified surface, and need not be copied. 5502f4aeb0Sopenharmony_ci </para> 5602f4aeb0Sopenharmony_ci <para> 5702f4aeb0Sopenharmony_ci The texture target, the texture format and the size of the texture components are derived from 5802f4aeb0Sopenharmony_ci attributes of the specified surface, which must be a pbuffer supporting one of the 5902f4aeb0Sopenharmony_ci <constant>EGL_BIND_TO_TEXTURE_RGB</constant> or <constant>EGL_BIND_TO_TEXTURE_RGBA</constant> attributes. 6002f4aeb0Sopenharmony_ci </para> 6102f4aeb0Sopenharmony_ci <para> 6202f4aeb0Sopenharmony_ci The pbuffer attribute <constant>EGL_TEXTURE_FORMAT</constant> determines the base internal format 6302f4aeb0Sopenharmony_ci of the texture. 6402f4aeb0Sopenharmony_ci </para> 6502f4aeb0Sopenharmony_ci <para> 6602f4aeb0Sopenharmony_ci The texture target is derived from the <constant>EGL_TEXTURE_TARGET</constant> attribute of surface. 6702f4aeb0Sopenharmony_ci If the attribute value is <constant>EGL_TEXTURE_2D</constant>, then <parameter>buffer</parameter> defines a texture for 6802f4aeb0Sopenharmony_ci the two-dimensional texture object which is bound to the current context (hereafter 6902f4aeb0Sopenharmony_ci referred to as the current texture object). 7002f4aeb0Sopenharmony_ci </para> 7102f4aeb0Sopenharmony_ci <para> 7202f4aeb0Sopenharmony_ci If <parameter>display</parameter> and <parameter>surface</parameter> are the display and surface for the calling thread's current 7302f4aeb0Sopenharmony_ci context, <function>eglBindTexImage</function> performs an implicit <citerefentry><refentrytitle>glFlush</refentrytitle></citerefentry>. 7402f4aeb0Sopenharmony_ci For other surfaces, <function>eglBindTexImage</function> waits for all effects from previously issued OpenGL ES commands 7502f4aeb0Sopenharmony_ci drawing to the surface to complete before defining the texture image, as 7602f4aeb0Sopenharmony_ci though <citerefentry><refentrytitle>glFinish</refentrytitle></citerefentry> were called on the last context to which that surface were bound. 7702f4aeb0Sopenharmony_ci </para> 7802f4aeb0Sopenharmony_ci <para> 7902f4aeb0Sopenharmony_ci After <function>eglBindTexImage</function> is called, the specified surface is no longer available 8002f4aeb0Sopenharmony_ci for reading or writing. Any read operation, such as <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry> or 8102f4aeb0Sopenharmony_ci <citerefentry><refentrytitle>eglCopyBuffers</refentrytitle></citerefentry>, which reads values from any of the surface's color buffers or ancillary 8202f4aeb0Sopenharmony_ci buffers will produce indeterminate results. In addition, draw operations that are 8302f4aeb0Sopenharmony_ci done to the surface before its color buffer is released from the texture produce indeterminate 8402f4aeb0Sopenharmony_ci results. Specifically, if the surface is current to a context and thread 8502f4aeb0Sopenharmony_ci then rendering commands will be processed and the context state will be updated, 8602f4aeb0Sopenharmony_ci but the surface may or may not be written. 8702f4aeb0Sopenharmony_ci </para> 8802f4aeb0Sopenharmony_ci <para> 8902f4aeb0Sopenharmony_ci Texture mipmap levels are automatically generated when all of the following 9002f4aeb0Sopenharmony_ci conditions are met while calling <function>eglBindTexImage</function>: 9102f4aeb0Sopenharmony_ci </para> 9202f4aeb0Sopenharmony_ci <itemizedlist> 9302f4aeb0Sopenharmony_ci <listitem> 9402f4aeb0Sopenharmony_ci <para> 9502f4aeb0Sopenharmony_ci The <constant>EGL_MIPMAP_TEXTURE</constant> attribute of the pbuffer being bound is 9602f4aeb0Sopenharmony_ci <constant>EGL_TRUE</constant>. 9702f4aeb0Sopenharmony_ci </para> 9802f4aeb0Sopenharmony_ci </listitem> 9902f4aeb0Sopenharmony_ci <listitem> 10002f4aeb0Sopenharmony_ci <para> 10102f4aeb0Sopenharmony_ci The OpenGL ES texture parameter <constant>GL_GENERATE_MIPMAP</constant> is <constant>GL_TRUE</constant> for 10202f4aeb0Sopenharmony_ci the currently bound texture. 10302f4aeb0Sopenharmony_ci </para> 10402f4aeb0Sopenharmony_ci </listitem> 10502f4aeb0Sopenharmony_ci <listitem> 10602f4aeb0Sopenharmony_ci <para> 10702f4aeb0Sopenharmony_ci The value of the <constant>EGL_MIPMAP_LEVEL</constant> attribute of the pbuffer being bound is 10802f4aeb0Sopenharmony_ci equal to the value of the texture parameter <constant>GL_TEXTURE_BASE_LEVEL</constant>. 10902f4aeb0Sopenharmony_ci In this case, additional mipmap levels are generated as described in section 3.8 11002f4aeb0Sopenharmony_ci of the OpenGL ES 1.1 Specification. 11102f4aeb0Sopenharmony_ci </para> 11202f4aeb0Sopenharmony_ci </listitem> 11302f4aeb0Sopenharmony_ci </itemizedlist> 11402f4aeb0Sopenharmony_ci <para> 11502f4aeb0Sopenharmony_ci In this case, additional mipmap levels are generated as described in section 3.8 11602f4aeb0Sopenharmony_ci of the OpenGL ES 1.1 Specification. 11702f4aeb0Sopenharmony_ci </para> 11802f4aeb0Sopenharmony_ci </refsect1> 11902f4aeb0Sopenharmony_ci <refsect1 id="notes"><title>Notes</title> 12002f4aeb0Sopenharmony_ci <para> 12102f4aeb0Sopenharmony_ci <citerefentry><refentrytitle>eglSwapBuffers</refentrytitle></citerefentry> has no effect if it is 12202f4aeb0Sopenharmony_ci called on a bound surface. 12302f4aeb0Sopenharmony_ci </para> 12402f4aeb0Sopenharmony_ci <para> 12502f4aeb0Sopenharmony_ci Any existing images associated with the different mipmap levels of the texture object 12602f4aeb0Sopenharmony_ci are freed (it is as if <citerefentry><refentrytitle>glTexImage</refentrytitle></citerefentry> 12702f4aeb0Sopenharmony_ci was called with an image of zero width). 12802f4aeb0Sopenharmony_ci </para> 12902f4aeb0Sopenharmony_ci <para> 13002f4aeb0Sopenharmony_ci The color buffer is bound to a texture object. If the texture object is 13102f4aeb0Sopenharmony_ci shared between contexts, then the color buffer is also shared. If a texture object is 13202f4aeb0Sopenharmony_ci deleted before <citerefentry><refentrytitle>eglReleaseTexImage</refentrytitle></citerefentry> is called, then the color buffer is released and 13302f4aeb0Sopenharmony_ci the surface is made available for reading and writing. 13402f4aeb0Sopenharmony_ci </para> 13502f4aeb0Sopenharmony_ci <para> 13602f4aeb0Sopenharmony_ci It is not an error to call <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry> or 13702f4aeb0Sopenharmony_ci <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry> to replace an 13802f4aeb0Sopenharmony_ci image of a texture object that has a color buffer bound to it. However, these calls 13902f4aeb0Sopenharmony_ci will cause the color buffer to be released back to the surface and new memory will 14002f4aeb0Sopenharmony_ci be allocated for the texture. Note that the color buffer is released even if the image 14102f4aeb0Sopenharmony_ci that is being defined is a mipmap level that was not defined by the color buffer. 14202f4aeb0Sopenharmony_ci </para> 14302f4aeb0Sopenharmony_ci <para> 14402f4aeb0Sopenharmony_ci <function>eglBindTexImage</function> is ignored if there is no current rendering context. 14502f4aeb0Sopenharmony_ci </para> 14602f4aeb0Sopenharmony_ci </refsect1> 14702f4aeb0Sopenharmony_ci <refsect1 id="errors"><title>Errors</title> 14802f4aeb0Sopenharmony_ci <para> 14902f4aeb0Sopenharmony_ci <constant>EGL_BAD_ACCESS</constant> is generated if 15002f4aeb0Sopenharmony_ci <parameter>buffer</parameter> is already bound to a texture. 15102f4aeb0Sopenharmony_ci </para> 15202f4aeb0Sopenharmony_ci <para> 15302f4aeb0Sopenharmony_ci <constant>EGL_BAD_MATCH</constant> is generated if the 15402f4aeb0Sopenharmony_ci surface attribute <constant>EGL_TEXTURE_FORMAT</constant> is 15502f4aeb0Sopenharmony_ci set to <constant>EGL_NO_TEXTURE</constant>. 15602f4aeb0Sopenharmony_ci </para> 15702f4aeb0Sopenharmony_ci <para> 15802f4aeb0Sopenharmony_ci <constant>EGL_BAD_MATCH</constant> is generated if 15902f4aeb0Sopenharmony_ci <parameter>buffer</parameter> is not a valid buffer 16002f4aeb0Sopenharmony_ci (currently only <constant>EGL_BACK_BUFFER</constant> may be 16102f4aeb0Sopenharmony_ci specified). 16202f4aeb0Sopenharmony_ci </para> 16302f4aeb0Sopenharmony_ci <para> 16402f4aeb0Sopenharmony_ci <constant>EGL_BAD_SURFACE</constant> is generated if 16502f4aeb0Sopenharmony_ci <parameter>surface</parameter> is not an EGL surface, or is 16602f4aeb0Sopenharmony_ci not a pbuffer surface supporting texture binding. 16702f4aeb0Sopenharmony_ci </para> 16802f4aeb0Sopenharmony_ci </refsect1> 16902f4aeb0Sopenharmony_ci <refsect1 id="seealso"><title>See Also</title> 17002f4aeb0Sopenharmony_ci <para> 17102f4aeb0Sopenharmony_ci <citerefentry><refentrytitle>eglReleaseTexImage</refentrytitle></citerefentry> 17202f4aeb0Sopenharmony_ci </para> 17302f4aeb0Sopenharmony_ci </refsect1> 17402f4aeb0Sopenharmony_ci <refsect3 id="Copyright"><title></title> 17502f4aeb0Sopenharmony_ci <!-- Content included from copyright.inc.xsl --> 17602f4aeb0Sopenharmony_ci <imageobject> 17702f4aeb0Sopenharmony_ci <imagedata fileref="KhronosLogo.jpg" format="jpg" /> 17802f4aeb0Sopenharmony_ci </imageobject> 17902f4aeb0Sopenharmony_ci <para /> 18002f4aeb0Sopenharmony_ci </refsect3> 18102f4aeb0Sopenharmony_ci</refentry> 182