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