40
45
</tr></table></div>
41
46
<div class="refsynopsisdiv" title="Synopsis">
42
47
<a name="cogl-Textures.synopsis"></a><h2>Synopsis</h2>
43
<pre class="synopsis">
44
<a class="link" href="cogl-Textures.html#CoglTextureVertex" title="CoglTextureVertex">CoglTextureVertex</a>;
48
<pre class="synopsis"> <a class="link" href="cogl-Textures.html#CoglTextureVertex" title="CoglTextureVertex">CoglTextureVertex</a>;
45
49
enum <a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags">CoglTextureFlags</a>;
46
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> <a class="link" href="cogl-Textures.html#cogl-texture-new-with-size" title="cogl_texture_new_with_size ()">cogl_texture_new_with_size</a> (<a
47
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
50
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
52
<a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags">CoglTextureFlags</a> flags,
53
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> internal_format);
54
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> <a class="link" href="cogl-Textures.html#cogl-texture-new-from-file" title="cogl_texture_new_from_file ()">cogl_texture_new_from_file</a> (const <a
55
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
57
<a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags">CoglTextureFlags</a> flags,
58
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> internal_format,
60
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
62
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> <a class="link" href="cogl-Textures.html#cogl-texture-new-from-data" title="cogl_texture_new_from_data ()">cogl_texture_new_from_data</a> (<a
63
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
66
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
68
<a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags">CoglTextureFlags</a> flags,
69
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format,
70
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> internal_format,
72
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
75
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"
77
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> <a class="link" href="cogl-Textures.html#cogl-texture-new-from-foreign" title="cogl_texture_new_from_foreign ()">cogl_texture_new_from_foreign</a> (GLuint gl_handle,
83
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format);
84
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> <a class="link" href="cogl-Textures.html#cogl-texture-new-from-bitmap" title="cogl_texture_new_from_bitmap ()">cogl_texture_new_from_bitmap</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> bmp_handle,
85
<a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags">CoglTextureFlags</a> flags,
86
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> internal_format);
88
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
89
>gboolean</a> <a class="link" href="cogl-Textures.html#cogl-is-texture" title="cogl_is_texture ()">cogl_is_texture</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
90
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> <a class="link" href="cogl-Textures.html#cogl-texture-ref" title="cogl_texture_ref ()">cogl_texture_ref</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
91
void <a class="link" href="cogl-Textures.html#cogl-texture-unref" title="cogl_texture_unref ()">cogl_texture_unref</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
50
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> <a class="link" href="cogl-Textures.html#cogl-texture-new-with-size" title="cogl_texture_new_with_size ()">cogl_texture_new_with_size</a> (unsigned <span class="returnvalue">int</span> width,
51
unsigned <span class="returnvalue">int</span> height,
52
<a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags"><span class="returnvalue">CoglTextureFlags</span></a> flags,
53
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a> internal_format);
54
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> <a class="link" href="cogl-Textures.html#cogl-texture-new-from-file" title="cogl_texture_new_from_file ()">cogl_texture_new_from_file</a> (const <span class="returnvalue">char</span> *filename,
55
<a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags"><span class="returnvalue">CoglTextureFlags</span></a> flags,
56
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a> internal_format,
57
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> **error);
58
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> <a class="link" href="cogl-Textures.html#cogl-texture-new-from-data" title="cogl_texture_new_from_data ()">cogl_texture_new_from_data</a> (unsigned <span class="returnvalue">int</span> width,
59
unsigned <span class="returnvalue">int</span> height,
60
<a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags"><span class="returnvalue">CoglTextureFlags</span></a> flags,
61
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a> format,
62
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a> internal_format,
63
unsigned <span class="returnvalue">int</span> rowstride,
64
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> *data);
65
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> <a class="link" href="cogl-Textures.html#cogl-texture-new-from-foreign" title="cogl_texture_new_from_foreign ()">cogl_texture_new_from_foreign</a> (<span class="returnvalue">GLuint</span> gl_handle,
66
<span class="returnvalue">GLenum</span> gl_target,
67
<span class="returnvalue">GLuint</span> width,
68
<span class="returnvalue">GLuint</span> height,
69
<span class="returnvalue">GLuint</span> x_pot_waste,
70
<span class="returnvalue">GLuint</span> y_pot_waste,
71
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a> format);
72
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> <a class="link" href="cogl-Textures.html#cogl-texture-new-from-bitmap" title="cogl_texture_new_from_bitmap ()">cogl_texture_new_from_bitmap</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> bmp_handle,
73
<a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags"><span class="returnvalue">CoglTextureFlags</span></a> flags,
74
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a> internal_format);
75
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> <a class="link" href="cogl-Textures.html#cogl-texture-new-from-sub-texture" title="cogl_texture_new_from_sub_texture ()">cogl_texture_new_from_sub_texture</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> full_texture,
76
<span class="returnvalue">int</span> sub_x,
77
<span class="returnvalue">int</span> sub_y,
78
<span class="returnvalue">int</span> sub_width,
79
<span class="returnvalue">int</span> sub_height);
80
<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-Textures.html#cogl-is-texture" title="cogl_is_texture ()">cogl_is_texture</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle);
81
<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> <a class="link" href="cogl-Textures.html#cogl-texture-ref" title="cogl_texture_ref ()">cogl_texture_ref</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle);
82
<span class="returnvalue">void</span> <a class="link" href="cogl-Textures.html#cogl-texture-unref" title="cogl_texture_unref ()">cogl_texture_unref</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle);
94
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
95
>guint</a> <a class="link" href="cogl-Textures.html#cogl-texture-get-width" title="cogl_texture_get_width ()">cogl_texture_get_width</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
97
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
98
>guint</a> <a class="link" href="cogl-Textures.html#cogl-texture-get-height" title="cogl_texture_get_height ()">cogl_texture_get_height</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
99
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> <a class="link" href="cogl-Textures.html#cogl-texture-get-format" title="cogl_texture_get_format ()">cogl_texture_get_format</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
101
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
102
>guint</a> <a class="link" href="cogl-Textures.html#cogl-texture-get-rowstride" title="cogl_texture_get_rowstride ()">cogl_texture_get_rowstride</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
104
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
105
>gint</a> <a class="link" href="cogl-Textures.html#cogl-texture-get-max-waste" title="cogl_texture_get_max_waste ()">cogl_texture_get_max_waste</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
107
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
108
>gboolean</a> <a class="link" href="cogl-Textures.html#cogl-texture-is-sliced" title="cogl_texture_is_sliced ()">cogl_texture_is_sliced</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
110
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
111
>gboolean</a> <a class="link" href="cogl-Textures.html#cogl-texture-get-gl-texture" title="cogl_texture_get_gl_texture ()">cogl_texture_get_gl_texture</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
112
GLuint *out_gl_handle,
113
GLenum *out_gl_target);
115
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
116
>gint</a> <a class="link" href="cogl-Textures.html#cogl-texture-get-data" title="cogl_texture_get_data ()">cogl_texture_get_data</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
117
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format,
119
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
120
>guint</a> rowstride,
122
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"
125
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
126
>gboolean</a> <a class="link" href="cogl-Textures.html#cogl-texture-set-region" title="cogl_texture_set_region ()">cogl_texture_set_region</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
128
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
131
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
134
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
137
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
140
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
141
>guint</a> dst_width,
143
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
144
>guint</a> dst_height,
146
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
149
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
151
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format,
153
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
154
>guint</a> rowstride,
156
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"
84
unsigned <span class="returnvalue">int</span> <a class="link" href="cogl-Textures.html#cogl-texture-get-width" title="cogl_texture_get_width ()">cogl_texture_get_width</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle);
85
unsigned <span class="returnvalue">int</span> <a class="link" href="cogl-Textures.html#cogl-texture-get-height" title="cogl_texture_get_height ()">cogl_texture_get_height</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle);
86
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a> <a class="link" href="cogl-Textures.html#cogl-texture-get-format" title="cogl_texture_get_format ()">cogl_texture_get_format</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle);
87
unsigned <span class="returnvalue">int</span> <a class="link" href="cogl-Textures.html#cogl-texture-get-rowstride" title="cogl_texture_get_rowstride ()">cogl_texture_get_rowstride</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle);
88
<span class="returnvalue">int</span> <a class="link" href="cogl-Textures.html#cogl-texture-get-max-waste" title="cogl_texture_get_max_waste ()">cogl_texture_get_max_waste</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle);
89
<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-Textures.html#cogl-texture-is-sliced" title="cogl_texture_is_sliced ()">cogl_texture_is_sliced</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle);
90
<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-Textures.html#cogl-texture-get-gl-texture" title="cogl_texture_get_gl_texture ()">cogl_texture_get_gl_texture</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle,
91
<span class="returnvalue">GLuint</span> *out_gl_handle,
92
<span class="returnvalue">GLenum</span> *out_gl_target);
93
<span class="returnvalue">int</span> <a class="link" href="cogl-Textures.html#cogl-texture-get-data" title="cogl_texture_get_data ()">cogl_texture_get_data</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle,
94
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a> format,
95
unsigned <span class="returnvalue">int</span> rowstride,
96
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> *data);
97
<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-Textures.html#cogl-texture-set-region" title="cogl_texture_set_region ()">cogl_texture_set_region</a> (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle,
98
<span class="returnvalue">int</span> src_x,
99
<span class="returnvalue">int</span> src_y,
100
<span class="returnvalue">int</span> dst_x,
101
<span class="returnvalue">int</span> dst_y,
102
unsigned <span class="returnvalue">int</span> dst_width,
103
unsigned <span class="returnvalue">int</span> dst_height,
104
<span class="returnvalue">int</span> width,
105
<span class="returnvalue">int</span> height,
106
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a> format,
107
unsigned <span class="returnvalue">int</span> rowstride,
108
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> *data);
160
111
<div class="refsect1" title="Description">
452
376
<div class="refsect2" title="cogl_texture_new_from_foreign ()">
453
377
<a name="cogl-texture-new-from-foreign"></a><h3>cogl_texture_new_from_foreign ()</h3>
454
<pre class="programlisting"><a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> cogl_texture_new_from_foreign (GLuint gl_handle,
460
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format);</pre>
378
<pre class="programlisting"><a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> cogl_texture_new_from_foreign (<span class="returnvalue">GLuint</span> gl_handle,
379
<span class="returnvalue">GLenum</span> gl_target,
380
<span class="returnvalue">GLuint</span> width,
381
<span class="returnvalue">GLuint</span> height,
382
<span class="returnvalue">GLuint</span> x_pot_waste,
383
<span class="returnvalue">GLuint</span> y_pot_waste,
384
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a> format);</pre>
462
386
Creates a COGL texture based on an existing OpenGL texture; the
463
width, height and format are passed along since it is not possible
464
to query this from a handle with GLES 1.0.</p>
387
width, height and format are passed along since it is not always
388
possible to query these from OpenGL.
391
The waste arguments allow you to create a Cogl texture that maps to
392
a region smaller than the real OpenGL texture. For instance if your
393
hardware only supports power-of-two textures you may load a
394
non-power-of-two image into a larger power-of-two texture and use
395
the waste arguments to tell Cogl which region should be mapped to
396
the texture coordinate range [0:1].</p>
467
397
<div class="variablelist"><table border="0">
468
398
<col align="left" valign="top">
471
401
<td><p><span class="term"><em class="parameter"><code>gl_handle</code></em> :</span></p></td>
402
<td> opengl handle of foreign texture.
406
<td><p><span class="term"><em class="parameter"><code>gl_target</code></em> :</span></p></td>
472
407
<td> opengl target type of foreign texture
476
<td><p><span class="term"><em class="parameter"><code>gl_target</code></em> :</span></p></td>
477
<td> opengl handle of foreign texture.
481
411
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
482
412
<td> width of foreign texture
554
482
<p class="since">Since 1.0</p>
485
<div class="refsect2" title="cogl_texture_new_from_sub_texture ()">
486
<a name="cogl-texture-new-from-sub-texture"></a><h3>cogl_texture_new_from_sub_texture ()</h3>
487
<pre class="programlisting"><a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> cogl_texture_new_from_sub_texture (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> full_texture,
488
<span class="returnvalue">int</span> sub_x,
489
<span class="returnvalue">int</span> sub_y,
490
<span class="returnvalue">int</span> sub_width,
491
<span class="returnvalue">int</span> sub_height);</pre>
493
Creates a new texture which represents a subregion of another
494
texture. The GL resources will be shared so that no new texture
495
data is actually allocated.
498
Sub textures have undefined behaviour texture coordinates outside
499
of the range [0,1] are used. They also do not work with
503
The sub texture will keep a reference to the full texture so you do
504
not need to keep one separately if you only want to use the sub
506
<div class="variablelist"><table border="0">
507
<col align="left" valign="top">
510
<td><p><span class="term"><em class="parameter"><code>full_texture</code></em> :</span></p></td>
511
<td> a <a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> to an existing texture
515
<td><p><span class="term"><em class="parameter"><code>sub_x</code></em> :</span></p></td>
516
<td> X coordinate of the top-left of the subregion
520
<td><p><span class="term"><em class="parameter"><code>sub_y</code></em> :</span></p></td>
521
<td> Y coordinate of the top-left of the subregion
525
<td><p><span class="term"><em class="parameter"><code>sub_width</code></em> :</span></p></td>
526
<td> Width in pixels of the subregion
530
<td><p><span class="term"><em class="parameter"><code>sub_height</code></em> :</span></p></td>
531
<td> Height in pixels of the subregion
535
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
536
<td> a <a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> to the new texture.
542
<p class="since">Since 1.2</p>
557
545
<div class="refsect2" title="cogl_is_texture ()">
558
546
<a name="cogl-is-texture"></a><h3>cogl_is_texture ()</h3>
559
<pre class="programlisting"><a
560
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
561
>gboolean</a> cogl_is_texture (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);</pre>
547
<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 (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle);</pre>
563
549
Gets whether the given handle references an existing texture object.</p>
566
550
<div class="variablelist"><table border="0">
567
551
<col align="left" valign="top">
886
828
<div class="refsect2" title="cogl_texture_set_region ()">
887
829
<a name="cogl-texture-set-region"></a><h3>cogl_texture_set_region ()</h3>
888
<pre class="programlisting"><a
889
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
890
>gboolean</a> cogl_texture_set_region (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
892
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
895
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
898
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
901
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
904
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
905
>guint</a> dst_width,
907
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
908
>guint</a> dst_height,
910
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
913
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
915
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format,
917
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
918
>guint</a> rowstride,
920
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"
921
>guchar</a> *data);</pre>
830
<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_set_region (<a class="link" href="cogl-General-API.html#CoglHandle" title="CoglHandle"><span class="returnvalue">CoglHandle</span></a> handle,
831
<span class="returnvalue">int</span> src_x,
832
<span class="returnvalue">int</span> src_y,
833
<span class="returnvalue">int</span> dst_x,
834
<span class="returnvalue">int</span> dst_y,
835
unsigned <span class="returnvalue">int</span> dst_width,
836
unsigned <span class="returnvalue">int</span> dst_height,
837
<span class="returnvalue">int</span> width,
838
<span class="returnvalue">int</span> height,
839
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a> format,
840
unsigned <span class="returnvalue">int</span> rowstride,
841
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> *data);</pre>
923
843
Sets the pixels in a rectangular subregion of <em class="parameter"><code>handle</code></em> from an in-memory
924
844
buffer containing pixel data.</p>
927
845
<div class="variablelist"><table border="0">
928
846
<col align="left" valign="top">