1<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:base="" xml:id="eglBindTexImage"> 2 <info> 3 <copyright> 4 <year>2003-2014</year> 5 <holder>The Khronos Group Inc.</holder> 6 </copyright> 7 </info> 8 <refmeta> 9 <refentrytitle>eglBindTexImage</refentrytitle> 10 <manvolnum>3G</manvolnum> 11 </refmeta> 12 <refnamediv> 13 <refname>eglBindTexImage</refname> 14 <refpurpose> 15 Defines a two-dimensional texture image 16 </refpurpose> 17 </refnamediv> 18 <refsynopsisdiv> 19 <title>C Specification</title> 20 <funcsynopsis> 21 <funcprototype> 22 <funcdef>EGLBoolean <function>eglBindTexImage</function></funcdef> 23 <paramdef>EGLDisplay <parameter>display</parameter></paramdef> 24 <paramdef>EGLSurface <parameter>surface</parameter></paramdef> 25 <paramdef>EGLint <parameter>buffer</parameter></paramdef> 26 </funcprototype> 27 </funcsynopsis> 28 </refsynopsisdiv> 29 <refsect1 xml:id="parameters"><title>Parameters</title> 30 <variablelist> 31 <varlistentry> 32 <term><parameter>display</parameter></term> 33 <listitem><para>Specifies the EGL display connection.</para></listitem> 34 </varlistentry> 35 <varlistentry> 36 <term><parameter>surface</parameter></term> 37 <listitem> 38 <para> 39 Specifies the EGL surface. 40 </para> 41 </listitem> 42 </varlistentry> 43 <varlistentry> 44 <term><parameter>buffer</parameter></term> 45 <listitem><para>Specifies the texture image data.</para></listitem> 46 </varlistentry> 47 </variablelist> 48 </refsect1> 49 <refsect1 xml:id="description"><title>Description</title> 50 <para> 51 The texture image consists of the image data in <parameter>buffer</parameter> for the specified surface, and need not be copied. 52 </para> 53 <para> 54 The texture target, the texture format and the size of the texture components are derived from 55 attributes of the specified surface, which must be a pbuffer supporting one of the 56 <constant>EGL_BIND_TO_TEXTURE_RGB</constant> or <constant>EGL_BIND_TO_TEXTURE_RGBA</constant> attributes. 57 </para> 58 <para> 59 The pbuffer attribute <constant>EGL_TEXTURE_FORMAT</constant> determines the base internal format 60 of the texture. 61 </para> 62 <para> 63 The texture target is derived from the <constant>EGL_TEXTURE_TARGET</constant> attribute of surface. 64 If the attribute value is <constant>EGL_TEXTURE_2D</constant>, then <parameter>buffer</parameter> defines a texture for 65 the two-dimensional texture object which is bound to the current context (hereafter 66 referred to as the current texture object). 67 </para> 68 <para> 69 If <parameter>display</parameter> and <parameter>surface</parameter> are the display and surface for the calling thread's current 70 context, <function>eglBindTexImage</function> performs an implicit <citerefentry><refentrytitle>glFlush</refentrytitle></citerefentry>. 71 For other surfaces, <function>eglBindTexImage</function> waits for all effects from previously issued OpenGL ES commands 72 drawing to the surface to complete before defining the texture image, as 73 though <citerefentry><refentrytitle>glFinish</refentrytitle></citerefentry> were called on the last context to which that surface were bound. 74 </para> 75 <para> 76 After <function>eglBindTexImage</function> is called, the specified surface is no longer available 77 for reading or writing. Any read operation, such as <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry> or 78 <citerefentry><refentrytitle>eglCopyBuffers</refentrytitle></citerefentry>, which reads values from any of the surface's color buffers or ancillary 79 buffers will produce indeterminate results. In addition, draw operations that are 80 done to the surface before its color buffer is released from the texture produce indeterminate 81 results. Specifically, if the surface is current to a context and thread 82 then rendering commands will be processed and the context state will be updated, 83 but the surface may or may not be written. 84 </para> 85 <para> 86 Texture mipmap levels are automatically generated when all of the following 87 conditions are met while calling <function>eglBindTexImage</function>: 88 </para> 89 <itemizedlist> 90 <listitem> 91 <para> 92 The <constant>EGL_MIPMAP_TEXTURE</constant> attribute of the pbuffer being bound is 93 <constant>EGL_TRUE</constant>. 94 </para> 95 </listitem> 96 <listitem> 97 <para> 98 The OpenGL ES texture parameter <constant>GL_GENERATE_MIPMAP</constant> is <constant>GL_TRUE</constant> for 99 the currently bound texture. 100 </para> 101 </listitem> 102 <listitem> 103 <para> 104 The value of the <constant>EGL_MIPMAP_LEVEL</constant> attribute of the pbuffer being bound is 105 equal to the value of the texture parameter <constant>GL_TEXTURE_BASE_LEVEL</constant>. 106 In this case, additional mipmap levels are generated as described in section 3.8 107 of the OpenGL ES 1.1 Specification. 108 </para> 109 </listitem> 110 </itemizedlist> 111 <para> 112 In this case, additional mipmap levels are generated as described in section 3.8 113 of the OpenGL ES 1.1 Specification. 114 </para> 115 </refsect1> 116 <refsect1 xml:id="notes"><title>Notes</title> 117 <para> 118 <citerefentry><refentrytitle>eglSwapBuffers</refentrytitle></citerefentry> has no effect if it is 119 called on a bound surface. 120 </para> 121 <para> 122 Any existing images associated with the different mipmap levels of the texture object 123 are freed (it is as if <citerefentry><refentrytitle>glTexImage</refentrytitle></citerefentry> 124 was called with an image of zero width). 125 </para> 126 <para> 127 The color buffer is bound to a texture object. If the texture object is 128 shared between contexts, then the color buffer is also shared. If a texture object is 129 deleted before <citerefentry><refentrytitle>eglReleaseTexImage</refentrytitle></citerefentry> is called, then the color buffer is released and 130 the surface is made available for reading and writing. 131 </para> 132 <para> 133 It is not an error to call <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry> or 134 <citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry> to replace an 135 image of a texture object that has a color buffer bound to it. However, these calls 136 will cause the color buffer to be released back to the surface and new memory will 137 be allocated for the texture. Note that the color buffer is released even if the image 138 that is being defined is a mipmap level that was not defined by the color buffer. 139 </para> 140 <para> 141 <function>eglBindTexImage</function> is ignored if there is no current rendering context. 142 </para> 143 </refsect1> 144 <refsect1 xml:id="errors"><title>Errors</title> 145 <para> 146 <constant>EGL_BAD_ACCESS</constant> is generated if 147 <parameter>buffer</parameter> is already bound to a texture. 148 </para> 149 <para> 150 <constant>EGL_BAD_MATCH</constant> is generated if the 151 surface attribute <constant>EGL_TEXTURE_FORMAT</constant> is 152 set to <constant>EGL_NO_TEXTURE</constant>. 153 </para> 154 <para> 155 <constant>EGL_BAD_MATCH</constant> is generated if 156 <parameter>buffer</parameter> is not a valid buffer 157 (currently only <constant>EGL_BACK_BUFFER</constant> may be 158 specified). 159 </para> 160 <para> 161 <constant>EGL_BAD_SURFACE</constant> is generated if 162 <parameter>surface</parameter> is not an EGL surface, or is 163 not a pbuffer surface supporting texture binding. 164 </para> 165 </refsect1> 166 <refsect1 xml:id="seealso"><title>See Also</title> 167 <para> 168 <citerefentry><refentrytitle>eglReleaseTexImage</refentrytitle></citerefentry> 169 </para> 170 </refsect1> 171 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="copyright.xml"/> 172</refentry> 173