/usr/share/gtk-doc/html/cogl-2.0-experimental/cogl-2.0-experimental-Main-loop-integration.html is in libcogl-doc 1.16.2-1.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Main loop integration</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Cogl 2.0 Reference Manual">
<link rel="up" href="cogl-integration.html" title="Binding and Integrating">
<link rel="prev" href="cogl-2.0-experimental-SDL-Integration.html" title="SDL Integration">
<link rel="next" href="cogl-2.0-experimental-GType-Integration-API.html" title="GType Integration API">
<meta name="generator" content="GTK-Doc V1.19 (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="2">
<tr valign="middle">
<td><a accesskey="p" href="cogl-2.0-experimental-SDL-Integration.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="cogl-integration.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Cogl 2.0 Reference Manual</th>
<td><a accesskey="n" href="cogl-2.0-experimental-GType-Integration-API.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#cogl-2.0-experimental-Main-loop-integration.synopsis" class="shortcut">Top</a>
|
<a href="#cogl-2.0-experimental-Main-loop-integration.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="cogl-2.0-experimental-Main-loop-integration"></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-Main-loop-integration.top_of_page"></a>Main loop integration</span></h2>
<p>Main loop integration — Functions for integrating Cogl with an
application's main loop</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="cogl-2.0-experimental-Main-loop-integration.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">enum <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFDEvent" title="enum CoglPollFDEvent">CoglPollFDEvent</a>;
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD">CoglPollFD</a>;
<span class="returnvalue">int</span> <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-get-info" title="cogl_poll_renderer_get_info ()">cogl_poll_renderer_get_info</a> (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a> *renderer</code></em>,
<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a> **poll_fds</code></em>,
<em class="parameter"><code><span class="type">int</span> *n_poll_fds</code></em>,
<em class="parameter"><code><span class="type">int64_t</span> *timeout</code></em>);
<span class="returnvalue">void</span> <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-dispatch" title="cogl_poll_renderer_dispatch ()">cogl_poll_renderer_dispatch</a> (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a> *renderer</code></em>,
<em class="parameter"><code>const <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a> *poll_fds</code></em>,
<em class="parameter"><code><span class="type">int</span> n_poll_fds</code></em>);
<span class="returnvalue">GSource</span> * <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-source-new" title="cogl_glib_source_new ()">cogl_glib_source_new</a> (<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> *context</code></em>,
<em class="parameter"><code><span class="type">int</span> priority</code></em>);
<span class="returnvalue">GSource</span> * <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-renderer-source-new" title="cogl_glib_renderer_source_new ()">cogl_glib_renderer_source_new</a> (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a> *renderer</code></em>,
<em class="parameter"><code><span class="type">int</span> priority</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="cogl-2.0-experimental-Main-loop-integration.description"></a><h2>Description</h2>
<p>
Cogl needs to integrate with the application's main loop so that it
can internally handle some events from the driver. All Cogl
applications must use these functions. They provide enough
information to describe the state that Cogl will need to wake up
on. An application using the GLib main loop can instead use
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-source-new" title="cogl_glib_source_new ()"><code class="function">cogl_glib_source_new()</code></a> which provides a <span class="type">GSource</span> ready to be added
to the main loop.
</p>
</div>
<div class="refsect1">
<a name="cogl-2.0-experimental-Main-loop-integration.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="CoglPollFDEvent"></a><h3>enum CoglPollFDEvent</h3>
<pre class="programlisting">typedef enum {
COGL_POLL_FD_EVENT_IN = COGL_SYSDEF_POLLIN,
COGL_POLL_FD_EVENT_PRI = COGL_SYSDEF_POLLPRI,
COGL_POLL_FD_EVENT_OUT = COGL_SYSDEF_POLLOUT,
COGL_POLL_FD_EVENT_ERR = COGL_SYSDEF_POLLERR,
COGL_POLL_FD_EVENT_HUP = COGL_SYSDEF_POLLHUP,
COGL_POLL_FD_EVENT_NVAL = COGL_SYSDEF_POLLNVAL
} CoglPollFDEvent;
</pre>
<p>
A bitmask of events that Cogl may need to wake on for a file
descriptor. Note that these all have the same values as the
corresponding defines for the poll function call on Unix so they
may be directly passed to poll.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><a name="COGL-POLL-FD-EVENT-IN:CAPS"></a><span class="term"><code class="literal">COGL_POLL_FD_EVENT_IN</code></span></p></td>
<td>there is data to read
</td>
</tr>
<tr>
<td><p><a name="COGL-POLL-FD-EVENT-PRI:CAPS"></a><span class="term"><code class="literal">COGL_POLL_FD_EVENT_PRI</code></span></p></td>
<td>data can be written (without blocking)
</td>
</tr>
<tr>
<td><p><a name="COGL-POLL-FD-EVENT-OUT:CAPS"></a><span class="term"><code class="literal">COGL_POLL_FD_EVENT_OUT</code></span></p></td>
<td>there is urgent data to read.
</td>
</tr>
<tr>
<td><p><a name="COGL-POLL-FD-EVENT-ERR:CAPS"></a><span class="term"><code class="literal">COGL_POLL_FD_EVENT_ERR</code></span></p></td>
<td>error condition
</td>
</tr>
<tr>
<td><p><a name="COGL-POLL-FD-EVENT-HUP:CAPS"></a><span class="term"><code class="literal">COGL_POLL_FD_EVENT_HUP</code></span></p></td>
<td>hung up (the connection has been broken, usually
for pipes and sockets).
</td>
</tr>
<tr>
<td><p><a name="COGL-POLL-FD-EVENT-NVAL:CAPS"></a><span class="term"><code class="literal">COGL_POLL_FD_EVENT_NVAL</code></span></p></td>
<td>invalid request. The file descriptor is not open.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.10</p>
<p class="stability">Stability Level: Unstable</p>
</div>
<hr>
<div class="refsect2">
<a name="CoglPollFD"></a><h3>CoglPollFD</h3>
<pre class="programlisting">typedef struct {
int fd;
short int events;
short int revents;
} CoglPollFD;
</pre>
<p>
A struct for describing the state of a file descriptor that Cogl
needs to block on. The <em class="parameter"><code>events</code></em> field contains a bitmask of
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFDEvent" title="enum CoglPollFDEvent"><span class="type">CoglPollFDEvent</span></a>s that should cause the application to wake
up. After the application is woken up from idle it should pass back
an array of <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a>s to Cogl and update the <em class="parameter"><code>revents</code></em>
mask to the actual events that occurred on the file descriptor.
</p>
<p>
Note that CoglPollFD is deliberately exactly the same as struct
pollfd on Unix so that it can simply be cast when calling poll.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><span class="type">int</span> <em class="structfield"><code><a name="CoglPollFD.fd"></a>fd</code></em>;</span></p></td>
<td>The file descriptor to block on</td>
</tr>
<tr>
<td><p><span class="term">short <span class="type">int</span> <em class="structfield"><code><a name="CoglPollFD.events"></a>events</code></em>;</span></p></td>
<td>A bitmask of events to block on</td>
</tr>
<tr>
<td><p><span class="term">short <span class="type">int</span> <em class="structfield"><code><a name="CoglPollFD.revents"></a>revents</code></em>;</span></p></td>
<td>A bitmask of returned events</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.10</p>
<p class="stability">Stability Level: Unstable</p>
</div>
<hr>
<div class="refsect2">
<a name="cogl-poll-renderer-get-info"></a><h3>cogl_poll_renderer_get_info ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> cogl_poll_renderer_get_info (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a> *renderer</code></em>,
<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a> **poll_fds</code></em>,
<em class="parameter"><code><span class="type">int</span> *n_poll_fds</code></em>,
<em class="parameter"><code><span class="type">int64_t</span> *timeout</code></em>);</pre>
<p>
Is used to integrate Cogl with an application mainloop that is based
on the unix poll(2) api (or <code class="function">select()</code> or something equivalent). This
api should be called whenever an application is about to go idle so
that Cogl has a chance to describe what file descriptor events it
needs to be woken up for.
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>If your application is using the Glib mainloop then you
should jump to the <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-source-new" title="cogl_glib_source_new ()"><code class="function">cogl_glib_source_new()</code></a> api as a more convenient
way of integrating Cogl with the mainloop.</div>
<p>
</p>
<p>
After the function is called *<em class="parameter"><code>poll_fds</code></em> will contain a pointer to
an array of <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a> structs describing the file descriptors
that Cogl expects. The fd and events members will be updated
accordingly. After the application has completed its idle it is
expected to either update the revents members directly in this
array or to create a copy of the array and update them
there.
</p>
<p>
When the application mainloop returns from calling poll(2) (or its
equivalent) then it should call <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-dispatch" title="cogl_poll_renderer_dispatch ()"><code class="function">cogl_poll_renderer_dispatch()</code></a>
passing a pointer the array of CoglPollFDs with updated
revent values.
</p>
<p>
When using the <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#COGL-WINSYS-ID-WGL:CAPS"><code class="literal">COGL_WINSYS_ID_WGL</code></a> winsys (where file descriptors
don't make any sense) or <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#COGL-WINSYS-ID-SDL:CAPS"><code class="literal">COGL_WINSYS_ID_SDL</code></a> (where the event
handling functions of SDL don't allow blocking on a file
descriptor) *n_poll_fds is guaranteed to be zero.
</p>
<p>
<em class="parameter"><code>timeout</code></em> will contain a maximum amount of time to wait in
microseconds before the application should wake up or -1 if the
application should wait indefinitely. This can also be 0 if
Cogl needs to be woken up immediately.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>renderer</code></em> :</span></p></td>
<td>A <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>poll_fds</code></em> :</span></p></td>
<td>A return location for a pointer to an array
of <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a>s</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n_poll_fds</code></em> :</span></p></td>
<td>A return location for the number of entries in *<em class="parameter"><code>poll_fds</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>timeout</code></em> :</span></p></td>
<td>A return location for the maximum length of time to wait
in microseconds, or -1 to wait indefinitely.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A "poll fd state age" that changes whenever the set
of poll_fds has changed. If this API is being used to
integrate with another system mainloop api then
knowing if the set of file descriptors and events has
really changed can help avoid redundant work
depending the api. The age isn't guaranteed to change
when the timeout changes.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.16</p>
<p class="stability">Stability Level: Unstable</p>
</div>
<hr>
<div class="refsect2">
<a name="cogl-poll-renderer-dispatch"></a><h3>cogl_poll_renderer_dispatch ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> cogl_poll_renderer_dispatch (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a> *renderer</code></em>,
<em class="parameter"><code>const <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a> *poll_fds</code></em>,
<em class="parameter"><code><span class="type">int</span> n_poll_fds</code></em>);</pre>
<p>
This should be called whenever an application is woken up from
going idle in its main loop. The <em class="parameter"><code>poll_fds</code></em> array should contain a
list of file descriptors matched with the events that occurred in
revents. The events field is ignored. It is safe to pass in extra
file descriptors that Cogl didn't request when calling
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-get-info" title="cogl_poll_renderer_get_info ()"><code class="function">cogl_poll_renderer_get_info()</code></a> or a shorter array missing some file
descriptors that Cogl requested.
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>If your application didn't originally create a <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a>
manually then you can easily get a <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a> pointer by calling
<code class="function">cogl_get_renderer()</code>.</div>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>renderer</code></em> :</span></p></td>
<td>A <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>poll_fds</code></em> :</span></p></td>
<td>An array of <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a>s describing the events
that have occurred since the application went idle.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n_poll_fds</code></em> :</span></p></td>
<td>The length of the <em class="parameter"><code>poll_fds</code></em> array.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.16</p>
<p class="stability">Stability Level: Unstable</p>
</div>
<hr>
<div class="refsect2">
<a name="cogl-glib-source-new"></a><h3>cogl_glib_source_new ()</h3>
<pre class="programlisting"><span class="returnvalue">GSource</span> * cogl_glib_source_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> *context</code></em>,
<em class="parameter"><code><span class="type">int</span> priority</code></em>);</pre>
<p>
Creates a <span class="type">GSource</span> which handles Cogl's internal system event
processing. This can be used as a convenience instead of
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-get-info" title="cogl_poll_renderer_get_info ()"><code class="function">cogl_poll_renderer_get_info()</code></a> and <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-dispatch" title="cogl_poll_renderer_dispatch ()"><code class="function">cogl_poll_renderer_dispatch()</code></a> in
applications that are already using the GLib main loop. After this
is called the <span class="type">GSource</span> should be attached to the main loop using
<code class="function">g_source_attach()</code>.
</p>
<p>
Applications that manually connect to a <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a> before they
create a <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglContext" title="CoglContext"><span class="type">CoglContext</span></a> should instead use
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-renderer-source-new" title="cogl_glib_renderer_source_new ()"><code class="function">cogl_glib_renderer_source_new()</code></a> so that events may be dispatched
before a context has been created. In that case you don't need to
use this api in addition later, it is simply enough to use
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-renderer-source-new" title="cogl_glib_renderer_source_new ()"><code class="function">cogl_glib_renderer_source_new()</code></a> instead.
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>This api is actually just a thin convenience wrapper around
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-renderer-source-new" title="cogl_glib_renderer_source_new ()"><code class="function">cogl_glib_renderer_source_new()</code></a>
</div>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
<td>A <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglContext" title="CoglContext"><span class="type">CoglContext</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>priority</code></em> :</span></p></td>
<td>The priority of the <span class="type">GSource</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <span class="type">GSource</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.10</p>
<p class="stability">Stability Level: Unstable</p>
</div>
<hr>
<div class="refsect2">
<a name="cogl-glib-renderer-source-new"></a><h3>cogl_glib_renderer_source_new ()</h3>
<pre class="programlisting"><span class="returnvalue">GSource</span> * cogl_glib_renderer_source_new (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a> *renderer</code></em>,
<em class="parameter"><code><span class="type">int</span> priority</code></em>);</pre>
<p>
Creates a <span class="type">GSource</span> which handles Cogl's internal system event
processing. This can be used as a convenience instead of
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-get-info" title="cogl_poll_renderer_get_info ()"><code class="function">cogl_poll_renderer_get_info()</code></a> and <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-dispatch" title="cogl_poll_renderer_dispatch ()"><code class="function">cogl_poll_renderer_dispatch()</code></a> in
applications that are already using the GLib main loop. After this
is called the <span class="type">GSource</span> should be attached to the main loop using
<code class="function">g_source_attach()</code>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>renderer</code></em> :</span></p></td>
<td>A <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>priority</code></em> :</span></p></td>
<td>The priority of the <span class="type">GSource</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <span class="type">GSource</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.16</p>
<p class="stability">Stability Level: Unstable</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.19</div>
</body>
</html>
|