/usr/share/gtk-doc/html/cogl-2.0-experimental/cogl-2.0-experimental-Matrix-Stacks.html is in libcogl-doc 1.22.2-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Matrix Stacks: Cogl 2.0 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="Cogl 2.0 Reference Manual">
<link rel="up" href="cogl-utilities.html" title="Utilities">
<link rel="prev" href="cogl-2.0-experimental-Matrices.html" title="Matrices">
<link rel="next" href="cogl-2.0-experimental-3-Component-Vectors.html" title="3 Component Vectors">
<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#cogl-2.0-experimental-Matrix-Stacks.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="cogl-utilities.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="cogl-2.0-experimental-Matrices.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="cogl-2.0-experimental-3-Component-Vectors.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="cogl-2.0-experimental-Matrix-Stacks"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="cogl-2.0-experimental-Matrix-Stacks.top_of_page"></a>Matrix Stacks</span></h2>
<p>Matrix Stacks — Functions for efficiently tracking many
related transformations</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="cogl-2.0-experimental-Matrix-Stacks.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="returnvalue">CoglMatrixStack</span></a> *
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-new" title="cogl_matrix_stack_new ()">cogl_matrix_stack_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-push" title="cogl_matrix_stack_push ()">cogl_matrix_stack_push</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-pop" title="cogl_matrix_stack_pop ()">cogl_matrix_stack_pop</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-load-identity" title="cogl_matrix_stack_load_identity ()">cogl_matrix_stack_load_identity</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-scale" title="cogl_matrix_stack_scale ()">cogl_matrix_stack_scale</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-translate" title="cogl_matrix_stack_translate ()">cogl_matrix_stack_translate</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-rotate" title="cogl_matrix_stack_rotate ()">cogl_matrix_stack_rotate</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-rotate-quaternion" title="cogl_matrix_stack_rotate_quaternion ()">cogl_matrix_stack_rotate_quaternion</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-rotate-euler" title="cogl_matrix_stack_rotate_euler ()">cogl_matrix_stack_rotate_euler</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-multiply" title="cogl_matrix_stack_multiply ()">cogl_matrix_stack_multiply</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-frustum" title="cogl_matrix_stack_frustum ()">cogl_matrix_stack_frustum</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-perspective" title="cogl_matrix_stack_perspective ()">cogl_matrix_stack_perspective</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-orthographic" title="cogl_matrix_stack_orthographic ()">cogl_matrix_stack_orthographic</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglBool" title="CoglBool"><span class="returnvalue">CoglBool</span></a>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-get-inverse" title="cogl_matrix_stack_get_inverse ()">cogl_matrix_stack_get_inverse</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="returnvalue">CoglMatrixEntry</span></a> *
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-get-entry" title="cogl_matrix_stack_get_entry ()">cogl_matrix_stack_get_entry</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-get" title="cogl_matrix_stack_get ()">cogl_matrix_stack_get</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-entry-get" title="cogl_matrix_entry_get ()">cogl_matrix_entry_get</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-set" title="cogl_matrix_stack_set ()">cogl_matrix_stack_set</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglBool" title="CoglBool"><span class="returnvalue">CoglBool</span></a>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-entry-calculate-translation" title="cogl_matrix_entry_calculate_translation ()">cogl_matrix_entry_calculate_translation</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglBool" title="CoglBool"><span class="returnvalue">CoglBool</span></a>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-entry-is-identity" title="cogl_matrix_entry_is_identity ()">cogl_matrix_entry_is_identity</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglBool" title="CoglBool"><span class="returnvalue">CoglBool</span></a>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-entry-equal" title="cogl_matrix_entry_equal ()">cogl_matrix_entry_equal</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="returnvalue">CoglMatrixEntry</span></a> *
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-entry-ref" title="cogl_matrix_entry_ref ()">cogl_matrix_entry_ref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-entry-unref" title="cogl_matrix_entry_unref ()">cogl_matrix_entry_unref</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="cogl-2.0-experimental-Matrix-Stacks.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack">CoglMatrixStack</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry">CoglMatrixEntry</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="cogl-2.0-experimental-Matrix-Stacks.description"></a><h2>Description</h2>
<p>Matrices can be used (for example) to describe the model-view
transforms of objects, texture transforms, and projective
transforms.</p>
<p>The <a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> api provides a good way to manipulate individual
matrices representing a single transformation but if you need to
track many-many such transformations for many objects that are
organized in a scenegraph for example then using a separate
<a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> for each object may not be the most efficient way.</p>
<p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> enables applications to track lots of
transformations that are related to each other in some kind of
hierarchy. In a scenegraph for example if you want to know how to
transform a particular node then you usually have to walk up
through the ancestors and accumulate their transforms before
finally applying the transform of the node itself. In this model
things are grouped together spatially according to their ancestry
and all siblings with the same parent share the same initial
transformation. The <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> API is suited to tracking lots
of transformations that fit this kind of model.</p>
<p>Compared to using the <a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> api directly to track many
related transforms, these can be some advantages to using a
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a>:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">Faster equality comparisons of transformations</li>
<li class="listitem">Efficient comparisons of the differences between arbitrary
transformations</li>
<li class="listitem">Avoid redundant arithmetic related to common transforms
</li>
<li class="listitem">Can be more space efficient (not always though)</li>
</ul></div>
<p>For reference (to give an idea of when a <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> can
provide a space saving) a <a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> can be expected to take 72
bytes whereas a single <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> in a <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> is
currently around 32 bytes on a 32bit CPU or 36 bytes on a 64bit
CPU. An entry is needed for each individual operation applied to
the stack (such as rotate, scale, translate) so if most of your
leaf node transformations only need one or two simple operations
relative to their parent then a matrix stack will likely take less
space than having a <a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> for each node.</p>
<p>Even without any space saving though the ability to perform fast
comparisons and avoid redundant arithmetic (especially sine and
cosine calculations for rotations) can make using a matrix stack
worthwhile.</p>
</div>
<div class="refsect1">
<a name="cogl-2.0-experimental-Matrix-Stacks.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="cogl-matrix-stack-new"></a><h3>cogl_matrix_stack_new ()</h3>
<pre class="programlisting"><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="returnvalue">CoglMatrixStack</span></a> *
cogl_matrix_stack_new (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglContext" title="CoglContext"><span class="type">CoglContext</span></a> *ctx</code></em>);</pre>
<p>Allocates a new <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> that can be used to build up
transformations relating to objects in a scenegraph like hierarchy.
(See the description of <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> and <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> for
more details of what a matrix stack is best suited for)</p>
<p>When a <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> is first allocated it is conceptually
positioned at the root of your scenegraph hierarchy. As you
traverse your scenegraph then you should call
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-push" title="cogl_matrix_stack_push ()"><code class="function">cogl_matrix_stack_push()</code></a> whenever you move down a level and
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-pop" title="cogl_matrix_stack_pop ()"><code class="function">cogl_matrix_stack_pop()</code></a> whenever you move back up a level towards
the root.</p>
<p>Once you have allocated a <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> you can get a reference
to the current transformation for the current position in the
hierarchy by calling <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-get-entry" title="cogl_matrix_stack_get_entry ()"><code class="function">cogl_matrix_stack_get_entry()</code></a>.</p>
<p>Once you have allocated a <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> you can apply operations
such as rotate, scale and translate to modify the current transform
for the current position in the hierarchy by calling
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-rotate" title="cogl_matrix_stack_rotate ()"><code class="function">cogl_matrix_stack_rotate()</code></a>, <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-scale" title="cogl_matrix_stack_scale ()"><code class="function">cogl_matrix_stack_scale()</code></a> and
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-translate" title="cogl_matrix_stack_translate ()"><code class="function">cogl_matrix_stack_translate()</code></a>.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>ctx</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglContext" title="CoglContext"><span class="type">CoglContext</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="cogl-matrix-stack-new.returns"></a><h4>Returns</h4>
<p> A newly allocated <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a>. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-push"></a><h3>cogl_matrix_stack_push ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_stack_push (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>);</pre>
<p>Saves the current transform and starts a new transform that derives
from the current transform.</p>
<p>This is usually called while traversing a scenegraph whenever you
traverse one level deeper. <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-pop" title="cogl_matrix_stack_pop ()"><code class="function">cogl_matrix_stack_pop()</code></a> can then be
called when going back up one layer to restore the previous
transform of an ancestor.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-push.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-pop"></a><h3>cogl_matrix_stack_pop ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_stack_pop (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>);</pre>
<p>Restores the previous transform that was last saved by calling
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-push" title="cogl_matrix_stack_push ()"><code class="function">cogl_matrix_stack_push()</code></a>.</p>
<p>This is usually called while traversing a scenegraph whenever you
return up one level in the graph towards the root node.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-pop.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-load-identity"></a><h3>cogl_matrix_stack_load_identity ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_stack_load_identity (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>);</pre>
<p>Resets the current matrix to the identity matrix.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-load-identity.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-scale"></a><h3>cogl_matrix_stack_scale ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_stack_scale (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>,
<em class="parameter"><code><span class="type">float</span> x</code></em>,
<em class="parameter"><code><span class="type">float</span> y</code></em>,
<em class="parameter"><code><span class="type">float</span> z</code></em>);</pre>
<p>Multiplies the current matrix by one that scales the x, y and z
axes by the given values.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-scale.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>Amount to scale along the x-axis</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y</p></td>
<td class="parameter_description"><p>Amount to scale along the y-axis</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>z</p></td>
<td class="parameter_description"><p>Amount to scale along the z-axis</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-translate"></a><h3>cogl_matrix_stack_translate ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_stack_translate (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>,
<em class="parameter"><code><span class="type">float</span> x</code></em>,
<em class="parameter"><code><span class="type">float</span> y</code></em>,
<em class="parameter"><code><span class="type">float</span> z</code></em>);</pre>
<p>Multiplies the current matrix by one that translates along all
three axes according to the given values.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-translate.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>Distance to translate along the x-axis</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y</p></td>
<td class="parameter_description"><p>Distance to translate along the y-axis</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>z</p></td>
<td class="parameter_description"><p>Distance to translate along the z-axis</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-rotate"></a><h3>cogl_matrix_stack_rotate ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_stack_rotate (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>,
<em class="parameter"><code><span class="type">float</span> angle</code></em>,
<em class="parameter"><code><span class="type">float</span> x</code></em>,
<em class="parameter"><code><span class="type">float</span> y</code></em>,
<em class="parameter"><code><span class="type">float</span> z</code></em>);</pre>
<p>Multiplies the current matrix by one that rotates the around the
axis-vector specified by <em class="parameter"><code>x</code></em>
, <em class="parameter"><code>y</code></em>
and <em class="parameter"><code>z</code></em>
. The rotation follows the
right-hand thumb rule so for example rotating by 10 degrees about
the axis-vector (0, 0, 1) causes a small counter-clockwise
rotation.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-rotate.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>angle</p></td>
<td class="parameter_description"><p>Angle in degrees to rotate.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>X-component of vertex to rotate around.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y</p></td>
<td class="parameter_description"><p>Y-component of vertex to rotate around.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>z</p></td>
<td class="parameter_description"><p>Z-component of vertex to rotate around.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-rotate-quaternion"></a><h3>cogl_matrix_stack_rotate_quaternion ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_stack_rotate_quaternion (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>,
<em class="parameter"><code>const <a class="link" href="cogl-2.0-experimental-Quaternions-(Rotations).html#CoglQuaternion" title="CoglQuaternion"><span class="type">CoglQuaternion</span></a> *quaternion</code></em>);</pre>
<p>Multiplies the current matrix by one that rotates according to the
rotation described by <em class="parameter"><code>quaternion</code></em>
.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-rotate-quaternion.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>quaternion</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Quaternions-(Rotations).html#CoglQuaternion" title="CoglQuaternion"><span class="type">CoglQuaternion</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-rotate-euler"></a><h3>cogl_matrix_stack_rotate_euler ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_stack_rotate_euler (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>,
<em class="parameter"><code>const <a class="link" href="cogl-2.0-experimental-Eulers-(Rotations).html#CoglEuler" title="CoglEuler"><span class="type">CoglEuler</span></a> *euler</code></em>);</pre>
<p>Multiplies the current matrix by one that rotates according to the
rotation described by <em class="parameter"><code>euler</code></em>
.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-rotate-euler.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>euler</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Eulers-(Rotations).html#CoglEuler" title="CoglEuler"><span class="type">CoglEuler</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-multiply"></a><h3>cogl_matrix_stack_multiply ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_stack_multiply (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>,
<em class="parameter"><code>const <a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> *matrix</code></em>);</pre>
<p>Multiplies the current matrix by the given matrix.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-multiply.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>matrix</p></td>
<td class="parameter_description"><p>the matrix to multiply with the current model-view</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-frustum"></a><h3>cogl_matrix_stack_frustum ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_stack_frustum (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>,
<em class="parameter"><code><span class="type">float</span> left</code></em>,
<em class="parameter"><code><span class="type">float</span> right</code></em>,
<em class="parameter"><code><span class="type">float</span> bottom</code></em>,
<em class="parameter"><code><span class="type">float</span> top</code></em>,
<em class="parameter"><code><span class="type">float</span> z_near</code></em>,
<em class="parameter"><code><span class="type">float</span> z_far</code></em>);</pre>
<p>Replaces the current matrix with a perspective matrix for a given
viewing frustum defined by 4 side clip planes that all cross
through the origin and 2 near and far clip planes.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-frustum.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>left</p></td>
<td class="parameter_description"><p>X position of the left clipping plane where it
intersects the near clipping plane</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>right</p></td>
<td class="parameter_description"><p>X position of the right clipping plane where it
intersects the near clipping plane</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>bottom</p></td>
<td class="parameter_description"><p>Y position of the bottom clipping plane where it
intersects the near clipping plane</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>top</p></td>
<td class="parameter_description"><p>Y position of the top clipping plane where it intersects
the near clipping plane</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>z_near</p></td>
<td class="parameter_description"><p>The distance to the near clipping plane (Must be positive)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>z_far</p></td>
<td class="parameter_description"><p>The distance to the far clipping plane (Must be positive)</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-perspective"></a><h3>cogl_matrix_stack_perspective ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_stack_perspective (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>,
<em class="parameter"><code><span class="type">float</span> fov_y</code></em>,
<em class="parameter"><code><span class="type">float</span> aspect</code></em>,
<em class="parameter"><code><span class="type">float</span> z_near</code></em>,
<em class="parameter"><code><span class="type">float</span> z_far</code></em>);</pre>
<p>Replaces the current matrix with a perspective matrix based on the
provided values.</p>
<div class="note">You should be careful not to have too great a <em class="parameter"><code>z_far</code></em> / <em class="parameter"><code>z_near</code></em>
ratio since that will reduce the effectiveness of depth testing
since there wont be enough precision to identify the depth of
objects near to each other.</div>
<div class="refsect3">
<a name="cogl-matrix-stack-perspective.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>fov_y</p></td>
<td class="parameter_description"><p>Vertical field of view angle in degrees.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>aspect</p></td>
<td class="parameter_description"><p>The (width over height) aspect ratio for display</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>z_near</p></td>
<td class="parameter_description"><p>The distance to the near clipping plane (Must be positive,
and must not be 0)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>z_far</p></td>
<td class="parameter_description"><p>The distance to the far clipping plane (Must be positive)</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-orthographic"></a><h3>cogl_matrix_stack_orthographic ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_stack_orthographic (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>,
<em class="parameter"><code><span class="type">float</span> x_1</code></em>,
<em class="parameter"><code><span class="type">float</span> y_1</code></em>,
<em class="parameter"><code><span class="type">float</span> x_2</code></em>,
<em class="parameter"><code><span class="type">float</span> y_2</code></em>,
<em class="parameter"><code><span class="type">float</span> near</code></em>,
<em class="parameter"><code><span class="type">float</span> far</code></em>);</pre>
<p>Replaces the current matrix with an orthographic projection matrix.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-orthographic.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x_1</p></td>
<td class="parameter_description"><p>The x coordinate for the first vertical clipping plane</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y_1</p></td>
<td class="parameter_description"><p>The y coordinate for the first horizontal clipping plane</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x_2</p></td>
<td class="parameter_description"><p>The x coordinate for the second vertical clipping plane</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y_2</p></td>
<td class="parameter_description"><p>The y coordinate for the second horizontal clipping plane</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>near</p></td>
<td class="parameter_description"><p>The <span class="emphasis"><em>distance</em></span> to the near clipping
plane (will be <span class="emphasis"><em>negative</em></span> if the plane is
behind the viewer)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>far</p></td>
<td class="parameter_description"><p>The <span class="emphasis"><em>distance</em></span> to the far clipping
plane (will be <span class="emphasis"><em>negative</em></span> if the plane is
behind the viewer)</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-get-inverse"></a><h3>cogl_matrix_stack_get_inverse ()</h3>
<pre class="programlisting"><a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglBool" title="CoglBool"><span class="returnvalue">CoglBool</span></a>
cogl_matrix_stack_get_inverse (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>,
<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> *inverse</code></em>);</pre>
<p>Gets the inverse transform of the current matrix and uses it to
initialize a new <a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a>.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-get-inverse.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inverse</p></td>
<td class="parameter_description"><p> The destination for a 4x4 inverse transformation matrix. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="cogl-matrix-stack-get-inverse.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the inverse was successfully calculated or <code class="literal">FALSE</code>
for degenerate transformations that can't be inverted (in this case the
<em class="parameter"><code>inverse</code></em>
matrix will simply be initialized with the identity matrix)</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-get-entry"></a><h3>cogl_matrix_stack_get_entry ()</h3>
<pre class="programlisting"><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="returnvalue">CoglMatrixEntry</span></a> *
cogl_matrix_stack_get_entry (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>);</pre>
<p>Gets a reference to the current transform represented by a
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> pointer.</p>
<div class="note">The transform represented by a <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> is
immutable.</div>
<div class="note">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a>s are reference counted using
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-entry-ref" title="cogl_matrix_entry_ref ()"><code class="function">cogl_matrix_entry_ref()</code></a> and <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-entry-unref" title="cogl_matrix_entry_unref ()"><code class="function">cogl_matrix_entry_unref()</code></a> and you
should call <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-entry-unref" title="cogl_matrix_entry_unref ()"><code class="function">cogl_matrix_entry_unref()</code></a> when you are finished with
and entry you get via <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-get-entry" title="cogl_matrix_stack_get_entry ()"><code class="function">cogl_matrix_stack_get_entry()</code></a>.</div>
<div class="refsect3">
<a name="cogl-matrix-stack-get-entry.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="cogl-matrix-stack-get-entry.returns"></a><h4>Returns</h4>
<p> A pointer to the <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a>
representing the current matrix stack transform. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-get"></a><h3>cogl_matrix_stack_get ()</h3>
<pre class="programlisting"><a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *
cogl_matrix_stack_get (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>,
<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> *matrix</code></em>);</pre>
<p>Resolves the current <em class="parameter"><code>stack</code></em>
transform into a <a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> by
combining the operations that have been applied to build up the
current transform.</p>
<p>There are two possible ways that this function may return its
result depending on whether the stack is able to directly point
to an internal <a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> or whether the result needs to be
composed of multiple operations.</p>
<p>If an internal matrix contains the required result then this
function will directly return a pointer to that matrix, otherwise
if the function returns <code class="literal">NULL</code> then <em class="parameter"><code>matrix</code></em>
will be initialized
to match the current transform of <em class="parameter"><code>stack</code></em>
.</p>
<div class="note">
<em class="parameter"><code>matrix</code></em> will be left untouched if a direct pointer is
returned.</div>
<div class="refsect3">
<a name="cogl-matrix-stack-get.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>matrix</p></td>
<td class="parameter_description"><p> The potential destination for the current matrix. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="cogl-matrix-stack-get.returns"></a><h4>Returns</h4>
<p> A direct pointer to the current transform or <code class="literal">NULL</code>
and in that case <em class="parameter"><code>matrix</code></em>
will be initialized with
the value of the current transform.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-entry-get"></a><h3>cogl_matrix_entry_get ()</h3>
<pre class="programlisting"><a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *
cogl_matrix_entry_get (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> *entry</code></em>,
<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> *matrix</code></em>);</pre>
<p>Resolves the current <em class="parameter"><code>entry</code></em>
transform into a <a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> by
combining the sequence of operations that have been applied to
build up the current transform.</p>
<p>There are two possible ways that this function may return its
result depending on whether it's possible to directly point
to an internal <a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> or whether the result needs to be
composed of multiple operations.</p>
<p>If an internal matrix contains the required result then this
function will directly return a pointer to that matrix, otherwise
if the function returns <code class="literal">NULL</code> then <em class="parameter"><code>matrix</code></em>
will be initialized
to match the transform of <em class="parameter"><code>entry</code></em>
.</p>
<div class="note">
<em class="parameter"><code>matrix</code></em> will be left untouched if a direct pointer is
returned.</div>
<div class="refsect3">
<a name="cogl-matrix-entry-get.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>entry</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>matrix</p></td>
<td class="parameter_description"><p> The potential destination for the transform as
a matrix. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="cogl-matrix-entry-get.returns"></a><h4>Returns</h4>
<p> A direct pointer to a <a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> transform or <code class="literal">NULL</code>
and in that case <em class="parameter"><code>matrix</code></em>
will be initialized with
the effective transform represented by <em class="parameter"><code>entry</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-stack-set"></a><h3>cogl_matrix_stack_set ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_stack_set (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> *stack</code></em>,
<em class="parameter"><code>const <a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> *matrix</code></em>);</pre>
<p>Replaces the current <em class="parameter"><code>stack</code></em>
matrix value with the value of <em class="parameter"><code>matrix</code></em>
.
This effectively discards any other operations that were applied
since the last time <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-push" title="cogl_matrix_stack_push ()"><code class="function">cogl_matrix_stack_push()</code></a> was called or since
the stack was initialized.</p>
<div class="refsect3">
<a name="cogl-matrix-stack-set.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stack</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>matrix</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> replace the current matrix value with</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-entry-calculate-translation"></a><h3>cogl_matrix_entry_calculate_translation ()</h3>
<pre class="programlisting"><a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglBool" title="CoglBool"><span class="returnvalue">CoglBool</span></a>
cogl_matrix_entry_calculate_translation
(<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> *entry0</code></em>,
<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> *entry1</code></em>,
<em class="parameter"><code><span class="type">float</span> *x</code></em>,
<em class="parameter"><code><span class="type">float</span> *y</code></em>,
<em class="parameter"><code><span class="type">float</span> *z</code></em>);</pre>
<p>Determines if the only difference between two transforms is a
translation and if so returns what the <em class="parameter"><code>x</code></em>
, <em class="parameter"><code>y</code></em>
, and <em class="parameter"><code>z</code></em>
components of
the translation are.</p>
<p>If the difference between the two translations involves anything
other than a translation then the function returns <code class="literal">FALSE</code>.</p>
<div class="refsect3">
<a name="cogl-matrix-entry-calculate-translation.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>entry0</p></td>
<td class="parameter_description"><p>The first reference transform</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>entry1</p></td>
<td class="parameter_description"><p>A second reference transform</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p> The destination for the x-component of the translation. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>y</p></td>
<td class="parameter_description"><p> The destination for the y-component of the translation. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>z</p></td>
<td class="parameter_description"><p> The destination for the z-component of the translation. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="cogl-matrix-entry-calculate-translation.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the only difference between the transform of
<em class="parameter"><code>entry0</code></em>
and the transform of <em class="parameter"><code>entry1</code></em>
is a translation,
otherwise <code class="literal">FALSE</code>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-entry-is-identity"></a><h3>cogl_matrix_entry_is_identity ()</h3>
<pre class="programlisting"><a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglBool" title="CoglBool"><span class="returnvalue">CoglBool</span></a>
cogl_matrix_entry_is_identity (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> *entry</code></em>);</pre>
<p>Determines whether <em class="parameter"><code>entry</code></em>
is known to represent an identity
transform.</p>
<p>If this returns <code class="literal">TRUE</code> then the entry is definitely the identity
matrix. If it returns <code class="literal">FALSE</code> it may or may not be the identity
matrix but no expensive comparison is performed to verify it.</p>
<div class="refsect3">
<a name="cogl-matrix-entry-is-identity.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>entry</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="cogl-matrix-entry-is-identity.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if <em class="parameter"><code>entry</code></em>
is definitely an identity transform,
otherwise <code class="literal">FALSE</code>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-entry-equal"></a><h3>cogl_matrix_entry_equal ()</h3>
<pre class="programlisting"><a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglBool" title="CoglBool"><span class="returnvalue">CoglBool</span></a>
cogl_matrix_entry_equal (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> *entry0</code></em>,
<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> *entry1</code></em>);</pre>
<p>Compares two arbitrary <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> transforms for equality
returning <code class="literal">TRUE</code> if they are equal or <code class="literal">FALSE</code> otherwise.</p>
<div class="note">In many cases it is unnecessary to use this api and instead
direct pointer comparisons of entries are good enough and much
cheaper too.</div>
<div class="refsect3">
<a name="cogl-matrix-entry-equal.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>entry0</p></td>
<td class="parameter_description"><p>The first <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> to compare</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>entry1</p></td>
<td class="parameter_description"><p>A second <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> to compare</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="cogl-matrix-entry-equal.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if <em class="parameter"><code>entry0</code></em>
represents the same transform as
<em class="parameter"><code>entry1</code></em>
, otherwise <code class="literal">FALSE</code>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-entry-ref"></a><h3>cogl_matrix_entry_ref ()</h3>
<pre class="programlisting"><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="returnvalue">CoglMatrixEntry</span></a> *
cogl_matrix_entry_ref (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> *entry</code></em>);</pre>
<p>Takes a reference on the given <em class="parameter"><code>entry</code></em>
to ensure the <em class="parameter"><code>entry</code></em>
stays
alive and remains valid. When you are finished with the <em class="parameter"><code>entry</code></em>
then
you should call <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-entry-unref" title="cogl_matrix_entry_unref ()"><code class="function">cogl_matrix_entry_unref()</code></a>.</p>
<p>It is an error to pass an <em class="parameter"><code>entry</code></em>
pointer to <a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#cogl-object-ref" title="cogl_object_ref ()"><code class="function">cogl_object_ref()</code></a> and
<a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#cogl-object-unref" title="cogl_object_unref ()"><code class="function">cogl_object_unref()</code></a></p>
<div class="refsect3">
<a name="cogl-matrix-entry-ref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>entry</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-matrix-entry-unref"></a><h3>cogl_matrix_entry_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_matrix_entry_unref (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> *entry</code></em>);</pre>
<p>Releases a reference on <em class="parameter"><code>entry</code></em>
either taken by calling
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-entry-unref" title="cogl_matrix_entry_unref ()"><code class="function">cogl_matrix_entry_unref()</code></a> or to release the reference given when
calling <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-get-entry" title="cogl_matrix_stack_get_entry ()"><code class="function">cogl_matrix_stack_get_entry()</code></a>.</p>
<div class="refsect3">
<a name="cogl-matrix-entry-unref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>entry</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="cogl-2.0-experimental-Matrix-Stacks.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="CoglMatrixStack"></a><h3>CoglMatrixStack</h3>
<pre class="programlisting">typedef struct _CoglMatrixStack CoglMatrixStack;</pre>
<p>Tracks your current position within a hierarchy and lets you build
up a graph of transformations as you traverse through a hierarchy
such as a scenegraph.</p>
<p>A <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> always maintains a reference to a single
transformation at any point in time, representing the
transformation at the current position in the hierarchy. You can
get a reference to the current transformation by calling
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-get-entry" title="cogl_matrix_stack_get_entry ()"><code class="function">cogl_matrix_stack_get_entry()</code></a>.</p>
<p>When a <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> is first created with
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-new" title="cogl_matrix_stack_new ()"><code class="function">cogl_matrix_stack_new()</code></a> then it is conceptually positioned at the
root of your hierarchy and the current transformation simply
represents an identity transformation.</p>
<p>As you traverse your object hierarchy (your scenegraph) then you
should call <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-push" title="cogl_matrix_stack_push ()"><code class="function">cogl_matrix_stack_push()</code></a> whenever you move down one
level and call <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-pop" title="cogl_matrix_stack_pop ()"><code class="function">cogl_matrix_stack_pop()</code></a> whenever you move back up
one level towards the root.</p>
<p>At any time you can apply a set of operations, such as "rotate",
"scale", "translate" on top of the current transformation of a
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> using functions such as
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-rotate" title="cogl_matrix_stack_rotate ()"><code class="function">cogl_matrix_stack_rotate()</code></a>, <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-scale" title="cogl_matrix_stack_scale ()"><code class="function">cogl_matrix_stack_scale()</code></a> and
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-translate" title="cogl_matrix_stack_translate ()"><code class="function">cogl_matrix_stack_translate()</code></a>. These operations will derive a new
current transformation and will never affect a transformation
that you have referenced using <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-get-entry" title="cogl_matrix_stack_get_entry ()"><code class="function">cogl_matrix_stack_get_entry()</code></a>.</p>
<p>Internally applying operations to a <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> builds up a
graph of <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> structures which each represent a single
immutable transform.</p>
</div>
<hr>
<div class="refsect2">
<a name="CoglMatrixEntry"></a><h3>CoglMatrixEntry</h3>
<pre class="programlisting">typedef struct _CoglMatrixEntry CoglMatrixEntry;</pre>
<p>Represents a single immutable transformation that was retrieved
from a <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> using <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-stack-get-entry" title="cogl_matrix_stack_get_entry ()"><code class="function">cogl_matrix_stack_get_entry()</code></a>.</p>
<p>Internally a <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> represents a single matrix
operation (such as "rotate", "scale", "translate") which is applied
to the transform of a single parent entry.</p>
<p>Using the <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> api effectively builds up a graph of
these immutable <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> structures whereby operations
that can be shared between multiple transformations will result
in shared <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> nodes in the graph.</p>
<p>When a <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> is first created it references one
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> that represents a single "load identity"
operation. This serves as the root entry and all operations
that are then applied to the stack will extend the graph
starting from this root "load identity" entry.</p>
<p>Given the typical usage model for a <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixStack" title="CoglMatrixStack"><span class="type">CoglMatrixStack</span></a> and the way
the entries are built up while traversing a scenegraph then in most
cases where an application is interested in comparing two
transformations for equality then it is enough to simply compare
two <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a> pointers directly. Technically this can lead
to false negatives that could be identified with a deeper
comparison but often these false negatives are unlikely and
don't matter anyway so this enables extremely cheap comparisons.</p>
<div class="note">
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#CoglMatrixEntry" title="CoglMatrixEntry"><span class="type">CoglMatrixEntry</span></a>s are reference counted using
<a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-entry-ref" title="cogl_matrix_entry_ref ()"><code class="function">cogl_matrix_entry_ref()</code></a> and <a class="link" href="cogl-2.0-experimental-Matrix-Stacks.html#cogl-matrix-entry-unref" title="cogl_matrix_entry_unref ()"><code class="function">cogl_matrix_entry_unref()</code></a> not with
<a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#cogl-object-ref" title="cogl_object_ref ()"><code class="function">cogl_object_ref()</code></a> and <a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#cogl-object-unref" title="cogl_object_unref ()"><code class="function">cogl_object_unref()</code></a>.</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25</div>
</body>
</html>
|