File: v-sim-light.html

package info (click to toggle)
v-sim 3.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 15,860 kB
  • sloc: ansic: 75,222; sh: 10,239; makefile: 580; python: 572; cpp: 353; xml: 130
file content (341 lines) | stat: -rw-r--r-- 20,755 bytes parent folder | download
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>light</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="V_Sim API - Reference Manual">
<link rel="up" href="ch03.html" title="OpenGL tools">
<link rel="prev" href="v-sim-renderingMode.html" title="renderingMode">
<link rel="next" href="v-sim-text.html" title="text">
<meta name="generator" content="GTK-Doc V1.14 (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="v-sim-renderingMode.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch03.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">V_Sim API - Reference Manual</th>
<td><a accesskey="n" href="v-sim-text.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#v-sim-light.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#v-sim-light.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="light">
<a name="v-sim-light"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="v-sim-light.top_of_page"></a>light</span></h2>
<p>light — Controls the use of lights in the rendering
window.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="v-sim-light.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">struct              <a class="link" href="v-sim-light.html#lightEnvironnement-struct" title="struct lightEnvironnement_struct">lightEnvironnement_struct</a>;
typedef             <a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement">LightEnvironnement</a>;
<a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="returnvalue">LightEnvironnement</span></a>* <a class="link" href="v-sim-light.html#lightEnvironnement-new" title="lightEnvironnement_new ()">lightEnvironnement_new</a>              ();
<span class="returnvalue">void</span>                <a class="link" href="v-sim-light.html#lightEnvironnementFree" title="lightEnvironnementFree ()">lightEnvironnementFree</a>              (<em class="parameter"><code><a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> *env</code></em>);
enum                <a class="link" href="v-sim-light.html#Material" title="enum Material">Material</a>;
typedef             <a class="link" href="v-sim-light.html#Light" title="Light">Light</a>;
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="v-sim-light.html#lightEnvironnementAdd-light" title="lightEnvironnementAdd_light ()">lightEnvironnementAdd_light</a>         (<em class="parameter"><code><a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> *env</code></em>,
                                                         <em class="parameter"><code><a class="link" href="v-sim-light.html#Light" title="Light"><span class="type">Light</span></a> *light</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="v-sim-light.html#lightEnvironnementDelete-light" title="lightEnvironnementDelete_light ()">lightEnvironnementDelete_light</a>      (<em class="parameter"><code><a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> *env</code></em>,
                                                         <em class="parameter"><code><a class="link" href="v-sim-light.html#Light" title="Light"><span class="type">Light</span></a> *light</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a>*              <a class="link" href="v-sim-light.html#lightEnvironnementGet-lightList" title="lightEnvironnementGet_lightList ()">lightEnvironnementGet_lightList</a>     (<em class="parameter"><code><a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> *env</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="v-sim-light.html#lightEnvironnementEmpty-lightList" title="lightEnvironnementEmpty_lightList ()">lightEnvironnementEmpty_lightList</a>   (<em class="parameter"><code><a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> *env</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="v-sim-light.html#lightEnvironnementApply" title="lightEnvironnementApply ()">lightEnvironnementApply</a>             (<em class="parameter"><code><a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> *env</code></em>);
<a class="link" href="v-sim-light.html#Light" title="Light"><span class="returnvalue">Light</span></a>*              <a class="link" href="v-sim-light.html#light-newDefault" title="light_newDefault ()">light_newDefault</a>                    ();
</pre>
</div>
<div class="refsect1" title="Description">
<a name="v-sim-light.description"></a><h2>Description</h2>
<p>
</p>
<p>One can defines several lights in OpenGL. The
<a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> is an object that stores several of them and
that can be applied to the current OpenGL context using
<a class="link" href="v-sim-light.html#lightEnvironnementApply" title="lightEnvironnementApply ()"><code class="function">lightEnvironnementApply()</code></a>. The lights that are created with
<a class="link" href="v-sim-light.html#light-newDefault" title="light_newDefault ()"><code class="function">light_newDefault()</code></a> are ambiant light with a white colour. The
multiplier coefficient is use to soften lights when several are
used together. It is used as a factor for all light parameters
(ambient, diffuse...) ecept the specular one.</p>
<p>
</p>
</div>
<div class="refsect1" title="Details">
<a name="v-sim-light.details"></a><h2>Details</h2>
<div class="refsect2" title="struct lightEnvironnement_struct">
<a name="lightEnvironnement-struct"></a><h3>struct lightEnvironnement_struct</h3>
<pre class="programlisting">struct lightEnvironnement_struct;</pre>
<p>
An opaque structure to allow an OpenGL context to manage and use several lights.
</p>
</div>
<hr>
<div class="refsect2" title="LightEnvironnement">
<a name="LightEnvironnement"></a><h3>LightEnvironnement</h3>
<pre class="programlisting">typedef struct lightEnvironnement_struct LightEnvironnement;
</pre>
<p>
A short way to access <a class="link" href="v-sim-light.html#lightEnvironnement-struct" title="struct lightEnvironnement_struct"><span class="type">lightEnvironnement_struct</span></a> objects.
</p>
</div>
<hr>
<div class="refsect2" title="lightEnvironnement_new ()">
<a name="lightEnvironnement-new"></a><h3>lightEnvironnement_new ()</h3>
<pre class="programlisting"><a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="returnvalue">LightEnvironnement</span></a>* lightEnvironnement_new              ();</pre>
<p>
Create a new <a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> object. It contains no light when created.
Use <a class="link" href="v-sim-light.html#lightEnvironnementAdd-light" title="lightEnvironnementAdd_light ()"><code class="function">lightEnvironnementAdd_light()</code></a> to add new lights and
<a class="link" href="v-sim-light.html#lightEnvironnementDelete-light" title="lightEnvironnementDelete_light ()"><code class="function">lightEnvironnementDelete_light()</code></a> to remove others.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a newly created <a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a>. Use <a class="link" href="v-sim-light.html#lightEnvironnementFree" title="lightEnvironnementFree ()"><code class="function">lightEnvironnementFree()</code></a>
         to free such an object.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="lightEnvironnementFree ()">
<a name="lightEnvironnementFree"></a><h3>lightEnvironnementFree ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                lightEnvironnementFree              (<em class="parameter"><code><a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> *env</code></em>);</pre>
<p>
Free memory occupied by the given environnement.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>env</code></em> :</span></p></td>
<td>a <a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> object.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enum Material">
<a name="Material"></a><h3>enum Material</h3>
<pre class="programlisting">typedef enum
  {
    material_amb,
    material_dif,
    material_shi,
    material_spe,
    material_emi,
    nb_material
  } Material;
</pre>
<p>
This enum is used to address the OpenGL parameters for light rendering.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="material-amb"></a><span class="term"><code class="literal">material_amb</code></span></p></td>
<td>the ambient identifier ;
</td>
</tr>
<tr>
<td><p><a name="material-dif"></a><span class="term"><code class="literal">material_dif</code></span></p></td>
<td>the diffuse identifier ;
</td>
</tr>
<tr>
<td><p><a name="material-shi"></a><span class="term"><code class="literal">material_shi</code></span></p></td>
<td>the shiningness identifier ;
</td>
</tr>
<tr>
<td><p><a name="material-spe"></a><span class="term"><code class="literal">material_spe</code></span></p></td>
<td>the specular identifier ;
</td>
</tr>
<tr>
<td><p><a name="material-emi"></a><span class="term"><code class="literal">material_emi</code></span></p></td>
<td>the emissivity identifier ;
</td>
</tr>
<tr>
<td><p><a name="nb-material"></a><span class="term"><code class="literal">nb_material</code></span></p></td>
<td>number of used material identifiers.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="Light">
<a name="Light"></a><h3>Light</h3>
<pre class="programlisting">typedef struct light_struct Light;
</pre>
<p>
A short name for <a href="v-sim-light.html#light-struct"><span class="type">light_struct</span></a> objects.
</p>
</div>
<hr>
<div class="refsect2" title="lightEnvironnementAdd_light ()">
<a name="lightEnvironnementAdd-light"></a><h3>lightEnvironnementAdd_light ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            lightEnvironnementAdd_light         (<em class="parameter"><code><a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> *env</code></em>,
                                                         <em class="parameter"><code><a class="link" href="v-sim-light.html#Light" title="Light"><span class="type">Light</span></a> *light</code></em>);</pre>
<p>
This method adds the given <em class="parameter"><code>light</code></em> to the list of known lights declared
in the given environnement. The light is not copied and should not be freed
when stored in the environnement.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>env</code></em> :</span></p></td>
<td>a <a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> object ;
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>light</code></em> :</span></p></td>
<td>a <a class="link" href="v-sim-light.html#Light" title="Light"><span class="type">Light</span></a> object.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> TRUE if <a class="link" href="v-sim-light.html#lightEnvironnementApply" title="lightEnvironnementApply ()"><code class="function">lightEnvironnementApply()</code></a> should be called.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="lightEnvironnementDelete_light ()">
<a name="lightEnvironnementDelete-light"></a><h3>lightEnvironnementDelete_light ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            lightEnvironnementDelete_light      (<em class="parameter"><code><a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> *env</code></em>,
                                                         <em class="parameter"><code><a class="link" href="v-sim-light.html#Light" title="Light"><span class="type">Light</span></a> *light</code></em>);</pre>
<p>
This method removes the given <em class="parameter"><code>light</code></em> from the list of known lights  declared
in the given environnement. The <em class="parameter"><code>light</code></em> argument is first removed and then freed
by a call to <a href="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>env</code></em> :</span></p></td>
<td>a <a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> object ;
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>light</code></em> :</span></p></td>
<td>a <a class="link" href="v-sim-light.html#Light" title="Light"><span class="type">Light</span></a> object.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> TRUE if <a class="link" href="v-sim-light.html#lightEnvironnementApply" title="lightEnvironnementApply ()"><code class="function">lightEnvironnementApply()</code></a> should be called.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="lightEnvironnementGet_lightList ()">
<a name="lightEnvironnementGet-lightList"></a><h3>lightEnvironnementGet_lightList ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a>*              lightEnvironnementGet_lightList     (<em class="parameter"><code><a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> *env</code></em>);</pre>
<p>
Retrieve the list of known <a class="link" href="v-sim-light.html#Light" title="Light"><span class="type">Light</span></a> used by the given environnement.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>env</code></em> :</span></p></td>
<td>a <a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> object.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a list of <a class="link" href="v-sim-light.html#Light" title="Light"><span class="type">Light</span></a> objects. Should not be freed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="lightEnvironnementEmpty_lightList ()">
<a name="lightEnvironnementEmpty-lightList"></a><h3>lightEnvironnementEmpty_lightList ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            lightEnvironnementEmpty_lightList   (<em class="parameter"><code><a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> *env</code></em>);</pre>
<p>
Empty the list of stored lights. All stored lights objects are freed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>env</code></em> :</span></p></td>
<td>a <a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> object.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> TRUE if the <a class="link" href="v-sim-light.html#lightEnvironnementApply" title="lightEnvironnementApply ()"><code class="function">lightEnvironnementApply()</code></a> should be called.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="lightEnvironnementApply ()">
<a name="lightEnvironnementApply"></a><h3>lightEnvironnementApply ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            lightEnvironnementApply             (<em class="parameter"><code><a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> *env</code></em>);</pre>
<p>
Apply all stored informations about lights to the current OpenGL context.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>env</code></em> :</span></p></td>
<td>a <a class="link" href="v-sim-light.html#LightEnvironnement" title="LightEnvironnement"><span class="type">LightEnvironnement</span></a> object.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> TRUE if the "OpenGLAskForReDraw" signal should be
         emitted after a call to this method.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="light_newDefault ()">
<a name="light-newDefault"></a><h3>light_newDefault ()</h3>
<pre class="programlisting"><a class="link" href="v-sim-light.html#Light" title="Light"><span class="returnvalue">Light</span></a>*              light_newDefault                    ();</pre>
<p>
Create a new light with default value (white color and position in
the front, right, top position of the screen).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the newly created <a class="link" href="v-sim-light.html#Light" title="Light"><span class="type">Light</span></a>. Use <a href="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a> to deallocate this light.
</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.14</div>
</body>
</html>