"Initial commit to Gerrit"
[profile/ivi/cogl.git] / doc / reference / cogl-2.0-experimental / html / cogl-2.0-experimental-X11-Texture-From-Pixmap.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>X11 Texture From Pixmap</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="Cogl 2.0 Reference Manual">
8 <link rel="up" href="cogl-meta-textures.html" title="Meta Textures">
9 <link rel="prev" href="cogl-2.0-experimental-Sliced-Textures.html" title="Sliced Textures">
10 <link rel="next" href="cogl-framebuffer-apis.html" title="Framebuffers">
11 <meta name="generator" content="GTK-Doc V1.18.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="cogl-2.0-experimental-Sliced-Textures.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="cogl-meta-textures.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">Cogl 2.0 Reference Manual</th>
21 <td><a accesskey="n" href="cogl-framebuffer-apis.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#cogl-2.0-experimental-X11-Texture-From-Pixmap.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#cogl-2.0-experimental-X11-Texture-From-Pixmap.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="cogl-2.0-experimental-X11-Texture-From-Pixmap"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
33 <h2><span class="refentrytitle"><a name="cogl-2.0-experimental-X11-Texture-From-Pixmap.top_of_page"></a>X11 Texture From Pixmap</span></h2>
34 <p>X11 Texture From Pixmap — Functions for creating and manipulating 2D meta
35                     textures derived from X11 pixmaps.</p>
36 </td>
37 <td valign="top" align="right"></td>
38 </tr></table></div>
39 <div class="refsynopsisdiv">
40 <a name="cogl-2.0-experimental-X11-Texture-From-Pixmap.synopsis"></a><h2>Synopsis</h2>
41 <pre class="synopsis"><span class="returnvalue">CoglTexturePixmapX11</span> * <a class="link" href="cogl-2.0-experimental-X11-Texture-From-Pixmap.html#cogl-texture-pixmap-x11-new" title="cogl_texture_pixmap_x11_new ()">cogl_texture_pixmap_x11_new</a>      (<em class="parameter"><code><span class="type">CoglContext</span> *context</code></em>,
42                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> pixmap</code></em>,
43                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> automatic_updates</code></em>,
44                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
45 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-X11-Texture-From-Pixmap.html#cogl-texture-pixmap-x11-update-area" title="cogl_texture_pixmap_x11_update_area ()">cogl_texture_pixmap_x11_update_area</a> (<em class="parameter"><code><span class="type">CoglTexturePixmapX11</span> *texture</code></em>,
46                                                          <em class="parameter"><code><span class="type">int</span> x</code></em>,
47                                                          <em class="parameter"><code><span class="type">int</span> y</code></em>,
48                                                          <em class="parameter"><code><span class="type">int</span> width</code></em>,
49                                                          <em class="parameter"><code><span class="type">int</span> height</code></em>);
50 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="cogl-2.0-experimental-X11-Texture-From-Pixmap.html#cogl-texture-pixmap-x11-is-using-tfp-extension" title="cogl_texture_pixmap_x11_is_using_tfp_extension ()">cogl_texture_pixmap_x11_is_using_tfp_extension</a>
51                                                         (<em class="parameter"><code><span class="type">CoglTexturePixmapX11</span> *texture</code></em>);
52 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-X11-Texture-From-Pixmap.html#cogl-texture-pixmap-x11-set-damage-object" title="cogl_texture_pixmap_x11_set_damage_object ()">cogl_texture_pixmap_x11_set_damage_object</a>
53                                                         (<em class="parameter"><code><span class="type">CoglTexturePixmapX11</span> *texture</code></em>,
54                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> damage</code></em>,
55                                                          <em class="parameter"><code><span class="type">CoglTexturePixmapX11ReportLevel</span> report_level</code></em>);
56 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="cogl-2.0-experimental-X11-Texture-From-Pixmap.html#cogl-is-texture-pixmap-x11" title="cogl_is_texture_pixmap_x11 ()">cogl_is_texture_pixmap_x11</a>          (<em class="parameter"><code><span class="type">void</span> *object</code></em>);
57 </pre>
58 </div>
59 <div class="refsect1">
60 <a name="cogl-2.0-experimental-X11-Texture-From-Pixmap.description"></a><h2>Description</h2>
61 <p>
62 These functions allow high-level meta textures (See the
63 <a class="link" href="cogl-2.0-experimental-High-Level-Meta-Textures.html#CoglMetaTexture" title="CoglMetaTexture"><span class="type">CoglMetaTexture</span></a> interface) that derive their contents from an X11
64 pixmap.
65 </p>
66 </div>
67 <div class="refsect1">
68 <a name="cogl-2.0-experimental-X11-Texture-From-Pixmap.details"></a><h2>Details</h2>
69 <div class="refsect2">
70 <a name="cogl-texture-pixmap-x11-new"></a><h3>cogl_texture_pixmap_x11_new ()</h3>
71 <pre class="programlisting"><span class="returnvalue">CoglTexturePixmapX11</span> * cogl_texture_pixmap_x11_new      (<em class="parameter"><code><span class="type">CoglContext</span> *context</code></em>,
72                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> pixmap</code></em>,
73                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> automatic_updates</code></em>,
74                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
75 <p>
76 Creates a texture that contains the contents of <em class="parameter"><code>pixmap</code></em>. If
77 <em class="parameter"><code>automatic_updates</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then Cogl will attempt to listen for
78 damage events on the pixmap and automatically update the texture
79 when it changes.
80 </p>
81 <div class="variablelist"><table border="0">
82 <col align="left" valign="top">
83 <tbody>
84 <tr>
85 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
86 <td>A <span class="type">CoglContext</span>
87 </td>
88 </tr>
89 <tr>
90 <td><p><span class="term"><em class="parameter"><code>pixmap</code></em> :</span></p></td>
91 <td>A X11 pixmap ID</td>
92 </tr>
93 <tr>
94 <td><p><span class="term"><em class="parameter"><code>automatic_updates</code></em> :</span></p></td>
95 <td>Whether to automatically copy the contents of
96 the pixmap to the texture.</td>
97 </tr>
98 <tr>
99 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
100 <td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for exceptions</td>
101 </tr>
102 <tr>
103 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
104 <td>a new <span class="type">CoglTexturePixmapX11</span> instance</td>
105 </tr>
106 </tbody>
107 </table></div>
108 <p class="since">Since 1.10</p>
109 <p class="stability">Stability Level: Unstable</p>
110 </div>
111 <hr>
112 <div class="refsect2">
113 <a name="cogl-texture-pixmap-x11-update-area"></a><h3>cogl_texture_pixmap_x11_update_area ()</h3>
114 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_texture_pixmap_x11_update_area (<em class="parameter"><code><span class="type">CoglTexturePixmapX11</span> *texture</code></em>,
115                                                          <em class="parameter"><code><span class="type">int</span> x</code></em>,
116                                                          <em class="parameter"><code><span class="type">int</span> y</code></em>,
117                                                          <em class="parameter"><code><span class="type">int</span> width</code></em>,
118                                                          <em class="parameter"><code><span class="type">int</span> height</code></em>);</pre>
119 <p>
120 Forces an update of the given <em class="parameter"><code>texture</code></em> so that it is refreshed with
121 the contents of the pixmap that was given to
122 <a class="link" href="cogl-2.0-experimental-X11-Texture-From-Pixmap.html#cogl-texture-pixmap-x11-new" title="cogl_texture_pixmap_x11_new ()"><code class="function">cogl_texture_pixmap_x11_new()</code></a>.
123 </p>
124 <div class="variablelist"><table border="0">
125 <col align="left" valign="top">
126 <tbody>
127 <tr>
128 <td><p><span class="term"><em class="parameter"><code>texture</code></em> :</span></p></td>
129 <td>A <span class="type">CoglTexturePixmapX11</span> instance</td>
130 </tr>
131 <tr>
132 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
133 <td>x coordinate of the area to update</td>
134 </tr>
135 <tr>
136 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
137 <td>y coordinate of the area to update</td>
138 </tr>
139 <tr>
140 <td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
141 <td>width of the area to update</td>
142 </tr>
143 <tr>
144 <td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
145 <td>height of the area to update</td>
146 </tr>
147 </tbody>
148 </table></div>
149 <p class="since">Since 1.4</p>
150 <p class="stability">Stability Level: Unstable</p>
151 </div>
152 <hr>
153 <div class="refsect2">
154 <a name="cogl-texture-pixmap-x11-is-using-tfp-extension"></a><h3>cogl_texture_pixmap_x11_is_using_tfp_extension ()</h3>
155 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            cogl_texture_pixmap_x11_is_using_tfp_extension
156                                                         (<em class="parameter"><code><span class="type">CoglTexturePixmapX11</span> *texture</code></em>);</pre>
157 <p>
158 Checks whether the given <em class="parameter"><code>texture</code></em> is using the
159 GLX_EXT_texture_from_pixmap or similar extension to copy the
160 contents of the pixmap to the texture.  This extension is usually
161 implemented as zero-copy operation so it implies the updates are
162 working efficiently.
163 </p>
164 <div class="variablelist"><table border="0">
165 <col align="left" valign="top">
166 <tbody>
167 <tr>
168 <td><p><span class="term"><em class="parameter"><code>texture</code></em> :</span></p></td>
169 <td>A <span class="type">CoglTexturePixmapX11</span> instance</td>
170 </tr>
171 <tr>
172 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
173 <td>
174 <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the texture is using an efficient extension
175 and <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
176 </tr>
177 </tbody>
178 </table></div>
179 <p class="since">Since 1.4</p>
180 <p class="stability">Stability Level: Unstable</p>
181 </div>
182 <hr>
183 <div class="refsect2">
184 <a name="cogl-texture-pixmap-x11-set-damage-object"></a><h3>cogl_texture_pixmap_x11_set_damage_object ()</h3>
185 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_texture_pixmap_x11_set_damage_object
186                                                         (<em class="parameter"><code><span class="type">CoglTexturePixmapX11</span> *texture</code></em>,
187                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> damage</code></em>,
188                                                          <em class="parameter"><code><span class="type">CoglTexturePixmapX11ReportLevel</span> report_level</code></em>);</pre>
189 <p>
190 Sets the damage object that will be used to track automatic updates
191 to the <em class="parameter"><code>texture</code></em>. Damage tracking can be disabled by passing 0 for
192 <em class="parameter"><code>damage</code></em>. Otherwise this damage will replace the one used if <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>
193 was passed for automatic_updates to <a class="link" href="cogl-2.0-experimental-X11-Texture-From-Pixmap.html#cogl-texture-pixmap-x11-new" title="cogl_texture_pixmap_x11_new ()"><code class="function">cogl_texture_pixmap_x11_new()</code></a>.
194 </p>
195 <p>
196 Note that Cogl will subtract from the damage region as it processes
197 damage events.
198 </p>
199 <div class="variablelist"><table border="0">
200 <col align="left" valign="top">
201 <tbody>
202 <tr>
203 <td><p><span class="term"><em class="parameter"><code>texture</code></em> :</span></p></td>
204 <td>A <span class="type">CoglTexturePixmapX11</span> instance</td>
205 </tr>
206 <tr>
207 <td><p><span class="term"><em class="parameter"><code>damage</code></em> :</span></p></td>
208 <td>A X11 Damage object or 0</td>
209 </tr>
210 <tr>
211 <td><p><span class="term"><em class="parameter"><code>report_level</code></em> :</span></p></td>
212 <td>The report level which describes how to interpret
213 the damage events. This should match the level that the damage
214 object was created with.</td>
215 </tr>
216 </tbody>
217 </table></div>
218 <p class="since">Since 1.4</p>
219 <p class="stability">Stability Level: Unstable</p>
220 </div>
221 <hr>
222 <div class="refsect2">
223 <a name="cogl-is-texture-pixmap-x11"></a><h3>cogl_is_texture_pixmap_x11 ()</h3>
224 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            cogl_is_texture_pixmap_x11          (<em class="parameter"><code><span class="type">void</span> *object</code></em>);</pre>
225 <p>
226 Checks whether <em class="parameter"><code>object</code></em> points to a <span class="type">CoglTexturePixmapX11</span> instance.
227 </p>
228 <div class="variablelist"><table border="0">
229 <col align="left" valign="top">
230 <tbody>
231 <tr>
232 <td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
233 <td>A pointer to a <a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#CoglObject" title="CoglObject"><span class="type">CoglObject</span></a>
234 </td>
235 </tr>
236 <tr>
237 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
238 <td>
239 <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the object is a <span class="type">CoglTexturePixmapX11</span>, and
240 <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
241 </tr>
242 </tbody>
243 </table></div>
244 <p class="since">Since 1.4</p>
245 <p class="stability">Stability Level: Unstable</p>
246 </div>
247 </div>
248 </div>
249 <div class="footer">
250 <hr>
251           Generated by GTK-Doc V1.18.1</div>
252 </body>
253 </html>