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
|
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="cogl-General-API">
<refmeta>
<refentrytitle role="top_of_page" id="cogl-General-API.top_of_page">General API</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>COGL Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>General API</refname>
<refpurpose>General purpose API</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>
<refsynopsisdiv id="cogl-General-API.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>
<synopsis>
#define <link linkend="COGL-PIXEL-FORMAT-24:CAPS">COGL_PIXEL_FORMAT_24</link>
#define <link linkend="COGL-PIXEL-FORMAT-32:CAPS">COGL_PIXEL_FORMAT_32</link>
#define <link linkend="COGL-A-BIT:CAPS">COGL_A_BIT</link>
#define <link linkend="COGL-BGR-BIT:CAPS">COGL_BGR_BIT</link>
#define <link linkend="COGL-AFIRST-BIT:CAPS">COGL_AFIRST_BIT</link>
#define <link linkend="COGL-PREMULT-BIT:CAPS">COGL_PREMULT_BIT</link>
#define <link linkend="COGL-UNORDERED-MASK:CAPS">COGL_UNORDERED_MASK</link>
#define <link linkend="COGL-UNPREMULT-MASK:CAPS">COGL_UNPREMULT_MASK</link>
enum <link linkend="CoglPixelFormat">CoglPixelFormat</link>;
enum <link linkend="CoglBufferTarget">CoglBufferTarget</link>;
<link linkend="void">void</link> <link linkend="cogl-perspective">cogl_perspective</link> (<link linkend="ClutterFixed">ClutterFixed</link> fovy,
<link linkend="ClutterFixed">ClutterFixed</link> aspect,
<link linkend="ClutterFixed">ClutterFixed</link> z_near,
<link linkend="ClutterFixed">ClutterFixed</link> z_far);
<link linkend="void">void</link> <link linkend="cogl-setup-viewport">cogl_setup_viewport</link> (<link linkend="guint">guint</link> width,
<link linkend="guint">guint</link> height,
<link linkend="ClutterFixed">ClutterFixed</link> fovy,
<link linkend="ClutterFixed">ClutterFixed</link> aspect,
<link linkend="ClutterFixed">ClutterFixed</link> z_near,
<link linkend="ClutterFixed">ClutterFixed</link> z_far);
<link linkend="void">void</link> <link linkend="cogl-get-modelview-matrix">cogl_get_modelview_matrix</link> (<link linkend="ClutterFixed">ClutterFixed</link> m[16]);
<link linkend="void">void</link> <link linkend="cogl-get-projection-matrix">cogl_get_projection_matrix</link> (<link linkend="ClutterFixed">ClutterFixed</link> m[16]);
<link linkend="void">void</link> <link linkend="cogl-get-viewport">cogl_get_viewport</link> (<link linkend="ClutterFixed">ClutterFixed</link> v[4]);
<link linkend="void">void</link> <link linkend="cogl-push-matrix">cogl_push_matrix</link> (void);
<link linkend="void">void</link> <link linkend="cogl-pop-matrix">cogl_pop_matrix</link> (void);
<link linkend="void">void</link> <link linkend="cogl-scale">cogl_scale</link> (<link linkend="ClutterFixed">ClutterFixed</link> x,
<link linkend="ClutterFixed">ClutterFixed</link> y);
<link linkend="void">void</link> <link linkend="cogl-translatex">cogl_translatex</link> (<link linkend="ClutterFixed">ClutterFixed</link> x,
<link linkend="ClutterFixed">ClutterFixed</link> y,
<link linkend="ClutterFixed">ClutterFixed</link> z);
<link linkend="void">void</link> <link linkend="cogl-translate">cogl_translate</link> (<link linkend="gint">gint</link> x,
<link linkend="gint">gint</link> y,
<link linkend="gint">gint</link> z);
<link linkend="void">void</link> <link linkend="cogl-rotatex">cogl_rotatex</link> (<link linkend="ClutterFixed">ClutterFixed</link> angle,
<link linkend="gint">gint</link> x,
<link linkend="gint">gint</link> y,
<link linkend="gint">gint</link> z);
<link linkend="void">void</link> <link linkend="cogl-rotate">cogl_rotate</link> (<link linkend="gint">gint</link> angle,
<link linkend="gint">gint</link> x,
<link linkend="gint">gint</link> y,
<link linkend="gint">gint</link> z);
<link linkend="void">void</link> <link linkend="cogl-clip-set">cogl_clip_set</link> (<link linkend="ClutterFixed">ClutterFixed</link> x_offset,
<link linkend="ClutterFixed">ClutterFixed</link> y_offset,
<link linkend="ClutterFixed">ClutterFixed</link> width,
<link linkend="ClutterFixed">ClutterFixed</link> height);
<link linkend="void">void</link> <link linkend="cogl-clip-unset">cogl_clip_unset</link> (void);
<link linkend="void">void</link> <link linkend="cogl-enable-depth-test">cogl_enable_depth_test</link> (<link linkend="gboolean">gboolean</link> setting);
<link linkend="void">void</link> <link linkend="cogl-alpha-func">cogl_alpha_func</link> (<link linkend="COGLenum">COGLenum</link> func,
<link linkend="ClutterFixed">ClutterFixed</link> ref);
<link linkend="void">void</link> <link linkend="cogl-fog-set">cogl_fog_set</link> (const <link linkend="ClutterColor">ClutterColor</link> *fog_color,
<link linkend="ClutterFixed">ClutterFixed</link> density,
<link linkend="ClutterFixed">ClutterFixed</link> z_near,
<link linkend="ClutterFixed">ClutterFixed</link> z_far);
</synopsis>
</refsynopsisdiv>
<refsect1 id="cogl-General-API.description" role="desc">
<title role="desc.title">Description</title>
<para>
General utility functions for COGL.</para>
<para>
</para>
</refsect1>
<refsect1 id="cogl-General-API.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="COGL-PIXEL-FORMAT-24:CAPS" role="macro">
<title>COGL_PIXEL_FORMAT_24</title>
<indexterm zone="COGL-PIXEL-FORMAT-24:CAPS"><primary>COGL_PIXEL_FORMAT_24</primary></indexterm><programlisting>#define COGL_PIXEL_FORMAT_24 2
</programlisting>
<para>
</para></refsect2>
<refsect2 id="COGL-PIXEL-FORMAT-32:CAPS" role="macro">
<title>COGL_PIXEL_FORMAT_32</title>
<indexterm zone="COGL-PIXEL-FORMAT-32:CAPS"><primary>COGL_PIXEL_FORMAT_32</primary></indexterm><programlisting>#define COGL_PIXEL_FORMAT_32 3
</programlisting>
<para>
</para></refsect2>
<refsect2 id="COGL-A-BIT:CAPS" role="macro">
<title>COGL_A_BIT</title>
<indexterm zone="COGL-A-BIT:CAPS"><primary>COGL_A_BIT</primary></indexterm><programlisting>#define COGL_A_BIT (1 << 4)
</programlisting>
<para>
</para></refsect2>
<refsect2 id="COGL-BGR-BIT:CAPS" role="macro">
<title>COGL_BGR_BIT</title>
<indexterm zone="COGL-BGR-BIT:CAPS"><primary>COGL_BGR_BIT</primary></indexterm><programlisting>#define COGL_BGR_BIT (1 << 5)
</programlisting>
<para>
</para></refsect2>
<refsect2 id="COGL-AFIRST-BIT:CAPS" role="macro">
<title>COGL_AFIRST_BIT</title>
<indexterm zone="COGL-AFIRST-BIT:CAPS"><primary>COGL_AFIRST_BIT</primary></indexterm><programlisting>#define COGL_AFIRST_BIT (1 << 6)
</programlisting>
<para>
</para></refsect2>
<refsect2 id="COGL-PREMULT-BIT:CAPS" role="macro">
<title>COGL_PREMULT_BIT</title>
<indexterm zone="COGL-PREMULT-BIT:CAPS"><primary>COGL_PREMULT_BIT</primary></indexterm><programlisting>#define COGL_PREMULT_BIT (1 << 7)
</programlisting>
<para>
</para></refsect2>
<refsect2 id="COGL-UNORDERED-MASK:CAPS" role="macro">
<title>COGL_UNORDERED_MASK</title>
<indexterm zone="COGL-UNORDERED-MASK:CAPS"><primary>COGL_UNORDERED_MASK</primary></indexterm><programlisting>#define COGL_UNORDERED_MASK 0x0F
</programlisting>
<para>
</para></refsect2>
<refsect2 id="COGL-UNPREMULT-MASK:CAPS" role="macro">
<title>COGL_UNPREMULT_MASK</title>
<indexterm zone="COGL-UNPREMULT-MASK:CAPS"><primary>COGL_UNPREMULT_MASK</primary></indexterm><programlisting>#define COGL_UNPREMULT_MASK 0x7F
</programlisting>
<para>
</para></refsect2>
<refsect2 id="CoglPixelFormat" role="enum">
<title>enum CoglPixelFormat</title>
<indexterm zone="CoglPixelFormat"><primary>CoglPixelFormat</primary></indexterm><programlisting>typedef enum
{
COGL_PIXEL_FORMAT_ANY = 0,
COGL_PIXEL_FORMAT_A_8 = 1 | COGL_A_BIT,
COGL_PIXEL_FORMAT_RGB_565 = 4,
COGL_PIXEL_FORMAT_RGBA_4444 = 5 | COGL_A_BIT,
COGL_PIXEL_FORMAT_RGBA_5551 = 6 | COGL_A_BIT,
COGL_PIXEL_FORMAT_YUV = 7,
COGL_PIXEL_FORMAT_G_8 = 8,
COGL_PIXEL_FORMAT_RGB_888 = COGL_PIXEL_FORMAT_24,
COGL_PIXEL_FORMAT_BGR_888 = (COGL_PIXEL_FORMAT_24 |
COGL_BGR_BIT),
COGL_PIXEL_FORMAT_RGBA_8888 = COGL_PIXEL_FORMAT_32 |
COGL_A_BIT,
COGL_PIXEL_FORMAT_BGRA_8888 = (COGL_PIXEL_FORMAT_32 |
COGL_A_BIT |
COGL_BGR_BIT),
COGL_PIXEL_FORMAT_ARGB_8888 = (COGL_PIXEL_FORMAT_32 |
COGL_A_BIT |
COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_ABGR_8888 = (COGL_PIXEL_FORMAT_32 |
COGL_A_BIT |
COGL_BGR_BIT |
COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_RGBA_8888_PRE = (COGL_PIXEL_FORMAT_32 |
COGL_A_BIT |
COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_BGRA_8888_PRE = (COGL_PIXEL_FORMAT_32 |
COGL_A_BIT |
COGL_PREMULT_BIT |
COGL_BGR_BIT),
COGL_PIXEL_FORMAT_ARGB_8888_PRE = (COGL_PIXEL_FORMAT_32 |
COGL_A_BIT |
COGL_PREMULT_BIT |
COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_ABGR_8888_PRE = (COGL_PIXEL_FORMAT_32 |
COGL_A_BIT |
COGL_PREMULT_BIT |
COGL_BGR_BIT |
COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_RGBA_4444_PRE = (COGL_PIXEL_FORMAT_RGBA_4444 |
COGL_A_BIT |
COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_RGBA_5551_PRE = (COGL_PIXEL_FORMAT_RGBA_5551 |
COGL_A_BIT |
COGL_PREMULT_BIT),
} CoglPixelFormat;
</programlisting>
<para>
Pixel formats used by COGL.</para>
<para>
</para></refsect2>
<refsect2 id="CoglBufferTarget" role="enum">
<title>enum CoglBufferTarget</title>
<indexterm zone="CoglBufferTarget"><primary>CoglBufferTarget</primary></indexterm><programlisting>typedef enum
{
COGL_WINDOW_BUFFER = (1 << 1),
COGL_MASK_BUFFER = (1 << 2),
COGL_OFFSCREEN_BUFFER = (1 << 3)
} CoglBufferTarget;
</programlisting>
<para>
</para>
<para>
</para></refsect2>
<refsect2 id="cogl-perspective" role="function">
<title>cogl_perspective ()</title>
<indexterm zone="cogl-perspective"><primary>cogl_perspective</primary></indexterm><programlisting><link linkend="void">void</link> cogl_perspective (<link linkend="ClutterFixed">ClutterFixed</link> fovy,
<link linkend="ClutterFixed">ClutterFixed</link> aspect,
<link linkend="ClutterFixed">ClutterFixed</link> z_near,
<link linkend="ClutterFixed">ClutterFixed</link> z_far);</programlisting>
<para>
Multiplies the current set matrix with a projection matrix based
on the provided values.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>fovy</parameter> :</term>
<listitem><simpara> Vertical of view angle in degrees.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>aspect</parameter> :</term>
<listitem><simpara> Aspect ratio of diesplay
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>z_near</parameter> :</term>
<listitem><simpara> Nearest visible point
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>z_far</parameter> :</term>
<listitem><simpara> Furthest visible point along the z-axis
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cogl-setup-viewport" role="function">
<title>cogl_setup_viewport ()</title>
<indexterm zone="cogl-setup-viewport"><primary>cogl_setup_viewport</primary></indexterm><programlisting><link linkend="void">void</link> cogl_setup_viewport (<link linkend="guint">guint</link> width,
<link linkend="guint">guint</link> height,
<link linkend="ClutterFixed">ClutterFixed</link> fovy,
<link linkend="ClutterFixed">ClutterFixed</link> aspect,
<link linkend="ClutterFixed">ClutterFixed</link> z_near,
<link linkend="ClutterFixed">ClutterFixed</link> z_far);</programlisting>
<para>
Replaces the current viewport and projection matrix with the given
values. The viewport is placed at the top left corner of the window
with the given width and height. The projection matrix is replaced
with one that has a viewing angle of <parameter>fovy</parameter> along the y-axis and a
view scaled according to <parameter>aspect</parameter> along the x-axis. The view is
clipped according to <parameter>z_near</parameter> and <parameter>z_far</parameter> on the z-axis.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>width</parameter> :</term>
<listitem><simpara> Width of the viewport
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter> :</term>
<listitem><simpara> Height of the viewport
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>fovy</parameter> :</term>
<listitem><simpara> Field of view angle in degrees
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>aspect</parameter> :</term>
<listitem><simpara> Aspect ratio to determine the field of view along the x-axis
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>z_near</parameter> :</term>
<listitem><simpara> Nearest visible point along the z-axis
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>z_far</parameter> :</term>
<listitem><simpara> Furthest visible point along the z-axis
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cogl-get-modelview-matrix" role="function">
<title>cogl_get_modelview_matrix ()</title>
<indexterm zone="cogl-get-modelview-matrix"><primary>cogl_get_modelview_matrix</primary></indexterm><programlisting><link linkend="void">void</link> cogl_get_modelview_matrix (<link linkend="ClutterFixed">ClutterFixed</link> m[16]);</programlisting>
<para>
Stores the current model-view matrix in <parameter>m</parameter>. The matrix is in
column-major order.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>m</parameter> :</term>
<listitem><simpara> pointer to a 4x4 array of <link linkend="ClutterFixed"><type>ClutterFixed</type></link><!-- -->s to receive the matrix
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cogl-get-projection-matrix" role="function">
<title>cogl_get_projection_matrix ()</title>
<indexterm zone="cogl-get-projection-matrix"><primary>cogl_get_projection_matrix</primary></indexterm><programlisting><link linkend="void">void</link> cogl_get_projection_matrix (<link linkend="ClutterFixed">ClutterFixed</link> m[16]);</programlisting>
<para>
Stores the current projection matrix in <parameter>m</parameter>. The matrix is in
column-major order.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>m</parameter> :</term>
<listitem><simpara> pointer to a 4x4 array of <link linkend="ClutterFixed"><type>ClutterFixed</type></link><!-- -->s to receive the matrix
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cogl-get-viewport" role="function">
<title>cogl_get_viewport ()</title>
<indexterm zone="cogl-get-viewport"><primary>cogl_get_viewport</primary></indexterm><programlisting><link linkend="void">void</link> cogl_get_viewport (<link linkend="ClutterFixed">ClutterFixed</link> v[4]);</programlisting>
<para>
Stores the current viewport in <parameter>v</parameter>. <parameter>v</parameter>[0] and <parameter>v</parameter>[1] get the x and y
position of the viewport and <parameter>v</parameter>[2] and <parameter>v</parameter>[3] get the width and
height.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>v</parameter> :</term>
<listitem><simpara> pointer to a 4 element array of <link linkend="ClutterFixed"><type>ClutterFixed</type></link><!-- -->s to
receive the viewport dimensions.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cogl-push-matrix" role="function">
<title>cogl_push_matrix ()</title>
<indexterm zone="cogl-push-matrix"><primary>cogl_push_matrix</primary></indexterm><programlisting><link linkend="void">void</link> cogl_push_matrix (void);</programlisting>
<para>
Store the current model-view matrix on the matrix stack. The matrix
can later be restored with <link linkend="cogl-pop-matrix"><function>cogl_pop_matrix()</function></link>.</para>
<para>
</para></refsect2>
<refsect2 id="cogl-pop-matrix" role="function">
<title>cogl_pop_matrix ()</title>
<indexterm zone="cogl-pop-matrix"><primary>cogl_pop_matrix</primary></indexterm><programlisting><link linkend="void">void</link> cogl_pop_matrix (void);</programlisting>
<para>
Restore the current model-view matrix from the matrix stack.</para>
<para>
</para></refsect2>
<refsect2 id="cogl-scale" role="function">
<title>cogl_scale ()</title>
<indexterm zone="cogl-scale"><primary>cogl_scale</primary></indexterm><programlisting><link linkend="void">void</link> cogl_scale (<link linkend="ClutterFixed">ClutterFixed</link> x,
<link linkend="ClutterFixed">ClutterFixed</link> y);</programlisting>
<para>
Multiplies the current model-view matrix by one that scales the x
and y axes by the given values.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>x</parameter> :</term>
<listitem><simpara> Amount to scale along the x-axis
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter> :</term>
<listitem><simpara> Amount to scale along the y-axis
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cogl-translatex" role="function">
<title>cogl_translatex ()</title>
<indexterm zone="cogl-translatex"><primary>cogl_translatex</primary></indexterm><programlisting><link linkend="void">void</link> cogl_translatex (<link linkend="ClutterFixed">ClutterFixed</link> x,
<link linkend="ClutterFixed">ClutterFixed</link> y,
<link linkend="ClutterFixed">ClutterFixed</link> z);</programlisting>
<para>
Multiplies the current model-view matrix by one that translates the
model along all three axes according to the given values.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>x</parameter> :</term>
<listitem><simpara> Distance to translate along the x-axis
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter> :</term>
<listitem><simpara> Distance to translate along the y-axis
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>z</parameter> :</term>
<listitem><simpara> Distance to translate along the z-axis
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cogl-translate" role="function">
<title>cogl_translate ()</title>
<indexterm zone="cogl-translate"><primary>cogl_translate</primary></indexterm><programlisting><link linkend="void">void</link> cogl_translate (<link linkend="gint">gint</link> x,
<link linkend="gint">gint</link> y,
<link linkend="gint">gint</link> z);</programlisting>
<para>
Integer version of <link linkend="cogl-translatex"><function>cogl_translatex()</function></link>. Multiplies the current
model-view matrix by one that translates the model along all three
axes according to the given values.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>x</parameter> :</term>
<listitem><simpara> Distance to translate along the x-axis
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter> :</term>
<listitem><simpara> Distance to translate along the y-axis
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>z</parameter> :</term>
<listitem><simpara> Distance to translate along the z-axis
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cogl-rotatex" role="function">
<title>cogl_rotatex ()</title>
<indexterm zone="cogl-rotatex"><primary>cogl_rotatex</primary></indexterm><programlisting><link linkend="void">void</link> cogl_rotatex (<link linkend="ClutterFixed">ClutterFixed</link> angle,
<link linkend="gint">gint</link> x,
<link linkend="gint">gint</link> y,
<link linkend="gint">gint</link> z);</programlisting>
<para>
Multiplies the current model-view matrix by one that rotates the
model around the vertex specified by <parameter>x</parameter>, <parameter>y</parameter> and <parameter>z</parameter>. The rotation
follows the right-hand thumb rule so for example rotating by 10
degrees about the vertex (0, 0, 1) causes a small counter-clockwise
rotation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>angle</parameter> :</term>
<listitem><simpara> Angle in degrees to rotate.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter> :</term>
<listitem><simpara> X-component of vertex to rotate around.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter> :</term>
<listitem><simpara> Y-component of vertex to rotate around.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>z</parameter> :</term>
<listitem><simpara> Z-component of vertex to rotate around.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cogl-rotate" role="function">
<title>cogl_rotate ()</title>
<indexterm zone="cogl-rotate"><primary>cogl_rotate</primary></indexterm><programlisting><link linkend="void">void</link> cogl_rotate (<link linkend="gint">gint</link> angle,
<link linkend="gint">gint</link> x,
<link linkend="gint">gint</link> y,
<link linkend="gint">gint</link> z);</programlisting>
<para>
Integer version of <link linkend="cogl-rotatex"><function>cogl_rotatex()</function></link>. Multiplies the current
model-view matrix by one that rotates the model around the vertex
specified by <parameter>x</parameter>, <parameter>y</parameter> and <parameter>z</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>angle</parameter> :</term>
<listitem><simpara> Angle in degrees to rotate.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter> :</term>
<listitem><simpara> X-component of vertex to rotate around.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter> :</term>
<listitem><simpara> Y-component of vertex to rotate around.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>z</parameter> :</term>
<listitem><simpara> Z-component of vertex to rotate around.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cogl-clip-set" role="function">
<title>cogl_clip_set ()</title>
<indexterm zone="cogl-clip-set"><primary>cogl_clip_set</primary></indexterm><programlisting><link linkend="void">void</link> cogl_clip_set (<link linkend="ClutterFixed">ClutterFixed</link> x_offset,
<link linkend="ClutterFixed">ClutterFixed</link> y_offset,
<link linkend="ClutterFixed">ClutterFixed</link> width,
<link linkend="ClutterFixed">ClutterFixed</link> height);</programlisting>
<para>
Specifies a rectangular clipping area for all subsequent drawing
operations. Any drawing commands that extend outside the rectangle
will be clipped so that only the portion inside the rectangle will
be displayed. The rectangle dimensions are transformed by the
current model-view matrix.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>x_offset</parameter> :</term>
<listitem><simpara> left edge of the clip rectangle
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y_offset</parameter> :</term>
<listitem><simpara> top edge of the clip rectangle
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter> :</term>
<listitem><simpara> width of the clip rectangle
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter> :</term>
<listitem><simpara> height of the clip rectangle
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cogl-clip-unset" role="function">
<title>cogl_clip_unset ()</title>
<indexterm zone="cogl-clip-unset"><primary>cogl_clip_unset</primary></indexterm><programlisting><link linkend="void">void</link> cogl_clip_unset (void);</programlisting>
<para>
Removes the current clipping rectangle so that all drawing
operations extend to full size of the viewport again.</para>
<para>
</para></refsect2>
<refsect2 id="cogl-enable-depth-test" role="function">
<title>cogl_enable_depth_test ()</title>
<indexterm zone="cogl-enable-depth-test"><primary>cogl_enable_depth_test</primary></indexterm><programlisting><link linkend="void">void</link> cogl_enable_depth_test (<link linkend="gboolean">gboolean</link> setting);</programlisting>
<para>
Sets whether depth testing is enabled. If it is disabled then the
order that actors are layered on the screen depends solely on the
order specified using <link linkend="clutter-actor-raise"><function>clutter_actor_raise()</function></link> and
<link linkend="clutter-actor-lower"><function>clutter_actor_lower()</function></link>, otherwise it will also take into account the
actor's depth. Depth testing is disabled by default.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>setting</parameter> :</term>
<listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> to enable depth testing or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> to disable.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cogl-alpha-func" role="function">
<title>cogl_alpha_func ()</title>
<indexterm zone="cogl-alpha-func"><primary>cogl_alpha_func</primary></indexterm><programlisting><link linkend="void">void</link> cogl_alpha_func (<link linkend="COGLenum">COGLenum</link> func,
<link linkend="ClutterFixed">ClutterFixed</link> ref);</programlisting>
<para>
Changes the alpha test to use the specified function specified in <parameter>func</parameter>,
comparing with the value in <parameter>ref</parameter>. The default function is CGL_ALWAYS the
initial reference value is 1.0.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>func</parameter> :</term>
<listitem><simpara> the comparison function to use, one of CGL_NEVER, CGL_LESS,
CGL_EQUAL, CGL_LEQUAL, CGL_GREATER, CGL_NOTEQUAL, CGL_GEQUAL and GL_ALWAYS.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ref</parameter> :</term>
<listitem><simpara> reference value.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cogl-fog-set" role="function">
<title>cogl_fog_set ()</title>
<indexterm zone="cogl-fog-set"><primary>cogl_fog_set</primary></indexterm><programlisting><link linkend="void">void</link> cogl_fog_set (const <link linkend="ClutterColor">ClutterColor</link> *fog_color,
<link linkend="ClutterFixed">ClutterFixed</link> density,
<link linkend="ClutterFixed">ClutterFixed</link> z_near,
<link linkend="ClutterFixed">ClutterFixed</link> z_far);</programlisting>
<para>
Enables fogging. Fogging causes vertices that are further away from
the eye to be rendered with a different color. The color is
linearly interpolated so that vertices at <parameter>z_near</parameter> are drawn fully
with their original color and vertices at <parameter>z_far</parameter> are drawn fully
with <parameter>fog_color</parameter>. Fogging will remain enabled until the next call to
<link linkend="cogl-paint-init"><function>cogl_paint_init()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>fog_color</parameter> :</term>
<listitem><simpara> The color of the fog
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>density</parameter> :</term>
<listitem><simpara> Ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>z_near</parameter> :</term>
<listitem><simpara> Position along z-axis where no fogging should be applied
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>z_far</parameter> :</term>
<listitem><simpara> Position along z-axes where full fogging should be applied
</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
</refentry>
|