• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <title xmlns:xlink="http://www.w3.org/1999/xlink">eglBindTexImage - EGL Reference Pages</title>
5    <link rel="stylesheet" type="text/css" href="khronos-man.css"/>
6    <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/>
7  </head>
8  <body>
9    <header/>
10    <div class="refentry" id="eglBindTexImage">
11      <div class="titlepage"/>
12      <div class="refnamediv">
13        <h2>Name</h2>
14        <p>eglBindTexImage —
15            Defines a two-dimensional texture image
16        </p>
17      </div>
18      <div class="refsynopsisdiv">
19        <h2>C Specification</h2>
20        <div class="funcsynopsis">
21          <table style="border: 0; cellspacing: 0; cellpadding: 0;" class="funcprototype-table">
22            <tr>
23              <td>
24                <code class="funcdef">EGLBoolean <strong class="fsfunc">eglBindTexImage</strong>(</code>
25              </td>
26              <td>EGLDisplay <var class="pdparam">display</var>, </td>
27            </tr>
28            <tr>
29              <td> </td>
30              <td>EGLSurface <var class="pdparam">surface</var>, </td>
31            </tr>
32            <tr>
33              <td> </td>
34              <td>EGLint <var class="pdparam">buffer</var><code>)</code>;</td>
35            </tr>
36          </table>
37          <div class="funcprototype-spacer"> </div>
38        </div>
39      </div>
40      <div class="refsect1" id="parameters">
41        <h2>Parameters</h2>
42        <div class="variablelist">
43          <dl class="variablelist">
44            <dt>
45              <span class="term">
46                <em class="parameter">
47                  <code>display</code>
48                </em>
49              </span>
50            </dt>
51            <dd>
52              <p>Specifies the EGL display connection.</p>
53            </dd>
54            <dt>
55              <span class="term">
56                <em class="parameter">
57                  <code>surface</code>
58                </em>
59              </span>
60            </dt>
61            <dd>
62              <p>
63                        Specifies the EGL surface.
64                    </p>
65            </dd>
66            <dt>
67              <span class="term">
68                <em class="parameter">
69                  <code>buffer</code>
70                </em>
71              </span>
72            </dt>
73            <dd>
74              <p>Specifies the texture image data.</p>
75            </dd>
76          </dl>
77        </div>
78      </div>
79      <div class="refsect1" id="description">
80        <h2>Description</h2>
81        <p>
82            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.
83        </p>
84        <p>
85            The texture target, the texture format and the size of the texture components are derived from
86            attributes of the specified surface, which must be a pbuffer supporting one of the
87            <code class="constant">EGL_BIND_TO_TEXTURE_RGB</code> or <code class="constant">EGL_BIND_TO_TEXTURE_RGBA</code> attributes.
88        </p>
89        <p>
90            The pbuffer attribute <code class="constant">EGL_TEXTURE_FORMAT</code> determines the base internal format
91            of the texture.
92        </p>
93        <p>
94            The texture target is derived from the <code class="constant">EGL_TEXTURE_TARGET</code> attribute of surface.
95            If the attribute value is <code class="constant">EGL_TEXTURE_2D</code>, then <em class="parameter"><code>buffer</code></em> defines a texture for
96            the two-dimensional texture object which is bound to the current context (hereafter
97            referred to as the current texture object).
98        </p>
99        <p>
100            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
101            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>.
102            For other surfaces, <code class="function">eglBindTexImage</code> waits for all effects from previously issued OpenGL ES commands
103            drawing to the surface to complete before defining the texture image, as
104            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.
105        </p>
106        <p>
107            After <code class="function">eglBindTexImage</code> is called, the specified surface is no longer available
108            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
109            <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
110            buffers will produce indeterminate results. In addition, draw operations that are
111            done to the surface before its color buffer is released from the texture produce indeterminate
112            results. Specifically, if the surface is current to a context and thread
113            then rendering commands will be processed and the context state will be updated,
114            but the surface may or may not be written.
115        </p>
116        <p>
117            Texture mipmap levels are automatically generated when all of the following
118            conditions are met while calling <code class="function">eglBindTexImage</code>:
119        </p>
120        <div class="itemizedlist">
121          <ul class="itemizedlist" style="list-style-type: disc; ">
122            <li class="listitem">
123              <p>
124            The <code class="constant">EGL_MIPMAP_TEXTURE</code> attribute of the pbuffer being bound is
125            <code class="constant">EGL_TRUE</code>.
126        </p>
127            </li>
128            <li class="listitem">
129              <p>
130            The OpenGL ES texture parameter <code class="constant">GL_GENERATE_MIPMAP</code> is <code class="constant">GL_TRUE</code> for
131            the currently bound texture.
132        </p>
133            </li>
134            <li class="listitem">
135              <p>
136            The value of the <code class="constant">EGL_MIPMAP_LEVEL</code> attribute of the pbuffer being bound is
137            equal to the value of the texture parameter <code class="constant">GL_TEXTURE_BASE_LEVEL</code>.
138            In this case, additional mipmap levels are generated as described in section 3.8
139            of the OpenGL ES 1.1 Specification.
140        </p>
141            </li>
142          </ul>
143        </div>
144        <p>
145            In this case, additional mipmap levels are generated as described in section 3.8
146            of the OpenGL ES 1.1 Specification.
147        </p>
148      </div>
149      <div class="refsect1" id="notes">
150        <h2>Notes</h2>
151        <p>
152            <a class="citerefentry" href="eglSwapBuffers.xhtml"><span class="citerefentry"><span class="refentrytitle">eglSwapBuffers</span></span></a> has no effect if it is
153            called on a bound surface.
154        </p>
155        <p>
156            Any existing images associated with the different mipmap levels of the texture object
157            are freed (it is as if <a class="citerefentry" href="glTexImage.xhtml"><span class="citerefentry"><span class="refentrytitle">glTexImage</span></span></a>
158            was called with an image of zero width).
159        </p>
160        <p>
161            The color buffer is bound to a texture object. If the texture object is
162            shared between contexts, then the color buffer is also shared. If a texture object is
163            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
164            the surface is made available for reading and writing.
165        </p>
166        <p>
167            It is not an error to call <a class="citerefentry" href="glTexImage2D.xhtml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a> or
168            <a class="citerefentry" href="glCopyTexImage2D.xhtml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a> to replace an
169            image of a texture object that has a color buffer bound to it. However, these calls
170            will cause the color buffer to be released back to the surface and new memory will
171            be allocated for the texture. Note that the color buffer is released even if the image
172            that is being defined is a mipmap level that was not defined by the color buffer.
173        </p>
174        <p>
175            <code class="function">eglBindTexImage</code> is ignored if there is no current rendering context.
176        </p>
177      </div>
178      <div class="refsect1" id="errors">
179        <h2>Errors</h2>
180        <p>
181            <code class="constant">EGL_BAD_ACCESS</code> is generated if
182            <em class="parameter"><code>buffer</code></em> is already bound to a texture.
183        </p>
184        <p>
185            <code class="constant">EGL_BAD_MATCH</code> is generated if the
186            surface attribute <code class="constant">EGL_TEXTURE_FORMAT</code> is
187            set to <code class="constant">EGL_NO_TEXTURE</code>.
188        </p>
189        <p>
190            <code class="constant">EGL_BAD_MATCH</code> is generated if
191            <em class="parameter"><code>buffer</code></em> is not a valid buffer
192            (currently only <code class="constant">EGL_BACK_BUFFER</code> may be
193            specified).
194        </p>
195        <p>
196            <code class="constant">EGL_BAD_SURFACE</code> is generated if
197            <em class="parameter"><code>surface</code></em> is not an EGL surface, or is
198            not a pbuffer surface supporting texture binding.
199        </p>
200      </div>
201      <div class="refsect1" id="seealso">
202        <h2>See Also</h2>
203        <p>
204            <a class="citerefentry" href="eglReleaseTexImage.xhtml"><span class="citerefentry"><span class="refentrytitle">eglReleaseTexImage</span></span></a>
205        </p>
206      </div>
207      <p>
208    </p>
209      <div class="refsect3" id="copyright">
210        <img src="KhronosLogo.jpg"/>
211        <p>
212            Copyright © 2003-2014 The Khronos Group Inc.
213            Permission is hereby granted, free of charge, to any person obtaining a
214            copy of this software and/or associated documentation files (the
215            "Materials"), to deal in the Materials without restriction, including
216            without limitation the rights to use, copy, modify, merge, publish,
217            distribute, sublicense, and/or sell copies of the Materials, and to
218            permit persons to whom the Materials are furnished to do so, subject to
219            the condition that this copyright notice and permission notice shall be included
220            in all copies or substantial portions of the Materials.
221        </p>
222      </div>
223      <p>
224</p>
225    </div>
226    <footer/>
227  </body>
228</html>
229