1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Textures</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="COGL 0.8.0 Reference Manual">
<link rel="up" href="ch01.html" title="COGL - GL Abstraction API">
<link rel="prev" href="cogl-Utility-API.html" title="Utility API">
<link rel="next" href="cogl-Shaders-and-Programmable-Pipeline.html" title="Shaders and Programmable Pipeline">
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="COGL - GL Abstraction API">
<link rel="index" href="ix01.html" title="Index">
<link rel="appendix" href="license.html" title="Appendix A. License">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="cogl-Utility-API.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">COGL 0.8.0
Reference Manual</th>
<td><a accesskey="n" href="cogl-Shaders-and-Programmable-Pipeline.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#cogl-Textures.synopsis" class="shortcut">Top</a>
|
<a href="#cogl-Textures.description" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="cogl-Textures"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="cogl-Textures.top_of_page"></a>Textures</span></h2>
<p>Textures — Fuctions for creating and manipulating textures</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="cogl-Textures.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
<a class="link" href="cogl-Textures.html#CoglTextureVertex" title="CoglTextureVertex">CoglTextureVertex</a>;
<a class="link" href="cogl-Utility-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> (guint width,
guint height,
gint max_waste,
gboolean auto_mipmap,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> internal_format);
<a class="link" href="cogl-Utility-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 gchar *filename,
gint max_waste,
gboolean auto_mipmap,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> internal_format,
GError **error);
<a class="link" href="cogl-Utility-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> (guint width,
guint height,
gint max_waste,
gboolean auto_mipmap,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> internal_format,
guint rowstride,
const guchar *data);
<a class="link" href="cogl-Utility-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,
GLenum gl_target,
GLuint width,
GLuint height,
GLuint x_pot_waste,
GLuint y_pot_waste,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format);
gboolean <a class="link" href="cogl-Textures.html#cogl-is-texture" title="cogl_is_texture ()">cogl_is_texture</a> (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
guint <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-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
guint <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-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
<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-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
guint <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-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
gint <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-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
COGLenum <a class="link" href="cogl-Textures.html#cogl-texture-get-min-filter" title="cogl_texture_get_min_filter ()">cogl_texture_get_min_filter</a> (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
COGLenum <a class="link" href="cogl-Textures.html#cogl-texture-get-mag-filter" title="cogl_texture_get_mag_filter ()">cogl_texture_get_mag_filter</a> (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
gboolean <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-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
gboolean <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-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
GLuint *out_gl_handle,
GLenum *out_gl_target);
gint <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-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format,
guint rowstride,
guchar *data);
void <a class="link" href="cogl-Textures.html#cogl-texture-set-filters" title="cogl_texture_set_filters ()">cogl_texture_set_filters</a> (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
COGLenum min_filter,
COGLenum mag_filter);
gboolean <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-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
gint src_x,
gint src_y,
gint dst_x,
gint dst_y,
guint dst_width,
guint dst_height,
gint width,
gint height,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format,
guint rowstride,
const guchar *data);
<a class="link" href="cogl-Utility-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-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
void <a class="link" href="cogl-Textures.html#cogl-texture-unref" title="cogl_texture_unref ()">cogl_texture_unref</a> (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);
void <a class="link" href="cogl-Textures.html#cogl-texture-rectangle" title="cogl_texture_rectangle ()">cogl_texture_rectangle</a> (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> x1,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> y1,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> x2,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> y2,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> tx1,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> ty1,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> tx2,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> ty2);
void <a class="link" href="cogl-Textures.html#cogl-texture-polygon" title="cogl_texture_polygon ()">cogl_texture_polygon</a> (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
guint n_vertices,
<a class="link" href="cogl-Textures.html#CoglTextureVertex" title="CoglTextureVertex">CoglTextureVertex</a> *vertices,
gboolean use_color);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="cogl-Textures.description"></a><h2>Description</h2>
<p>
COGL allows creating and manipulating GL textures using a uniform
API that tries to hide all the various complexities of creating,
loading and manipulating textures.</p>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="cogl-Textures.details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="CoglTextureVertex"></a><h3>CoglTextureVertex</h3>
<pre class="programlisting">typedef struct {
ClutterFixed x, y, z;
ClutterFixed tx, ty;
ClutterColor color;
} CoglTextureVertex;
</pre>
<p>
Used to specify vertex information when calling <a class="link" href="cogl-Textures.html#cogl-texture-polygon" title="cogl_texture_polygon ()"><code class="function">cogl_texture_polygon()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> <em class="structfield"><code>x</code></em>;</span></p></td>
<td> Model x-coordinate
</td>
</tr>
<tr>
<td><p><span class="term"><a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> <em class="structfield"><code>y</code></em>;</span></p></td>
<td> Model y-coordinate
</td>
</tr>
<tr>
<td><p><span class="term"><a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> <em class="structfield"><code>z</code></em>;</span></p></td>
<td> Model z-coordinate
</td>
</tr>
<tr>
<td><p><span class="term"><a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> <em class="structfield"><code>tx</code></em>;</span></p></td>
<td> Texture x-coordinate
</td>
</tr>
<tr>
<td><p><span class="term"><a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> <em class="structfield"><code>ty</code></em>;</span></p></td>
<td> Texture y-coordinate
</td>
</tr>
<tr>
<td><p><span class="term"><a
href="../clutter/clutter-Colors.html#ClutterColor"
>ClutterColor</a> <em class="structfield"><code>color</code></em>;</span></p></td>
<td> The color to use at this vertex. This is ignored if
<em class="parameter"><code>use_color</code></em> is <code class="literal">FALSE</code> when calling <a class="link" href="cogl-Textures.html#cogl-texture-polygon" title="cogl_texture_polygon ()"><code class="function">cogl_texture_polygon()</code></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-new-with-size"></a><h3>cogl_texture_new_with_size ()</h3>
<pre class="programlisting"><a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> cogl_texture_new_with_size (guint width,
guint height,
gint max_waste,
gboolean auto_mipmap,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> internal_format);</pre>
<p>
Create a new texture with specified dimensions and pixel format.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td> width of texture in pixels.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td> height of texture in pixels.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>max_waste</code></em> :</span></p></td>
<td> maximum extra horizontal and|or vertical margin pixels to make
texture fit GPU limitations.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>auto_mipmap</code></em> :</span></p></td>
<td> enable or disable automatic generation of mipmap pyramid
from the base level image whenever it is updated.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>internal_format</code></em> :</span></p></td>
<td> the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> to use for the GPU storage of the
texture.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> to the newly created texture or COGL_INVALID_HANDLE
if texture creation failed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-new-from-file"></a><h3>cogl_texture_new_from_file ()</h3>
<pre class="programlisting"><a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> cogl_texture_new_from_file (const gchar *filename,
gint max_waste,
gboolean auto_mipmap,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> internal_format,
GError **error);</pre>
<p>
Load an image file from disk.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
<td> the file to load
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>max_waste</code></em> :</span></p></td>
<td> maximum extra horizontal and|or vertical margin pixels to make
texture fit GPU limitations.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>auto_mipmap</code></em> :</span></p></td>
<td> enable or disable automatic generation of mipmap pyramid
from the base level image whenever it is updated.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>internal_format</code></em> :</span></p></td>
<td> the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> to use for the GPU storage of the
texture.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> a <span class="type">GError</span> or NULL.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> to the newly created texture or COGL_INVALID_HANDLE
if creating the texture failed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-new-from-data"></a><h3>cogl_texture_new_from_data ()</h3>
<pre class="programlisting"><a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> cogl_texture_new_from_data (guint width,
guint height,
gint max_waste,
gboolean auto_mipmap,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> internal_format,
guint rowstride,
const guchar *data);</pre>
<p>
Create a new cogl texture based on data residing in memory.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td> width of texture in pixels.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td> height of texture in pixels.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>max_waste</code></em> :</span></p></td>
<td> maximum extra horizontal and|or vertical margin pixels to make
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>auto_mipmap</code></em> :</span></p></td>
<td> enable or disable automatic generation of mipmap pyramid
from the base level image whenever it is updated.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td> the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> the buffer is stored in in RAM
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>internal_format</code></em> :</span></p></td>
<td> the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> that will be used for storing the
buffer on the GPU.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>rowstride</code></em> :</span></p></td>
<td> the memory offset in bytes between the starts of scanlines in
<em class="parameter"><code>data</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td> pointer the memory region where the source buffer resides.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> to the newly created texture or COGL_INVALID_HANDLE
if creating the texture failed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-new-from-foreign"></a><h3>cogl_texture_new_from_foreign ()</h3>
<pre class="programlisting"><a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> cogl_texture_new_from_foreign (GLuint gl_handle,
GLenum gl_target,
GLuint width,
GLuint height,
GLuint x_pot_waste,
GLuint y_pot_waste,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format);</pre>
<p>
Create a cogl texture based on an existing OpenGL texture, the width, height
and format are passed along since it is not possible to query this from a
handle with GLES 1.0.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>gl_handle</code></em> :</span></p></td>
<td> opengl target type of foreign texture
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>gl_target</code></em> :</span></p></td>
<td> opengl handle of foreign texture.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td> width of foreign texture
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td> height of foreign texture.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x_pot_waste</code></em> :</span></p></td>
<td> maximum horizontal waste.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y_pot_waste</code></em> :</span></p></td>
<td> maximum vertical waste.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td> format of the foreign texture.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> to the newly created texture or COGL_INVALID_HANDLE
if creating the texture failed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-is-texture"></a><h3>cogl_is_texture ()</h3>
<pre class="programlisting">gboolean cogl_is_texture (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);</pre>
<p>
Gets whether the given handle references an existing texture object.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> A CoglHandle
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <code class="literal">TRUE</code> if the handle references a texture,
<code class="literal">FALSE</code> otherwise
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-get-width"></a><h3>cogl_texture_get_width ()</h3>
<pre class="programlisting">guint cogl_texture_get_width (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);</pre>
<p>
Query the width of a cogl texture.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> for a texture.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the width of the GPU side texture in pixels:
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-get-height"></a><h3>cogl_texture_get_height ()</h3>
<pre class="programlisting">guint cogl_texture_get_height (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);</pre>
<p>
Query the height of a cogl texture.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> for a texture.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the height of the GPU side texture in pixels:
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-get-format"></a><h3>cogl_texture_get_format ()</h3>
<pre class="programlisting"><a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> cogl_texture_get_format (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);</pre>
<p>
Query the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> of a cogl texture.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> for a texture.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> of the GPU side texture.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-get-rowstride"></a><h3>cogl_texture_get_rowstride ()</h3>
<pre class="programlisting">guint cogl_texture_get_rowstride (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);</pre>
<p>
Query the rowstride of a cogl texture.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> for a texture.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the offset in bytes between each consequetive row of pixels.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-get-max-waste"></a><h3>cogl_texture_get_max_waste ()</h3>
<pre class="programlisting">gint cogl_texture_get_max_waste (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);</pre>
<p>
Query the maximum wasted (unused) pixels in one dimension of a GPU side
texture.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> for a texture.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the maximum waste.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-get-min-filter"></a><h3>cogl_texture_get_min_filter ()</h3>
<pre class="programlisting">COGLenum cogl_texture_get_min_filter (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);</pre>
<p>
Query the currently set downscaling filter for a cogl texture.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> for a texture.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the current downscaling filter for a cogl texture.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-get-mag-filter"></a><h3>cogl_texture_get_mag_filter ()</h3>
<pre class="programlisting">COGLenum cogl_texture_get_mag_filter (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);</pre>
<p>
Query the currently set downscaling filter for a cogl texture.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> for a texture.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the current downscaling filter for a cogl texture.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-is-sliced"></a><h3>cogl_texture_is_sliced ()</h3>
<pre class="programlisting">gboolean cogl_texture_is_sliced (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);</pre>
<p>
Query if a texture is sliced (stored as multiple GPU side tecture
objects).</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> for a texture.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <code class="literal">TRUE</code> if the texture is sliced, <code class="literal">FALSE</code> if the texture
is stored as a single GPU texture.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-get-gl-texture"></a><h3>cogl_texture_get_gl_texture ()</h3>
<pre class="programlisting">gboolean cogl_texture_get_gl_texture (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
GLuint *out_gl_handle,
GLenum *out_gl_target);</pre>
<p>
Query the GL handles for a GPU side texture through it's <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a>,
if the texture is spliced the data for the first sub texture will be
queried.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> for a texture.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>out_gl_handle</code></em> :</span></p></td>
<td> pointer to return location for the textures GL handle, or
NULL.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>out_gl_target</code></em> :</span></p></td>
<td> pointer to return location for the GL target type, or NULL.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <code class="literal">TRUE</code> if the handle was successfully retrieved <code class="literal">FALSE</code>
if the handle was invalid.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-get-data"></a><h3>cogl_texture_get_data ()</h3>
<pre class="programlisting">gint cogl_texture_get_data (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format,
guint rowstride,
guchar *data);</pre>
<p>
Copy the pixel data from a cogl texture to system memory.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a> for a texture.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td> the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> to store the texture as.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>rowstride</code></em> :</span></p></td>
<td> the rowstride of <em class="parameter"><code>data</code></em> or retrieved from texture if none is
specified.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td> memory location to write contents of buffer, or <code class="literal">NULL</code> if we're
only querying the data size through the return value.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the size of the texture data in bytes (or 0 if the texture
is not valid.)
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-set-filters"></a><h3>cogl_texture_set_filters ()</h3>
<pre class="programlisting">void cogl_texture_set_filters (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
COGLenum min_filter,
COGLenum mag_filter);</pre>
<p>
Changes the decimation and interpolation filters used when the texture is
drawn at other scales than 100%.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>min_filter</code></em> :</span></p></td>
<td> the filter used when scaling the texture down.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>mag_filter</code></em> :</span></p></td>
<td> the filter used when magnifying the texture.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-set-region"></a><h3>cogl_texture_set_region ()</h3>
<pre class="programlisting">gboolean cogl_texture_set_region (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
gint src_x,
gint src_y,
gint dst_x,
gint dst_y,
guint dst_width,
guint dst_height,
gint width,
gint height,
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a> format,
guint rowstride,
const guchar *data);</pre>
<p>
Sets the pixels in a rectangular subregion of <em class="parameter"><code>handle</code></em> from an in-memory
buffer containing pixel data.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle"><span class="type">CoglHandle</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>src_x</code></em> :</span></p></td>
<td> upper left coordinate to use from source data.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>src_y</code></em> :</span></p></td>
<td> upper left coordinate to use from source data.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dst_x</code></em> :</span></p></td>
<td> upper left destination horizontal coordinate.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dst_y</code></em> :</span></p></td>
<td> upper left destination vertical coordinate.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dst_width</code></em> :</span></p></td>
<td> width of destination region to write.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dst_height</code></em> :</span></p></td>
<td> height of destination region to write.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td> width of source data buffer.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td> height of source data buffer.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td> the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> used in the source buffer.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>rowstride</code></em> :</span></p></td>
<td> rowstride of source buffer (computed from width if none
specified)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td> the actual pixel data.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <code class="literal">TRUE</code> if the subregion upload was successful, otherwise <code class="literal">FALSE</code>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-ref"></a><h3>cogl_texture_ref ()</h3>
<pre class="programlisting"><a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> cogl_texture_ref (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);</pre>
<p>
Increment the reference count for a cogl texture.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <em class="parameter"><code>CoglHandle</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the <em class="parameter"><code>handle</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-unref"></a><h3>cogl_texture_unref ()</h3>
<pre class="programlisting">void cogl_texture_unref (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle);</pre>
<p>
Deccrement the reference count for a cogl texture.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <em class="parameter"><code>CoglHandle</code></em>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-rectangle"></a><h3>cogl_texture_rectangle ()</h3>
<pre class="programlisting">void cogl_texture_rectangle (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> x1,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> y1,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> x2,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> y2,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> tx1,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> ty1,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> tx2,
<a
href="../clutter/clutter-Fixed-Point-Support.html#ClutterFixed"
>ClutterFixed</a> ty2);</pre>
<p>
Draw a rectangle from a texture to the display, to draw the entire
texture pass in <em class="parameter"><code>tx1</code></em>=0.0 <em class="parameter"><code>ty1</code></em>=0.0 <em class="parameter"><code>tx2</code></em>=1.0 <em class="parameter"><code>ty2</code></em>=1.0.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> a <em class="parameter"><code>CoglHandle</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x1</code></em> :</span></p></td>
<td> x coordinate upper left on screen.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y1</code></em> :</span></p></td>
<td> y coordinate upper left on screen.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x2</code></em> :</span></p></td>
<td> x coordinate lower right on screen.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y2</code></em> :</span></p></td>
<td> y coordinate lower right on screen.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>tx1</code></em> :</span></p></td>
<td> x part of texture coordinate to use for upper left pixel
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ty1</code></em> :</span></p></td>
<td> y part of texture coordinate to use for upper left pixel
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>tx2</code></em> :</span></p></td>
<td> x part of texture coordinate to use for lower right pixel
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ty2</code></em> :</span></p></td>
<td> y part of texture coordinate to use for left pixel
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cogl-texture-polygon"></a><h3>cogl_texture_polygon ()</h3>
<pre class="programlisting">void cogl_texture_polygon (<a class="link" href="cogl-Utility-API.html#CoglHandle" title="CoglHandle">CoglHandle</a> handle,
guint n_vertices,
<a class="link" href="cogl-Textures.html#CoglTextureVertex" title="CoglTextureVertex">CoglTextureVertex</a> *vertices,
gboolean use_color);</pre>
<p>
Draws a polygon from a texture with the given model and texture
coordinates. This can be used to draw arbitrary shapes textured
with a COGL texture. If <em class="parameter"><code>use_color</code></em> is <code class="literal">TRUE</code> then the current COGL
color will be changed for each vertex using the value specified in
the color member of <a class="link" href="cogl-Textures.html#CoglTextureVertex" title="CoglTextureVertex"><span class="type">CoglTextureVertex</span></a>. This can be used for
example to make the texture fade out by setting the alpha value of
the color.
</p>
<p>
All of the texture coordinates must be in the range [0,1] and
repeating the texture is not supported.
</p>
<p>
Because of the way this function is implemented it will currently
only work if either the texture is not sliced or the backend is not
OpenGL ES and the minifying and magnifying functions are both set
to CGL_NEAREST.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> A CoglHandle for a texture
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n_vertices</code></em> :</span></p></td>
<td> The length of the vertices array
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>vertices</code></em> :</span></p></td>
<td> An array of <a class="link" href="cogl-Textures.html#CoglTextureVertex" title="CoglTextureVertex"><span class="type">CoglTextureVertex</span></a> structs
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>use_color</code></em> :</span></p></td>
<td> <code class="literal">TRUE</code> if the color member of <a class="link" href="cogl-Textures.html#CoglTextureVertex" title="CoglTextureVertex"><span class="type">CoglTextureVertex</span></a> should be used
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.10</div>
</body>
</html>
|