"Initial commit to Gerrit"
[profile/ivi/cogl.git] / doc / reference / cogl-2.0-experimental / html / cogl-2.0-experimental-The-Top-Level-Context.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>The Top-Level Context</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="Cogl 2.0 Reference Manual">
8 <link rel="up" href="ch01.html" title="Cogl - a modern 3D graphics API">
9 <link rel="prev" href="cogl-2.0-experimental-The-Object-Interface.html" title="The Object Interface">
10 <link rel="next" href="cogl-2.0-experimental-Main-loop-integeration.html" title="Main loop integeration">
11 <meta name="generator" content="GTK-Doc V1.18.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="cogl-2.0-experimental-The-Object-Interface.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">Cogl 2.0 Reference Manual</th>
21 <td><a accesskey="n" href="cogl-2.0-experimental-Main-loop-integeration.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#cogl-2.0-experimental-The-Top-Level-Context.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#cogl-2.0-experimental-The-Top-Level-Context.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="cogl-2.0-experimental-The-Top-Level-Context"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
33 <h2><span class="refentrytitle"><a name="cogl-2.0-experimental-The-Top-Level-Context.top_of_page"></a>The Top-Level Context</span></h2>
34 <p>The Top-Level Context — The top level application context.</p>
35 </td>
36 <td valign="top" align="right"></td>
37 </tr></table></div>
38 <div class="refsynopsisdiv">
39 <a name="cogl-2.0-experimental-The-Top-Level-Context.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis"><span class="returnvalue">CoglContext</span> *       <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-context-new" title="cogl_context_new ()">cogl_context_new</a>                    (<em class="parameter"><code><span class="type">CoglDisplay</span> *display</code></em>,
41                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
42 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-is-context" title="cogl_is_context ()">cogl_is_context</a>                     (<em class="parameter"><code><span class="type">void</span> *object</code></em>);
43 <span class="returnvalue">CoglDisplay</span> *       <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-context-get-display" title="cogl_context_get_display ()">cogl_context_get_display</a>            (<em class="parameter"><code><span class="type">CoglContext</span> *context</code></em>);
44
45 enum                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglFeatureID" title="enum CoglFeatureID">CoglFeatureID</a>;
46 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-has-feature" title="cogl_has_feature ()">cogl_has_feature</a>                    (<em class="parameter"><code><span class="type">CoglContext</span> *context</code></em>,
47                                                          <em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglFeatureID" title="enum CoglFeatureID"><span class="type">CoglFeatureID</span></a> feature</code></em>);
48 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-has-features" title="cogl_has_features ()">cogl_has_features</a>                   (<em class="parameter"><code><span class="type">CoglContext</span> *context</code></em>,
49                                                          <em class="parameter"><code>...</code></em>);
50 <span class="returnvalue">void</span>                (<a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglFeatureCallback" title="CoglFeatureCallback ()">*CoglFeatureCallback</a>)              (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglFeatureID" title="enum CoglFeatureID"><span class="type">CoglFeatureID</span></a> feature</code></em>,
51                                                          <em class="parameter"><code><span class="type">void</span> *user_data</code></em>);
52 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-foreach-feature" title="cogl_foreach_feature ()">cogl_foreach_feature</a>                (<em class="parameter"><code><span class="type">CoglContext</span> *context</code></em>,
53                                                          <em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglFeatureCallback" title="CoglFeatureCallback ()"><span class="type">CoglFeatureCallback</span></a> callback</code></em>,
54                                                          <em class="parameter"><code><span class="type">void</span> *user_data</code></em>);
55
56 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-push-matrix" title="cogl_push_matrix ()">cogl_push_matrix</a>                    (<em class="parameter"><code><span class="type">void</span></code></em>);
57 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-pop-matrix" title="cogl_pop_matrix ()">cogl_pop_matrix</a>                     (<em class="parameter"><code><span class="type">void</span></code></em>);
58 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-scale" title="cogl_scale ()">cogl_scale</a>                          (<em class="parameter"><code><span class="type">float</span> x</code></em>,
59                                                          <em class="parameter"><code><span class="type">float</span> y</code></em>,
60                                                          <em class="parameter"><code><span class="type">float</span> z</code></em>);
61 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-translate" title="cogl_translate ()">cogl_translate</a>                      (<em class="parameter"><code><span class="type">float</span> x</code></em>,
62                                                          <em class="parameter"><code><span class="type">float</span> y</code></em>,
63                                                          <em class="parameter"><code><span class="type">float</span> z</code></em>);
64 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-rotate" title="cogl_rotate ()">cogl_rotate</a>                         (<em class="parameter"><code><span class="type">float</span> angle</code></em>,
65                                                          <em class="parameter"><code><span class="type">float</span> x</code></em>,
66                                                          <em class="parameter"><code><span class="type">float</span> y</code></em>,
67                                                          <em class="parameter"><code><span class="type">float</span> z</code></em>);
68 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-transform" title="cogl_transform ()">cogl_transform</a>                      (<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>);
69 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-frustum" title="cogl_frustum ()">cogl_frustum</a>                        (<em class="parameter"><code><span class="type">float</span> left</code></em>,
70                                                          <em class="parameter"><code><span class="type">float</span> right</code></em>,
71                                                          <em class="parameter"><code><span class="type">float</span> bottom</code></em>,
72                                                          <em class="parameter"><code><span class="type">float</span> top</code></em>,
73                                                          <em class="parameter"><code><span class="type">float</span> z_near</code></em>,
74                                                          <em class="parameter"><code><span class="type">float</span> z_far</code></em>);
75 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-perspective" title="cogl_perspective ()">cogl_perspective</a>                    (<em class="parameter"><code><span class="type">float</span> fovy</code></em>,
76                                                          <em class="parameter"><code><span class="type">float</span> aspect</code></em>,
77                                                          <em class="parameter"><code><span class="type">float</span> z_near</code></em>,
78                                                          <em class="parameter"><code><span class="type">float</span> z_far</code></em>);
79 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-ortho" title="cogl_ortho ()">cogl_ortho</a>                          (<em class="parameter"><code><span class="type">float</span> left</code></em>,
80                                                          <em class="parameter"><code><span class="type">float</span> right</code></em>,
81                                                          <em class="parameter"><code><span class="type">float</span> bottom</code></em>,
82                                                          <em class="parameter"><code><span class="type">float</span> top</code></em>,
83                                                          <em class="parameter"><code><span class="type">float</span> near</code></em>,
84                                                          <em class="parameter"><code><span class="type">float</span> far</code></em>);
85
86 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-get-modelview-matrix" title="cogl_get_modelview_matrix ()">cogl_get_modelview_matrix</a>           (<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>);
87 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-set-modelview-matrix" title="cogl_set_modelview_matrix ()">cogl_set_modelview_matrix</a>           (<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>);
88 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-get-projection-matrix" title="cogl_get_projection_matrix ()">cogl_get_projection_matrix</a>          (<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>);
89 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-set-projection-matrix" title="cogl_set_projection_matrix ()">cogl_set_projection_matrix</a>          (<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>);
90 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-set-viewport" title="cogl_set_viewport ()">cogl_set_viewport</a>                   (<em class="parameter"><code><span class="type">int</span> x</code></em>,
91                                                          <em class="parameter"><code><span class="type">int</span> y</code></em>,
92                                                          <em class="parameter"><code><span class="type">int</span> width</code></em>,
93                                                          <em class="parameter"><code><span class="type">int</span> height</code></em>);
94 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-get-viewport" title="cogl_get_viewport ()">cogl_get_viewport</a>                   (<em class="parameter"><code><span class="type">float</span> v[4]</code></em>);
95
96 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-set-source" title="cogl_set_source ()">cogl_set_source</a>                     (<em class="parameter"><code><span class="type">void</span> *material</code></em>);
97 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-set-source-color" title="cogl_set_source_color ()">cogl_set_source_color</a>               (<em class="parameter"><code>const <a class="link" href="cogl-2.0-experimental-Color-Type.html#CoglColor" title="struct CoglColor"><span class="type">CoglColor</span></a> *color</code></em>);
98 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-set-source-color4ub" title="cogl_set_source_color4ub ()">cogl_set_source_color4ub</a>            (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> red</code></em>,
99                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> green</code></em>,
100                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> blue</code></em>,
101                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> alpha</code></em>);
102 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-set-source-color4f" title="cogl_set_source_color4f ()">cogl_set_source_color4f</a>             (<em class="parameter"><code><span class="type">float</span> red</code></em>,
103                                                          <em class="parameter"><code><span class="type">float</span> green</code></em>,
104                                                          <em class="parameter"><code><span class="type">float</span> blue</code></em>,
105                                                          <em class="parameter"><code><span class="type">float</span> alpha</code></em>);
106 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-set-source-texture" title="cogl_set_source_texture ()">cogl_set_source_texture</a>             (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Texture-Interface.html#CoglTexture" title="CoglTexture"><span class="type">CoglTexture</span></a> *texture</code></em>);
107 <span class="returnvalue">void</span> *              <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-get-source" title="cogl_get_source ()">cogl_get_source</a>                     (<em class="parameter"><code><span class="type">void</span></code></em>);
108 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-push-source" title="cogl_push_source ()">cogl_push_source</a>                    (<em class="parameter"><code><span class="type">void</span> *material</code></em>);
109 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-pop-source" title="cogl_pop_source ()">cogl_pop_source</a>                     (<em class="parameter"><code><span class="type">void</span></code></em>);
110
111 #define             <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#COGL-TYPE-BUFFER-BIT:CAPS" title="COGL_TYPE_BUFFER_BIT">COGL_TYPE_BUFFER_BIT</a>
112 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-clear" title="cogl_clear ()">cogl_clear</a>                          (<em class="parameter"><code>const <a class="link" href="cogl-2.0-experimental-Color-Type.html#CoglColor" title="struct CoglColor"><span class="type">CoglColor</span></a> *color</code></em>,
113                                                          <em class="parameter"><code><span class="type">unsigned long </span> buffers</code></em>);
114
115 enum                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglReadPixelsFlags" title="enum CoglReadPixelsFlags">CoglReadPixelsFlags</a>;
116 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-read-pixels" title="cogl_read_pixels ()">cogl_read_pixels</a>                    (<em class="parameter"><code><span class="type">int</span> x</code></em>,
117                                                          <em class="parameter"><code><span class="type">int</span> y</code></em>,
118                                                          <em class="parameter"><code><span class="type">int</span> width</code></em>,
119                                                          <em class="parameter"><code><span class="type">int</span> height</code></em>,
120                                                          <em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglReadPixelsFlags" title="enum CoglReadPixelsFlags"><span class="type">CoglReadPixelsFlags</span></a> source</code></em>,
121                                                          <em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> format</code></em>,
122                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *pixels</code></em>);
123
124 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-flush" title="cogl_flush ()">cogl_flush</a>                          (<em class="parameter"><code><span class="type">void</span></code></em>);
125 </pre>
126 </div>
127 <div class="refsect1">
128 <a name="cogl-2.0-experimental-The-Top-Level-Context.description"></a><h2>Description</h2>
129 <p>
130 A <span class="type">CoglContext</span> is the top most sandbox of Cogl state for an
131 application or toolkit. Its main purpose is to act as a sandbox
132 for the memory management of state objects. Normally an application
133 will only create a single context since there is no way to share
134 resources between contexts.
135 </p>
136 <p>
137 For those familiar with OpenGL or perhaps Cairo it should be
138 understood that unlike these APIs a Cogl context isn't a rendering
139 context as such. In other words Cogl doesn't aim to provide a state
140 machine style model for configuring rendering parameters. Most
141 rendering state in Cogl is directly associated with user managed
142 objects called pipelines and geometry is drawn with a specific
143 pipeline object to a framebuffer object and those 3 things fully
144 define the state for drawing. This is an important part of Cogl's
145 design since it helps you write orthogonal rendering components
146 that can all access the same GPU without having to worry about
147 what state other components have left you with.
148 </p>
149 </div>
150 <div class="refsect1">
151 <a name="cogl-2.0-experimental-The-Top-Level-Context.details"></a><h2>Details</h2>
152 <div class="refsect2">
153 <a name="cogl-context-new"></a><h3>cogl_context_new ()</h3>
154 <pre class="programlisting"><span class="returnvalue">CoglContext</span> *       cogl_context_new                    (<em class="parameter"><code><span class="type">CoglDisplay</span> *display</code></em>,
155                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
156 <p>
157 Creates a new <span class="type">CoglContext</span> which acts as an application sandbox
158 for any state objects that are allocated.
159 </p>
160 <div class="variablelist"><table border="0">
161 <col align="left" valign="top">
162 <tbody>
163 <tr>
164 <td><p><span class="term"><em class="parameter"><code>display</code></em> :</span></p></td>
165 <td>A <span class="type">CoglDisplay</span> pointer</td>
166 </tr>
167 <tr>
168 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
169 <td>A GError return location.</td>
170 </tr>
171 <tr>
172 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
173 <td>A newly allocated <span class="type">CoglContext</span>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
174 </td>
175 </tr>
176 </tbody>
177 </table></div>
178 <p class="since">Since 1.8</p>
179 <p class="stability">Stability Level: Unstable</p>
180 </div>
181 <hr>
182 <div class="refsect2">
183 <a name="cogl-is-context"></a><h3>cogl_is_context ()</h3>
184 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            cogl_is_context                     (<em class="parameter"><code><span class="type">void</span> *object</code></em>);</pre>
185 <p>
186 Gets whether the given object references an existing context object.
187 </p>
188 <div class="variablelist"><table border="0">
189 <col align="left" valign="top">
190 <tbody>
191 <tr>
192 <td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
193 <td>An object or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
194 </td>
195 </tr>
196 <tr>
197 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
198 <td>
199 <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the handle references a <span class="type">CoglContext</span>,
200 <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
201 </tr>
202 </tbody>
203 </table></div>
204 <p class="since">Since 1.10</p>
205 <p class="stability">Stability Level: Unstable</p>
206 </div>
207 <hr>
208 <div class="refsect2">
209 <a name="cogl-context-get-display"></a><h3>cogl_context_get_display ()</h3>
210 <pre class="programlisting"><span class="returnvalue">CoglDisplay</span> *       cogl_context_get_display            (<em class="parameter"><code><span class="type">CoglContext</span> *context</code></em>);</pre>
211 <p>
212 Retrieves the <span class="type">CoglDisplay</span> that is internally associated with the
213 given <em class="parameter"><code>context</code></em>. This will return the same <span class="type">CoglDisplay</span> that was
214 passed to <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-context-new" title="cogl_context_new ()"><code class="function">cogl_context_new()</code></a> or if <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> was passed to
215 <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-context-new" title="cogl_context_new ()"><code class="function">cogl_context_new()</code></a> then this function returns a pointer to the
216 display that was automatically setup internally.
217 </p>
218 <div class="variablelist"><table border="0">
219 <col align="left" valign="top">
220 <tbody>
221 <tr>
222 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
223 <td>A <span class="type">CoglContext</span> pointer</td>
224 </tr>
225 <tr>
226 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
227 <td>The <span class="type">CoglDisplay</span> associated with the
228 given <em class="parameter"><code>context</code></em>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
229 </td>
230 </tr>
231 </tbody>
232 </table></div>
233 <p class="since">Since 1.8</p>
234 <p class="stability">Stability Level: Unstable</p>
235 </div>
236 <hr>
237 <div class="refsect2">
238 <a name="CoglFeatureID"></a><h3>enum CoglFeatureID</h3>
239 <pre class="programlisting">typedef enum {
240   COGL_FEATURE_ID_TEXTURE_NPOT_BASIC = 1,
241   COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP,
242   COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT,
243   COGL_FEATURE_ID_TEXTURE_NPOT,
244   COGL_FEATURE_ID_TEXTURE_RECTANGLE,
245   COGL_FEATURE_ID_TEXTURE_3D,
246   COGL_FEATURE_ID_GLSL,
247   COGL_FEATURE_ID_ARBFP,
248   COGL_FEATURE_ID_OFFSCREEN,
249   COGL_FEATURE_ID_OFFSCREEN_MULTISAMPLE,
250   COGL_FEATURE_ID_ONSCREEN_MULTIPLE,
251   COGL_FEATURE_ID_UNSIGNED_INT_INDICES,
252   COGL_FEATURE_ID_DEPTH_RANGE,
253   COGL_FEATURE_ID_POINT_SPRITE,
254   COGL_FEATURE_ID_MAP_BUFFER_FOR_READ,
255   COGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE,
256   COGL_FEATURE_ID_MIRRORED_REPEAT,
257   COGL_FEATURE_ID_SWAP_BUFFERS_EVENT,
258 } CoglFeatureID;
259 </pre>
260 <p>
261 All the capabilities that can vary between different GPUs supported
262 by Cogl. Applications that depend on any of these features should explicitly
263 check for them using <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-has-feature" title="cogl_has_feature ()"><code class="function">cogl_has_feature()</code></a> or <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-has-features" title="cogl_has_features ()"><code class="function">cogl_has_features()</code></a>.
264 </p>
265 <div class="variablelist"><table border="0">
266 <col align="left" valign="top">
267 <tbody>
268 <tr>
269 <td><p><a name="COGL-FEATURE-ID-TEXTURE-NPOT-BASIC:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_TEXTURE_NPOT_BASIC</code></span></p></td>
270 <td>The hardware supports non power
271     of two textures, but you also need to check the
272     <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#COGL-FEATURE-ID-TEXTURE-NPOT-MIPMAP:CAPS"><code class="literal">COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP</code></a> and <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#COGL-FEATURE-ID-TEXTURE-NPOT-REPEAT:CAPS"><code class="literal">COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT</code></a>
273     features to know if the hardware supports npot texture mipmaps
274     or repeat modes other than
275     <code class="literal">COGL_RENDERER_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE</code> respectively.
276 </td>
277 </tr>
278 <tr>
279 <td><p><a name="COGL-FEATURE-ID-TEXTURE-NPOT-MIPMAP:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP</code></span></p></td>
280 <td>Mipmapping is supported in
281     conjuntion with non power of two textures.
282 </td>
283 </tr>
284 <tr>
285 <td><p><a name="COGL-FEATURE-ID-TEXTURE-NPOT-REPEAT:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT</code></span></p></td>
286 <td>Repeat modes other than
287     <code class="literal">COGL_RENDERER_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE</code> are supported by the
288     hardware.
289 </td>
290 </tr>
291 <tr>
292 <td><p><a name="COGL-FEATURE-ID-TEXTURE-NPOT:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_TEXTURE_NPOT</code></span></p></td>
293 <td>Non power of two textures are supported
294    by the hardware. This is a equivalent to the
295    <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#COGL-FEATURE-ID-TEXTURE-NPOT-BASIC:CAPS"><code class="literal">COGL_FEATURE_ID_TEXTURE_NPOT_BASIC</code></a>, <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#COGL-FEATURE-ID-TEXTURE-NPOT-MIPMAP:CAPS"><code class="literal">COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP</code></a>
296    and <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#COGL-FEATURE-ID-TEXTURE-NPOT-REPEAT:CAPS"><code class="literal">COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT</code></a> features combined.
297 </td>
298 </tr>
299 <tr>
300 <td><p><a name="COGL-FEATURE-ID-TEXTURE-RECTANGLE:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_TEXTURE_RECTANGLE</code></span></p></td>
301 <td>Support for rectangular
302    textures with non-normalized texture coordinates.
303 </td>
304 </tr>
305 <tr>
306 <td><p><a name="COGL-FEATURE-ID-TEXTURE-3D:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_TEXTURE_3D</code></span></p></td>
307 <td>3D texture support
308 </td>
309 </tr>
310 <tr>
311 <td><p><a name="COGL-FEATURE-ID-GLSL:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_GLSL</code></span></p></td>
312 <td>GLSL support
313 </td>
314 </tr>
315 <tr>
316 <td><p><a name="COGL-FEATURE-ID-ARBFP:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_ARBFP</code></span></p></td>
317 <td>ARBFP support
318 </td>
319 </tr>
320 <tr>
321 <td><p><a name="COGL-FEATURE-ID-OFFSCREEN:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_OFFSCREEN</code></span></p></td>
322 <td>Offscreen rendering support
323 </td>
324 </tr>
325 <tr>
326 <td><p><a name="COGL-FEATURE-ID-OFFSCREEN-MULTISAMPLE:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_OFFSCREEN_MULTISAMPLE</code></span></p></td>
327 <td>Multisample support for
328    offscreen framebuffers
329 </td>
330 </tr>
331 <tr>
332 <td><p><a name="COGL-FEATURE-ID-ONSCREEN-MULTIPLE:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_ONSCREEN_MULTIPLE</code></span></p></td>
333 <td>Multiple onscreen framebuffers
334    supported.
335 </td>
336 </tr>
337 <tr>
338 <td><p><a name="COGL-FEATURE-ID-UNSIGNED-INT-INDICES:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_UNSIGNED_INT_INDICES</code></span></p></td>
339 <td>Set if
340     <code class="literal">COGL_RENDERER_INDICES_TYPE_UNSIGNED_INT</code> is supported in
341     <a class="link" href="cogl-2.0-experimental-Indices.html#cogl-indices-new" title="cogl_indices_new ()"><code class="function">cogl_indices_new()</code></a>.
342 </td>
343 </tr>
344 <tr>
345 <td><p><a name="COGL-FEATURE-ID-DEPTH-RANGE:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_DEPTH_RANGE</code></span></p></td>
346 <td>cogl_pipeline_set_depth_range() support
347 </td>
348 </tr>
349 <tr>
350 <td><p><a name="COGL-FEATURE-ID-POINT-SPRITE:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_POINT_SPRITE</code></span></p></td>
351 <td>Whether
352     <a class="link" href="cogl-2.0-experimental-Pipeline.html#cogl-pipeline-set-layer-point-sprite-coords-enabled" title="cogl_pipeline_set_layer_point_sprite_coords_enabled ()"><code class="function">cogl_pipeline_set_layer_point_sprite_coords_enabled()</code></a> is supported.
353 </td>
354 </tr>
355 <tr>
356 <td><p><a name="COGL-FEATURE-ID-MAP-BUFFER-FOR-READ:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_MAP_BUFFER_FOR_READ</code></span></p></td>
357 <td>Whether <a class="link" href="cogl-2.0-experimental-CoglBuffer---The-Buffer-Interface.html#cogl-buffer-map" title="cogl_buffer_map ()"><code class="function">cogl_buffer_map()</code></a> is
358     supported with CoglBufferAccess including read support.
359 </td>
360 </tr>
361 <tr>
362 <td><p><a name="COGL-FEATURE-ID-MAP-BUFFER-FOR-WRITE:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE</code></span></p></td>
363 <td>Whether <a class="link" href="cogl-2.0-experimental-CoglBuffer---The-Buffer-Interface.html#cogl-buffer-map" title="cogl_buffer_map ()"><code class="function">cogl_buffer_map()</code></a> is
364     supported with CoglBufferAccess including write support.
365 </td>
366 </tr>
367 <tr>
368 <td><p><a name="COGL-FEATURE-ID-MIRRORED-REPEAT:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_MIRRORED_REPEAT</code></span></p></td>
369 <td>Whether
370    <code class="literal">COGL_PIPELINE_WRAP_MODE_MIRRORED_REPEAT</code> is supported.
371 </td>
372 </tr>
373 <tr>
374 <td><p><a name="COGL-FEATURE-ID-SWAP-BUFFERS-EVENT:CAPS"></a><span class="term"><code class="literal">COGL_FEATURE_ID_SWAP_BUFFERS_EVENT</code></span></p></td>
375 <td>    Available if the window system supports reporting an event
376     for swap buffer completions.
377 </td>
378 </tr>
379 </tbody>
380 </table></div>
381 <p class="since">Since 1.10</p>
382 </div>
383 <hr>
384 <div class="refsect2">
385 <a name="cogl-has-feature"></a><h3>cogl_has_feature ()</h3>
386 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            cogl_has_feature                    (<em class="parameter"><code><span class="type">CoglContext</span> *context</code></em>,
387                                                          <em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglFeatureID" title="enum CoglFeatureID"><span class="type">CoglFeatureID</span></a> feature</code></em>);</pre>
388 <p>
389 Checks if a given <em class="parameter"><code>feature</code></em> is currently available
390 </p>
391 <p>
392 Cogl does not aim to be a lowest common denominator API, it aims to
393 expose all the interesting features of GPUs to application which
394 means applications have some responsibility to explicitly check
395 that certain features are available before depending on them.
396 </p>
397 <div class="variablelist"><table border="0">
398 <col align="left" valign="top">
399 <tbody>
400 <tr>
401 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
402 <td>A <span class="type">CoglContext</span> pointer</td>
403 </tr>
404 <tr>
405 <td><p><span class="term"><em class="parameter"><code>feature</code></em> :</span></p></td>
406 <td>A <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglFeatureID" title="enum CoglFeatureID"><span class="type">CoglFeatureID</span></a>
407 </td>
408 </tr>
409 <tr>
410 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
411 <td>
412 <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <em class="parameter"><code>feature</code></em> is currently supported or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if
413 not.</td>
414 </tr>
415 </tbody>
416 </table></div>
417 <p class="since">Since 1.10</p>
418 <p class="stability">Stability Level: Unstable</p>
419 </div>
420 <hr>
421 <div class="refsect2">
422 <a name="cogl-has-features"></a><h3>cogl_has_features ()</h3>
423 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            cogl_has_features                   (<em class="parameter"><code><span class="type">CoglContext</span> *context</code></em>,
424                                                          <em class="parameter"><code>...</code></em>);</pre>
425 <p>
426 Checks if a list of features are all currently available.
427 </p>
428 <p>
429 This checks all of the listed features using <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-has-feature" title="cogl_has_feature ()"><code class="function">cogl_has_feature()</code></a> and
430 returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if all the features are available or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>
431 otherwise.
432 </p>
433 <div class="variablelist"><table border="0">
434 <col align="left" valign="top">
435 <tbody>
436 <tr>
437 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
438 <td>A <span class="type">CoglContext</span> pointer</td>
439 </tr>
440 <tr>
441 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
442 <td>A 0 terminated list of CoglFeatureIDs</td>
443 </tr>
444 <tr>
445 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
446 <td>
447 <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if all the features are available, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>
448 otherwise.</td>
449 </tr>
450 </tbody>
451 </table></div>
452 <p class="since">Since 1.10</p>
453 <p class="stability">Stability Level: Unstable</p>
454 </div>
455 <hr>
456 <div class="refsect2">
457 <a name="CoglFeatureCallback"></a><h3>CoglFeatureCallback ()</h3>
458 <pre class="programlisting"><span class="returnvalue">void</span>                (*CoglFeatureCallback)              (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglFeatureID" title="enum CoglFeatureID"><span class="type">CoglFeatureID</span></a> feature</code></em>,
459                                                          <em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
460 <p>
461 A callback used with <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-foreach-feature" title="cogl_foreach_feature ()"><code class="function">cogl_foreach_feature()</code></a> for enumerating all
462 context level features supported by Cogl.
463 </p>
464 <div class="variablelist"><table border="0">
465 <col align="left" valign="top">
466 <tbody>
467 <tr>
468 <td><p><span class="term"><em class="parameter"><code>feature</code></em> :</span></p></td>
469 <td>A single feature currently supported by Cogl</td>
470 </tr>
471 <tr>
472 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
473 <td>A private pointer passed to <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-foreach-feature" title="cogl_foreach_feature ()"><code class="function">cogl_foreach_feature()</code></a>.</td>
474 </tr>
475 </tbody>
476 </table></div>
477 <p class="since">Since 0.10</p>
478 <p class="stability">Stability Level: Unstable</p>
479 </div>
480 <hr>
481 <div class="refsect2">
482 <a name="cogl-foreach-feature"></a><h3>cogl_foreach_feature ()</h3>
483 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_foreach_feature                (<em class="parameter"><code><span class="type">CoglContext</span> *context</code></em>,
484                                                          <em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglFeatureCallback" title="CoglFeatureCallback ()"><span class="type">CoglFeatureCallback</span></a> callback</code></em>,
485                                                          <em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
486 <p>
487 Iterates through all the context level features currently supported
488 for a given <em class="parameter"><code>context</code></em> and for each feature <em class="parameter"><code>callback</code></em> is called.
489 </p>
490 <div class="variablelist"><table border="0">
491 <col align="left" valign="top">
492 <tbody>
493 <tr>
494 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
495 <td>A <span class="type">CoglContext</span> pointer</td>
496 </tr>
497 <tr>
498 <td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
499 <td>A <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglFeatureCallback" title="CoglFeatureCallback ()"><span class="type">CoglFeatureCallback</span></a> called for each supported feature</td>
500 </tr>
501 <tr>
502 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
503 <td>Private data to pass to the callback</td>
504 </tr>
505 </tbody>
506 </table></div>
507 <p class="since">Since 1.10</p>
508 <p class="stability">Stability Level: Unstable</p>
509 </div>
510 <hr>
511 <div class="refsect2">
512 <a name="cogl-push-matrix"></a><h3>cogl_push_matrix ()</h3>
513 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_push_matrix                    (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
514 <p>
515 Stores the current model-view matrix on the matrix stack. The matrix
516 can later be restored with <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-pop-matrix" title="cogl_pop_matrix ()"><code class="function">cogl_pop_matrix()</code></a>.
517 </p>
518 </div>
519 <hr>
520 <div class="refsect2">
521 <a name="cogl-pop-matrix"></a><h3>cogl_pop_matrix ()</h3>
522 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_pop_matrix                     (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
523 <p>
524 Restores the current model-view matrix from the matrix stack.
525 </p>
526 </div>
527 <hr>
528 <div class="refsect2">
529 <a name="cogl-scale"></a><h3>cogl_scale ()</h3>
530 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_scale                          (<em class="parameter"><code><span class="type">float</span> x</code></em>,
531                                                          <em class="parameter"><code><span class="type">float</span> y</code></em>,
532                                                          <em class="parameter"><code><span class="type">float</span> z</code></em>);</pre>
533 <p>
534 Multiplies the current model-view matrix by one that scales the x,
535 y and z axes by the given values.
536 </p>
537 <div class="variablelist"><table border="0">
538 <col align="left" valign="top">
539 <tbody>
540 <tr>
541 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
542 <td>Amount to scale along the x-axis</td>
543 </tr>
544 <tr>
545 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
546 <td>Amount to scale along the y-axis</td>
547 </tr>
548 <tr>
549 <td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
550 <td>Amount to scale along the z-axis</td>
551 </tr>
552 </tbody>
553 </table></div>
554 </div>
555 <hr>
556 <div class="refsect2">
557 <a name="cogl-translate"></a><h3>cogl_translate ()</h3>
558 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_translate                      (<em class="parameter"><code><span class="type">float</span> x</code></em>,
559                                                          <em class="parameter"><code><span class="type">float</span> y</code></em>,
560                                                          <em class="parameter"><code><span class="type">float</span> z</code></em>);</pre>
561 <p>
562 Multiplies the current model-view matrix by one that translates the
563 model along all three axes according to the given values.
564 </p>
565 <div class="variablelist"><table border="0">
566 <col align="left" valign="top">
567 <tbody>
568 <tr>
569 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
570 <td>Distance to translate along the x-axis</td>
571 </tr>
572 <tr>
573 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
574 <td>Distance to translate along the y-axis</td>
575 </tr>
576 <tr>
577 <td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
578 <td>Distance to translate along the z-axis</td>
579 </tr>
580 </tbody>
581 </table></div>
582 </div>
583 <hr>
584 <div class="refsect2">
585 <a name="cogl-rotate"></a><h3>cogl_rotate ()</h3>
586 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_rotate                         (<em class="parameter"><code><span class="type">float</span> angle</code></em>,
587                                                          <em class="parameter"><code><span class="type">float</span> x</code></em>,
588                                                          <em class="parameter"><code><span class="type">float</span> y</code></em>,
589                                                          <em class="parameter"><code><span class="type">float</span> z</code></em>);</pre>
590 <p>
591 Multiplies the current model-view matrix by one that rotates the
592 model around the vertex 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
593 follows the right-hand thumb rule so for example rotating by 10
594 degrees about the vertex (0, 0, 1) causes a small counter-clockwise
595 rotation.
596 </p>
597 <div class="variablelist"><table border="0">
598 <col align="left" valign="top">
599 <tbody>
600 <tr>
601 <td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
602 <td>Angle in degrees to rotate.</td>
603 </tr>
604 <tr>
605 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
606 <td>X-component of vertex to rotate around.</td>
607 </tr>
608 <tr>
609 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
610 <td>Y-component of vertex to rotate around.</td>
611 </tr>
612 <tr>
613 <td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
614 <td>Z-component of vertex to rotate around.</td>
615 </tr>
616 </tbody>
617 </table></div>
618 </div>
619 <hr>
620 <div class="refsect2">
621 <a name="cogl-transform"></a><h3>cogl_transform ()</h3>
622 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_transform                      (<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>
623 <p>
624 Multiplies the current model-view matrix by the given matrix.
625 </p>
626 <div class="variablelist"><table border="0">
627 <col align="left" valign="top">
628 <tbody><tr>
629 <td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
630 <td>the matrix to multiply with the current model-view</td>
631 </tr></tbody>
632 </table></div>
633 <p class="since">Since 1.4</p>
634 </div>
635 <hr>
636 <div class="refsect2">
637 <a name="cogl-frustum"></a><h3>cogl_frustum ()</h3>
638 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_frustum                        (<em class="parameter"><code><span class="type">float</span> left</code></em>,
639                                                          <em class="parameter"><code><span class="type">float</span> right</code></em>,
640                                                          <em class="parameter"><code><span class="type">float</span> bottom</code></em>,
641                                                          <em class="parameter"><code><span class="type">float</span> top</code></em>,
642                                                          <em class="parameter"><code><span class="type">float</span> z_near</code></em>,
643                                                          <em class="parameter"><code><span class="type">float</span> z_far</code></em>);</pre>
644 <p>
645 Replaces the current projection matrix with a perspective matrix
646 for a given viewing frustum defined by 4 side clip planes that
647 all cross through the origin and 2 near and far clip planes.
648 </p>
649 <div class="variablelist"><table border="0">
650 <col align="left" valign="top">
651 <tbody>
652 <tr>
653 <td><p><span class="term"><em class="parameter"><code>left</code></em> :</span></p></td>
654 <td>X position of the left clipping plane where it
655 intersects the near clipping plane</td>
656 </tr>
657 <tr>
658 <td><p><span class="term"><em class="parameter"><code>right</code></em> :</span></p></td>
659 <td>X position of the right clipping plane where it
660 intersects the near clipping plane</td>
661 </tr>
662 <tr>
663 <td><p><span class="term"><em class="parameter"><code>bottom</code></em> :</span></p></td>
664 <td>Y position of the bottom clipping plane where it
665 intersects the near clipping plane</td>
666 </tr>
667 <tr>
668 <td><p><span class="term"><em class="parameter"><code>top</code></em> :</span></p></td>
669 <td>Y position of the top clipping plane where it intersects
670 the near clipping plane</td>
671 </tr>
672 <tr>
673 <td><p><span class="term"><em class="parameter"><code>z_near</code></em> :</span></p></td>
674 <td>The distance to the near clipping plane (Must be positive)</td>
675 </tr>
676 <tr>
677 <td><p><span class="term"><em class="parameter"><code>z_far</code></em> :</span></p></td>
678 <td>The distance to the far clipping plane (Must be positive)</td>
679 </tr>
680 </tbody>
681 </table></div>
682 <p class="since">Since 0.8.2</p>
683 </div>
684 <hr>
685 <div class="refsect2">
686 <a name="cogl-perspective"></a><h3>cogl_perspective ()</h3>
687 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_perspective                    (<em class="parameter"><code><span class="type">float</span> fovy</code></em>,
688                                                          <em class="parameter"><code><span class="type">float</span> aspect</code></em>,
689                                                          <em class="parameter"><code><span class="type">float</span> z_near</code></em>,
690                                                          <em class="parameter"><code><span class="type">float</span> z_far</code></em>);</pre>
691 <p>
692 Replaces the current projection matrix with a perspective matrix
693 based on the provided values.
694 </p>
695 <p>
696 </p>
697 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
698 <h3 class="title">Note</h3>You should be careful not to have to great a <em class="parameter"><code>z_far</code></em> / <em class="parameter"><code>z_near</code></em>
699 ratio since that will reduce the effectiveness of depth testing
700 since there wont be enough precision to identify the depth of
701 objects near to each other.</div>
702 <p>
703 </p>
704 <div class="variablelist"><table border="0">
705 <col align="left" valign="top">
706 <tbody>
707 <tr>
708 <td><p><span class="term"><em class="parameter"><code>fovy</code></em> :</span></p></td>
709 <td>Vertical field of view angle in degrees.</td>
710 </tr>
711 <tr>
712 <td><p><span class="term"><em class="parameter"><code>aspect</code></em> :</span></p></td>
713 <td>The (width over height) aspect ratio for display</td>
714 </tr>
715 <tr>
716 <td><p><span class="term"><em class="parameter"><code>z_near</code></em> :</span></p></td>
717 <td>The distance to the near clipping plane (Must be positive)</td>
718 </tr>
719 <tr>
720 <td><p><span class="term"><em class="parameter"><code>z_far</code></em> :</span></p></td>
721 <td>The distance to the far clipping plane (Must be positive)</td>
722 </tr>
723 </tbody>
724 </table></div>
725 </div>
726 <hr>
727 <div class="refsect2">
728 <a name="cogl-ortho"></a><h3>cogl_ortho ()</h3>
729 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_ortho                          (<em class="parameter"><code><span class="type">float</span> left</code></em>,
730                                                          <em class="parameter"><code><span class="type">float</span> right</code></em>,
731                                                          <em class="parameter"><code><span class="type">float</span> bottom</code></em>,
732                                                          <em class="parameter"><code><span class="type">float</span> top</code></em>,
733                                                          <em class="parameter"><code><span class="type">float</span> near</code></em>,
734                                                          <em class="parameter"><code><span class="type">float</span> far</code></em>);</pre>
735 <p>
736 Replaces the current projection matrix with an orthographic projection
737 matrix. See <a class="xref" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-ortho-matrix" title="Figure 1. ">Figure 1, “”</a> to see how the matrix is
738 calculated.
739 </p>
740 <p>
741 </p>
742 <div class="figure">
743 <a name="cogl-ortho-matrix"></a><p class="title"><b>Figure 1. </b></p>
744 <div class="figure-contents"><div><img src="cogl_ortho.png"></div></div>
745 </div>
746 <p><br class="figure-break">
747 </p>
748 <p>
749 </p>
750 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
751 <h3 class="title">Note</h3>This function copies the arguments from OpenGL's <code class="function">glOrtho()</code> even
752 though they are unnecessarily confusing due to the z near and z far
753 arguments actually being a "distance" from the origin, where
754 negative values are behind the viewer, instead of coordinates for
755 the z clipping planes which would have been consistent with the
756 left, right bottom and top arguments.</div>
757 <p>
758 </p>
759 <div class="variablelist"><table border="0">
760 <col align="left" valign="top">
761 <tbody>
762 <tr>
763 <td><p><span class="term"><em class="parameter"><code>left</code></em> :</span></p></td>
764 <td>The coordinate for the left clipping plane</td>
765 </tr>
766 <tr>
767 <td><p><span class="term"><em class="parameter"><code>right</code></em> :</span></p></td>
768 <td>The coordinate for the right clipping plane</td>
769 </tr>
770 <tr>
771 <td><p><span class="term"><em class="parameter"><code>bottom</code></em> :</span></p></td>
772 <td>The coordinate for the bottom clipping plane</td>
773 </tr>
774 <tr>
775 <td><p><span class="term"><em class="parameter"><code>top</code></em> :</span></p></td>
776 <td>The coordinate for the top clipping plane</td>
777 </tr>
778 <tr>
779 <td><p><span class="term"><em class="parameter"><code>near</code></em> :</span></p></td>
780 <td>The <span class="emphasis"><em>distance</em></span> to the near clipping
781 plane (negative if the plane is behind the viewer)</td>
782 </tr>
783 <tr>
784 <td><p><span class="term"><em class="parameter"><code>far</code></em> :</span></p></td>
785 <td>The <span class="emphasis"><em>distance</em></span> for the far clipping
786 plane (negative if the plane is behind the viewer)</td>
787 </tr>
788 </tbody>
789 </table></div>
790 <p class="since">Since 1.0</p>
791 </div>
792 <hr>
793 <div class="refsect2">
794 <a name="cogl-get-modelview-matrix"></a><h3>cogl_get_modelview_matrix ()</h3>
795 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_get_modelview_matrix           (<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>
796 <p>
797 Stores the current model-view matrix in <em class="parameter"><code>matrix</code></em>.
798 </p>
799 <div class="variablelist"><table border="0">
800 <col align="left" valign="top">
801 <tbody><tr>
802 <td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
803 <td>return location for the model-view matrix. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
804 </td>
805 </tr></tbody>
806 </table></div>
807 </div>
808 <hr>
809 <div class="refsect2">
810 <a name="cogl-set-modelview-matrix"></a><h3>cogl_set_modelview_matrix ()</h3>
811 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_modelview_matrix           (<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>
812 <p>
813 Loads <em class="parameter"><code>matrix</code></em> as the new model-view matrix.
814 </p>
815 <div class="variablelist"><table border="0">
816 <col align="left" valign="top">
817 <tbody><tr>
818 <td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
819 <td>the new model-view matrix</td>
820 </tr></tbody>
821 </table></div>
822 </div>
823 <hr>
824 <div class="refsect2">
825 <a name="cogl-get-projection-matrix"></a><h3>cogl_get_projection_matrix ()</h3>
826 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_get_projection_matrix          (<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>
827 <p>
828 Stores the current projection matrix in <em class="parameter"><code>matrix</code></em>.
829 </p>
830 <div class="variablelist"><table border="0">
831 <col align="left" valign="top">
832 <tbody><tr>
833 <td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
834 <td>return location for the projection matrix. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
835 </td>
836 </tr></tbody>
837 </table></div>
838 </div>
839 <hr>
840 <div class="refsect2">
841 <a name="cogl-set-projection-matrix"></a><h3>cogl_set_projection_matrix ()</h3>
842 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_projection_matrix          (<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>
843 <p>
844 Loads matrix as the new projection matrix.
845 </p>
846 <div class="variablelist"><table border="0">
847 <col align="left" valign="top">
848 <tbody><tr>
849 <td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
850 <td>the new projection matrix</td>
851 </tr></tbody>
852 </table></div>
853 </div>
854 <hr>
855 <div class="refsect2">
856 <a name="cogl-set-viewport"></a><h3>cogl_set_viewport ()</h3>
857 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_viewport                   (<em class="parameter"><code><span class="type">int</span> x</code></em>,
858                                                          <em class="parameter"><code><span class="type">int</span> y</code></em>,
859                                                          <em class="parameter"><code><span class="type">int</span> width</code></em>,
860                                                          <em class="parameter"><code><span class="type">int</span> height</code></em>);</pre>
861 <p>
862 Replaces the current viewport with the given values.
863 </p>
864 <div class="variablelist"><table border="0">
865 <col align="left" valign="top">
866 <tbody>
867 <tr>
868 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
869 <td>X offset of the viewport</td>
870 </tr>
871 <tr>
872 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
873 <td>Y offset of the viewport</td>
874 </tr>
875 <tr>
876 <td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
877 <td>Width of the viewport</td>
878 </tr>
879 <tr>
880 <td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
881 <td>Height of the viewport</td>
882 </tr>
883 </tbody>
884 </table></div>
885 <p class="since">Since 1.2</p>
886 </div>
887 <hr>
888 <div class="refsect2">
889 <a name="cogl-get-viewport"></a><h3>cogl_get_viewport ()</h3>
890 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_get_viewport                   (<em class="parameter"><code><span class="type">float</span> v[4]</code></em>);</pre>
891 <p>
892 Stores the current viewport in <em class="parameter"><code>v</code></em>. <em class="parameter"><code>v</code></em>[0] and <em class="parameter"><code>v</code></em>[1] get the x and y
893 position of the viewport and <em class="parameter"><code>v</code></em>[2] and <em class="parameter"><code>v</code></em>[3] get the width and
894 height.
895 </p>
896 <div class="variablelist"><table border="0">
897 <col align="left" valign="top">
898 <tbody><tr>
899 <td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
900 <td>pointer to a 4 element array
901 of <span class="type">float</span>s to receive the viewport dimensions. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> fixed-size=4]</span>
902 </td>
903 </tr></tbody>
904 </table></div>
905 </div>
906 <hr>
907 <div class="refsect2">
908 <a name="cogl-set-source"></a><h3>cogl_set_source ()</h3>
909 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_source                     (<em class="parameter"><code><span class="type">void</span> *material</code></em>);</pre>
910 <p>
911 This function changes the material at the top of the source stack.
912 The material at the top of this stack defines the GPU state used to
913 process subsequent primitives, such as rectangles drawn with
914 <a class="link" href="cogl-2.0-experimental-Rectangles.html#cogl-rectangle" title="cogl_rectangle ()"><code class="function">cogl_rectangle()</code></a> or vertices drawn using <a href="../cogl/cogl-Vertex-Buffers.html#cogl-vertex-buffer-draw"><code class="function">cogl_vertex_buffer_draw()</code></a>.
915 </p>
916 <div class="variablelist"><table border="0">
917 <col align="left" valign="top">
918 <tbody><tr>
919 <td><p><span class="term"><em class="parameter"><code>material</code></em> :</span></p></td>
920 <td>A <a href="../cogl/cogl-Materials.html#CoglMaterial"><span class="type">CoglMaterial</span></a>
921 </td>
922 </tr></tbody>
923 </table></div>
924 <p class="since">Since 1.0</p>
925 </div>
926 <hr>
927 <div class="refsect2">
928 <a name="cogl-set-source-color"></a><h3>cogl_set_source_color ()</h3>
929 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_source_color               (<em class="parameter"><code>const <a class="link" href="cogl-2.0-experimental-Color-Type.html#CoglColor" title="struct CoglColor"><span class="type">CoglColor</span></a> *color</code></em>);</pre>
930 <p>
931 This is a convenience function for creating a solid fill source material
932 from the given color. This color will be used for any subsequent drawing
933 operation.
934 </p>
935 <p>
936 The color will be premultiplied by Cogl, so the color should be
937 non-premultiplied. For example: use (1.0, 0.0, 0.0, 0.5) for
938 semi-transparent red.
939 </p>
940 <p>
941 See also <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-set-source-color4ub" title="cogl_set_source_color4ub ()"><code class="function">cogl_set_source_color4ub()</code></a> and <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-set-source-color4f" title="cogl_set_source_color4f ()"><code class="function">cogl_set_source_color4f()</code></a>
942 if you already have the color components.
943 </p>
944 <div class="variablelist"><table border="0">
945 <col align="left" valign="top">
946 <tbody><tr>
947 <td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
948 <td>a <a class="link" href="cogl-2.0-experimental-Color-Type.html#CoglColor" title="struct CoglColor"><span class="type">CoglColor</span></a>
949 </td>
950 </tr></tbody>
951 </table></div>
952 <p class="since">Since 1.0</p>
953 </div>
954 <hr>
955 <div class="refsect2">
956 <a name="cogl-set-source-color4ub"></a><h3>cogl_set_source_color4ub ()</h3>
957 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_source_color4ub            (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> red</code></em>,
958                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> green</code></em>,
959                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> blue</code></em>,
960                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> alpha</code></em>);</pre>
961 <p>
962 This is a convenience function for creating a solid fill source material
963 from the given color using unsigned bytes for each component. This
964 color will be used for any subsequent drawing operation.
965 </p>
966 <p>
967 The value for each component is an unsigned byte in the range
968 between 0 and 255.
969 </p>
970 <div class="variablelist"><table border="0">
971 <col align="left" valign="top">
972 <tbody>
973 <tr>
974 <td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
975 <td>value of the red channel, between 0 and 255</td>
976 </tr>
977 <tr>
978 <td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
979 <td>value of the green channel, between 0 and 255</td>
980 </tr>
981 <tr>
982 <td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
983 <td>value of the blue channel, between 0 and 255</td>
984 </tr>
985 <tr>
986 <td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
987 <td>value of the alpha channel, between 0 and 255</td>
988 </tr>
989 </tbody>
990 </table></div>
991 <p class="since">Since 1.0</p>
992 </div>
993 <hr>
994 <div class="refsect2">
995 <a name="cogl-set-source-color4f"></a><h3>cogl_set_source_color4f ()</h3>
996 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_source_color4f             (<em class="parameter"><code><span class="type">float</span> red</code></em>,
997                                                          <em class="parameter"><code><span class="type">float</span> green</code></em>,
998                                                          <em class="parameter"><code><span class="type">float</span> blue</code></em>,
999                                                          <em class="parameter"><code><span class="type">float</span> alpha</code></em>);</pre>
1000 <p>
1001 This is a convenience function for creating a solid fill source material
1002 from the given color using normalized values for each component. This color
1003 will be used for any subsequent drawing operation.
1004 </p>
1005 <p>
1006 The value for each component is a fixed point number in the range
1007 between 0 and <code class="literal">1</code>.0. If the values passed in are outside that
1008 range, they will be clamped.
1009 </p>
1010 <div class="variablelist"><table border="0">
1011 <col align="left" valign="top">
1012 <tbody>
1013 <tr>
1014 <td><p><span class="term"><em class="parameter"><code>red</code></em> :</span></p></td>
1015 <td>value of the red channel, between 0 and <code class="literal">1</code>.0</td>
1016 </tr>
1017 <tr>
1018 <td><p><span class="term"><em class="parameter"><code>green</code></em> :</span></p></td>
1019 <td>value of the green channel, between 0 and <code class="literal">1</code>.0</td>
1020 </tr>
1021 <tr>
1022 <td><p><span class="term"><em class="parameter"><code>blue</code></em> :</span></p></td>
1023 <td>value of the blue channel, between 0 and <code class="literal">1</code>.0</td>
1024 </tr>
1025 <tr>
1026 <td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
1027 <td>value of the alpha channel, between 0 and <code class="literal">1</code>.0</td>
1028 </tr>
1029 </tbody>
1030 </table></div>
1031 <p class="since">Since 1.0</p>
1032 </div>
1033 <hr>
1034 <div class="refsect2">
1035 <a name="cogl-set-source-texture"></a><h3>cogl_set_source_texture ()</h3>
1036 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_set_source_texture             (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Texture-Interface.html#CoglTexture" title="CoglTexture"><span class="type">CoglTexture</span></a> *texture</code></em>);</pre>
1037 <p>
1038 This is a convenience function for creating a material with the first
1039 layer set to <em class="parameter"><code>texture</code></em> and setting that material as the source with
1040 cogl_set_source.
1041 </p>
1042 <p>
1043 Note: There is no interaction between calls to cogl_set_source_color
1044 and cogl_set_source_texture. If you need to blend a texture with a color then
1045 you can create a simple material like this:
1046 </p>
1047 <pre class="programlisting">
1048 material = cogl_material_new ();
1049 cogl_material_set_color4ub (material, 0xff, 0x00, 0x00, 0x80);
1050 cogl_material_set_layer (material, 0, tex_handle);
1051 cogl_set_source (material);
1052 </pre>
1053 <p>
1054 </p>
1055 <div class="variablelist"><table border="0">
1056 <col align="left" valign="top">
1057 <tbody><tr>
1058 <td><p><span class="term"><em class="parameter"><code>texture</code></em> :</span></p></td>
1059 <td>The <a class="link" href="cogl-2.0-experimental-The-Texture-Interface.html#CoglTexture" title="CoglTexture"><span class="type">CoglTexture</span></a> you want as your source</td>
1060 </tr></tbody>
1061 </table></div>
1062 <p class="since">Since 1.0</p>
1063 </div>
1064 <hr>
1065 <div class="refsect2">
1066 <a name="cogl-get-source"></a><h3>cogl_get_source ()</h3>
1067 <pre class="programlisting"><span class="returnvalue">void</span> *              cogl_get_source                     (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
1068 <p>
1069 Returns the current source material as previously set using
1070 <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-set-source" title="cogl_set_source ()"><code class="function">cogl_set_source()</code></a>.
1071 </p>
1072 <p>
1073 </p>
1074 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1075 <h3 class="title">Note</h3>You should typically consider the returned material immutable
1076 and not try to change any of its properties unless you own a
1077 reference to that material. At times you may be able to get a
1078 reference to an internally managed materials and the result of
1079 modifying such materials is undefined.</div>
1080 <p>
1081 </p>
1082 <div class="variablelist"><table border="0">
1083 <col align="left" valign="top">
1084 <tbody><tr>
1085 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1086 <td>The current source material.</td>
1087 </tr></tbody>
1088 </table></div>
1089 <p class="since">Since 1.6</p>
1090 </div>
1091 <hr>
1092 <div class="refsect2">
1093 <a name="cogl-push-source"></a><h3>cogl_push_source ()</h3>
1094 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_push_source                    (<em class="parameter"><code><span class="type">void</span> *material</code></em>);</pre>
1095 <p>
1096 Pushes the given <em class="parameter"><code>material</code></em> to the top of the source stack. The
1097 material at the top of this stack defines the GPU state used to
1098 process later primitives as defined by <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-set-source" title="cogl_set_source ()"><code class="function">cogl_set_source()</code></a>.
1099 </p>
1100 <div class="variablelist"><table border="0">
1101 <col align="left" valign="top">
1102 <tbody><tr>
1103 <td><p><span class="term"><em class="parameter"><code>material</code></em> :</span></p></td>
1104 <td>A <a href="../cogl/cogl-Materials.html#CoglMaterial"><span class="type">CoglMaterial</span></a>
1105 </td>
1106 </tr></tbody>
1107 </table></div>
1108 <p class="since">Since 1.6</p>
1109 </div>
1110 <hr>
1111 <div class="refsect2">
1112 <a name="cogl-pop-source"></a><h3>cogl_pop_source ()</h3>
1113 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_pop_source                     (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
1114 <p>
1115 Removes the material at the top of the source stack. The material
1116 at the top of this stack defines the GPU state used to process
1117 later primitives as defined by <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-set-source" title="cogl_set_source ()"><code class="function">cogl_set_source()</code></a>.
1118 </p>
1119 <p class="since">Since 1.6</p>
1120 </div>
1121 <hr>
1122 <div class="refsect2">
1123 <a name="COGL-TYPE-BUFFER-BIT:CAPS"></a><h3>COGL_TYPE_BUFFER_BIT</h3>
1124 <pre class="programlisting">#define COGL_TYPE_BUFFER_BIT (cogl_buffer_bit_get_type())
1125 </pre>
1126 </div>
1127 <hr>
1128 <div class="refsect2">
1129 <a name="cogl-clear"></a><h3>cogl_clear ()</h3>
1130 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_clear                          (<em class="parameter"><code>const <a class="link" href="cogl-2.0-experimental-Color-Type.html#CoglColor" title="struct CoglColor"><span class="type">CoglColor</span></a> *color</code></em>,
1131                                                          <em class="parameter"><code><span class="type">unsigned long </span> buffers</code></em>);</pre>
1132 <p>
1133 Clears all the auxiliary buffers identified in the <em class="parameter"><code>buffers</code></em> mask, and if
1134 that includes the color buffer then the specified <em class="parameter"><code>color</code></em> is used.
1135 </p>
1136 <div class="variablelist"><table border="0">
1137 <col align="left" valign="top">
1138 <tbody>
1139 <tr>
1140 <td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
1141 <td>Background color to clear to</td>
1142 </tr>
1143 <tr>
1144 <td><p><span class="term"><em class="parameter"><code>buffers</code></em> :</span></p></td>
1145 <td>A mask of <a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglBufferBit" title="enum CoglBufferBit"><span class="type">CoglBufferBit</span></a>'s identifying which auxiliary
1146 buffers to clear</td>
1147 </tr>
1148 </tbody>
1149 </table></div>
1150 </div>
1151 <hr>
1152 <div class="refsect2">
1153 <a name="CoglReadPixelsFlags"></a><h3>enum CoglReadPixelsFlags</h3>
1154 <pre class="programlisting">typedef enum {
1155  /*&lt; prefix=COGL_READ_PIXELS &gt;*/
1156   COGL_READ_PIXELS_COLOR_BUFFER = 1L &lt;&lt; 0
1157 } CoglReadPixelsFlags;
1158 </pre>
1159 <p>
1160 Flags for <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#cogl-read-pixels" title="cogl_read_pixels ()"><code class="function">cogl_read_pixels()</code></a>
1161 </p>
1162 <div class="variablelist"><table border="0">
1163 <col align="left" valign="top">
1164 <tbody><tr>
1165 <td><p><a name="COGL-READ-PIXELS-COLOR-BUFFER:CAPS"></a><span class="term"><code class="literal">COGL_READ_PIXELS_COLOR_BUFFER</code></span></p></td>
1166 <td>Read from the color buffer
1167 </td>
1168 </tr></tbody>
1169 </table></div>
1170 <p class="since">Since 1.0</p>
1171 </div>
1172 <hr>
1173 <div class="refsect2">
1174 <a name="cogl-read-pixels"></a><h3>cogl_read_pixels ()</h3>
1175 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_read_pixels                    (<em class="parameter"><code><span class="type">int</span> x</code></em>,
1176                                                          <em class="parameter"><code><span class="type">int</span> y</code></em>,
1177                                                          <em class="parameter"><code><span class="type">int</span> width</code></em>,
1178                                                          <em class="parameter"><code><span class="type">int</span> height</code></em>,
1179                                                          <em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglReadPixelsFlags" title="enum CoglReadPixelsFlags"><span class="type">CoglReadPixelsFlags</span></a> source</code></em>,
1180                                                          <em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> format</code></em>,
1181                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *pixels</code></em>);</pre>
1182 <p>
1183 This reads a rectangle of pixels from the current framebuffer where
1184 position (0, 0) is the top left. The pixel at (x, y) is the first
1185 read, and the data is returned with a rowstride of (width * 4).
1186 </p>
1187 <p>
1188 Currently Cogl assumes that the framebuffer is in a premultiplied
1189 format so if <em class="parameter"><code>format</code></em> is non-premultiplied it will convert it. To
1190 read the pixel values without any conversion you should either
1191 specify a format that doesn't use an alpha channel or use one of
1192 the formats ending in PRE.
1193 </p>
1194 <div class="variablelist"><table border="0">
1195 <col align="left" valign="top">
1196 <tbody>
1197 <tr>
1198 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
1199 <td>The window x position to start reading from</td>
1200 </tr>
1201 <tr>
1202 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
1203 <td>The window y position to start reading from</td>
1204 </tr>
1205 <tr>
1206 <td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
1207 <td>The width of the rectangle you want to read</td>
1208 </tr>
1209 <tr>
1210 <td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
1211 <td>The height of the rectangle you want to read</td>
1212 </tr>
1213 <tr>
1214 <td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
1215 <td>Identifies which auxillary buffer you want to read
1216 (only COGL_READ_PIXELS_COLOR_BUFFER supported currently)</td>
1217 </tr>
1218 <tr>
1219 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
1220 <td>The pixel format you want the result in
1221 (only COGL_PIXEL_FORMAT_RGBA_8888 supported currently)</td>
1222 </tr>
1223 <tr>
1224 <td><p><span class="term"><em class="parameter"><code>pixels</code></em> :</span></p></td>
1225 <td>The location to write the pixel data.</td>
1226 </tr>
1227 </tbody>
1228 </table></div>
1229 </div>
1230 <hr>
1231 <div class="refsect2">
1232 <a name="cogl-flush"></a><h3>cogl_flush ()</h3>
1233 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_flush                          (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
1234 <p>
1235 This function should only need to be called in exceptional circumstances.
1236 </p>
1237 <p>
1238 As an optimization Cogl drawing functions may batch up primitives
1239 internally, so if you are trying to use raw GL outside of Cogl you stand a
1240 better chance of being successful if you ask Cogl to flush any batched
1241 geometry before making your state changes.
1242 </p>
1243 <p>
1244 It only ensure that the underlying driver is issued all the commands
1245 necessary to draw the batched primitives. It provides no guarantees about
1246 when the driver will complete the rendering.
1247 </p>
1248 <p>
1249 This provides no guarantees about the GL state upon returning and to avoid
1250 confusing Cogl you should aim to restore any changes you make before
1251 resuming use of Cogl.
1252 </p>
1253 <p>
1254 If you are making state changes with the intention of affecting Cogl drawing
1255 primitives you are 100% on your own since you stand a good chance of
1256 conflicting with Cogl internals. For example clutter-gst which currently
1257 uses direct GL calls to bind ARBfp programs will very likely break when Cogl
1258 starts to use ARBfb programs itself for the material API.
1259 </p>
1260 <p class="since">Since 1.0</p>
1261 </div>
1262 </div>
1263 </div>
1264 <div class="footer">
1265 <hr>
1266           Generated by GTK-Doc V1.18.1</div>
1267 </body>
1268 </html>