This file is indexed.

/usr/share/doc/s3d/ch02s02.html is in s3d-doc 0.2.2-9.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>function reference</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><meta name="keywords" content="s3d, API, handbook, guide" /><link rel="home" href="index.html" title="S3D - a 3D Desktop Environment" /><link rel="up" href="ch02.html" title="Chapter&#160;2.&#160;libs3d - The S3D API" /><link rel="prev" href="ch02.html" title="Chapter&#160;2.&#160;libs3d - The S3D API" /><link rel="next" href="ch02s03.html" title="Data types" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">function reference</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;2.&#160;libs3d - The S3D API</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch02s03.html">Next</a></td></tr></table><hr /></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="functions"></a>function reference</h2></div></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_usage"></a>s3d_usage</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">s3d_usage</strong>(</code></td><td><code>void)</code>;</td><td>&#160;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Prints the possible parameter for the client library (which can be passed in <a class="link" href="ch02s02.html#s3d_init" title="s3d_init">s3d_init</a>())         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_init"></a>s3d_init</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_init</strong>(</code></td><td>int *<var class="pdparam">argc</var>, </td></tr><tr><td>&#160;</td><td>char ***<var class="pdparam">argv</var>, </td></tr><tr><td>&#160;</td><td>const char *<var class="pdparam">name</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>This will initialize the s3d-library and the connection to the Server. It will return 0 on success in server initialization. name specifies the your programs name.</p><pre class="programlisting"> int main(char argc, char **argv)
 {
         if (!<a class="link" href="ch02s02.html#s3d_init" title="s3d_init">s3d_init</a>(&amp;argc, &amp;argv, "Hello world"))
         {
                 ...
                 <a class="link" href="ch02s02.html#s3d_quit" title="s3d_quit">s3d_quit</a>();
         }
         return 0;
 }
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_quit"></a>s3d_quit</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_quit</strong>(</code></td><td><code>void)</code>;</td><td>&#160;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Closes the connection and clears the event-stack. It can also be used to leave the <a class="link" href="ch02s02.html#s3d_mainloop" title="s3d_mainloop">s3d_mainloop</a>().         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_mainloop"></a>s3d_mainloop</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_mainloop</strong>(</code></td><td>void(*)(void) <var class="pdparam">f</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Takes a function as argument. It will loop this function until a quit-event is received. You can pass NULL if you have no function to be looped, but its better to sleep some time if you have nothing to do anyway to save cpu-time.</p><pre class="programlisting"> void mainloop(void)
 {
         usleep(1000); // sleep 1 ms in every cycle
 }
 ...

 <a class="link" href="ch02s02.html#s3d_mainloop" title="s3d_mainloop">s3d_mainloop</a>(mainloop());
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_push_vertex"></a>s3d_push_vertex</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_push_vertex</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">x</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">y</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">z</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Pushes a vertex onto the vertex stack. Make sure that you count how many vertices you've pushed because you'll need that for referencing when you push your polygons.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_push_vertices"></a>s3d_push_vertices</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_push_vertices</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const float *<var class="pdparam">vbuf</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Push some vertices from an array. that's much better for performing than using <a class="link" href="ch02s02.html#s3d_push_vertex" title="s3d_push_vertex">s3d_push_vertex</a>() if you have a lot of vertices (and that's probably the usual case). </p><pre class="programlisting"> float vertices[] = { 0.0, 0.0, 0.0,
                      1.0, 2.0, 3.0,
                      3.0, 2.0, 1.0};
 <a class="link" href="ch02s02.html#s3d_push_vertices" title="s3d_push_vertices">s3d_push_vertices</a>(object, vertices, 3); // pushing 3 vertices
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_push_material"></a>s3d_push_material</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_push_material</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_r</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_g</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_b</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_r</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_g</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_b</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_r</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_g</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_b</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Pushes a material for an object. you will have to count them yourself too, as polygons will ask for the material index number. The material properties are given in rgb (red/green/blue) color codes, in float. 0.0 is the minimum, 1.0 is the maximum a color value can be. The specular color is the color which is directly reflected from the light source. The diffuse color is the color which can be seen in the bright side of the object, and the ambience color is the color of the shadow side of the object.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pep_material"></a>s3d_pep_material</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pep_material</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_r</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_g</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_b</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_r</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_g</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_b</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_r</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_g</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_b</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Overwriting the latest pushed material, overwriting the current value with the specified one. See <a class="link" href="ch02s02.html#s3d_pep_materials_a" title="s3d_pep_materials_a">s3d_pep_materials_a</a> if you want to pep more materials.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_push_material_a"></a>s3d_push_material_a</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_push_material_a</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_r</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_g</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_b</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_a</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_r</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_g</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_b</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_a</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_r</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_g</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_b</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_a</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Same as <a class="link" href="ch02s02.html#s3d_push_material" title="s3d_push_material">s3d_push_material</a>, but color has alpha value added. Use <a class="link" href="ch02s02.html#s3d_push_materials_a" title="s3d_push_materials_a">s3d_push_materials_a</a>() if you have a lot of materials to push.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_push_materials_a"></a>s3d_push_materials_a</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_push_materials_a</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const float *<var class="pdparam">mbuf</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Pushes a buffer of materials. Those materials are in the format float[n*12], with
</p><p>mbuf[n*12 + 0-3] - ambience</p><p>mbuf[n*12 + 4-7] - specular</p><p>mbuf[n *12 + 8-11] - diffusion values
</p><p>of each entry. n is the number of materials pushed. The values are in the order r,g,b,a. If you only want to push one material, use the more easy <a class="link" href="ch02s02.html#s3d_push_material_a" title="s3d_push_material_a">s3d_push_material_a</a>() function.</p><pre class="programlisting"> // each line has r,g,b,a value
 float bla[24]=
         {1, 0, 0, 1,
          1, 0, 0, 1,
          1, 0, 0, 1,
          0, 1, 1, 1,
          0, 1, 1, 1,
          0, 1, 1, 1};

 <a class="link" href="ch02s02.html#s3d_push_materials_a" title="s3d_push_materials_a">s3d_push_materials_a</a>(object, bla, 2); // push a red and a cyan material
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pep_material_a"></a>s3d_pep_material_a</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pep_material_a</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_r</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_g</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_b</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">amb_a</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_r</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_g</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_b</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">spec_a</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_r</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_g</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_b</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">diff_a</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Overwriting the latest pushed material, overwriting the current value with the specified one, with alpha value in contrast to <a class="link" href="ch02s02.html#s3d_pep_material" title="s3d_pep_material">s3d_pep_material</a> See <a class="link" href="ch02s02.html#s3d_push_materials_a" title="s3d_push_materials_a">s3d_push_materials_a</a> if you want to pep more materials.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pep_materials_a"></a>s3d_pep_materials_a</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pep_materials_a</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const float *<var class="pdparam">mbuf</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Alters the last n pushed materials. See <a class="link" href="ch02s02.html#s3d_push_materials_a" title="s3d_push_materials_a">s3d_push_materials_a</a>() for more information how mbuf should look like. Use <a class="link" href="ch02s02.html#s3d_pep_material_a" title="s3d_pep_material_a">s3d_pep_material_a</a>() if you only want to alter the latest material.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_load_materials_a"></a>s3d_load_materials_a</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_load_materials_a</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const float *<var class="pdparam">mbuf</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">start</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Loads n materials starting from index position start into the material stack. See <a class="link" href="ch02s02.html#s3d_push_materials_a" title="s3d_push_materials_a">s3d_push_materials_a</a> for more information about the values in mbuf.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_push_polygon"></a>s3d_push_polygon</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_push_polygon</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">v1</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">v2</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">v3</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">material</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Push one polygon on the polygon stack of the object. It takes 3 vertex-index numbers and one material material-index-no. as argument.</p><pre class="programlisting"> int oid = <a class="link" href="ch02s02.html#s3d_new_object" title="s3d_new_object">s3d_new_object</a>();   // create a new object
 <a class="link" href="ch02s02.html#s3d_push_vertex" title="s3d_push_vertex">s3d_push_vertex</a>(oid, 0.0, 0.0, 0.0);
 <a class="link" href="ch02s02.html#s3d_push_vertex" title="s3d_push_vertex">s3d_push_vertex</a>(oid, 0.0, 1.0, 0.0);
 <a class="link" href="ch02s02.html#s3d_push_vertex" title="s3d_push_vertex">s3d_push_vertex</a>(oid, 1.0, 0.0, 0.0);
 <a class="link" href="ch02s02.html#s3d_push_material" title="s3d_push_material">s3d_push_material</a>(oid, 0.3, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0);
 <a class="link" href="ch02s02.html#s3d_push_polygon" title="s3d_push_polygon">s3d_push_polygon</a>(oid, 0, 1, 2, 0);
 // this will create a red polygon
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_push_polygons"></a>s3d_push_polygons</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_push_polygons</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const uint32_t *<var class="pdparam">pbuf</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>As for vertices, you can push arrays of polygons to have greater performance. The pbuf should contain n polygons which consist of 4 uint32_t values of 3 vertices indices and 1 material index.</p><pre class="programlisting"> uint32_t pbuf[] = { 0, 1, 2, 0};
 int oid = <a class="link" href="ch02s02.html#s3d_new_object" title="s3d_new_object">s3d_new_object</a>();   // create a new object
 <a class="link" href="ch02s02.html#s3d_push_vertex" title="s3d_push_vertex">s3d_push_vertex</a>(oid, 0.0, 0.0, 0.0);
 <a class="link" href="ch02s02.html#s3d_push_vertex" title="s3d_push_vertex">s3d_push_vertex</a>(oid, 0.0, 1.0, 0.0);
 <a class="link" href="ch02s02.html#s3d_push_vertex" title="s3d_push_vertex">s3d_push_vertex</a>(oid, 1.0, 0.0, 0.0);
 <a class="link" href="ch02s02.html#s3d_push_material" title="s3d_push_material">s3d_push_material</a>(oid, 0.3, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0);
 <a class="link" href="ch02s02.html#s3d_push_polygons" title="s3d_push_polygons">s3d_push_polygons</a>(oid, pbuf, 1);
 // push one polygon with the pbuf data
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_push_line"></a>s3d_push_line</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_push_line</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">v1</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">v2</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">material</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Push one line on the line stack of the object. It takes 2 vertex-index-no, and one material material-index-no. as argument. If you have a lot of lines to push, use <a class="link" href="ch02s02.html#s3d_push_lines" title="s3d_push_lines">s3d_push_lines</a>()         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_push_lines"></a>s3d_push_lines</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_push_lines</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const uint32_t *<var class="pdparam">lbuf</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Pushing n lines on the line stack of the object, each lbuf has a size of n*3, each entry has the index number of the first vertex, second vertex and material number just as in <a class="link" href="ch02s02.html#s3d_push_line" title="s3d_push_line">s3d_push_line</a>().         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_push_texture"></a>s3d_push_texture</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_push_texture</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">w</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">h</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Adds a new texture with height w and height h on the texture stack.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_push_textures"></a>s3d_push_textures</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_push_textures</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const uint16_t *<var class="pdparam">tbuf</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>As for vertices, you can push arrays of textures on the texture stack to have greater performance. The tbuf should contain n texture sizes which consist of 2 uint16_t values for width and height for each texture.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pop_vertex"></a>s3d_pop_vertex</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pop_vertex</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Deletes the latest n vertices from the vertex stack of the object.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pop_polygon"></a>s3d_pop_polygon</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pop_polygon</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Deletes the latest n polygon from the polygon stack of the object.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pop_material"></a>s3d_pop_material</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pop_material</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Deletes the latest n material from the material stack of the object.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pop_texture"></a>s3d_pop_texture</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pop_texture</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Deletes the latest n textures from the texture stack of the object.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pop_line"></a>s3d_pop_line</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pop_line</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Deletes the latest n lines from the line stack of the object.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pep_line_normals"></a>s3d_pep_line_normals</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pep_line_normals</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const float *<var class="pdparam">nbuf</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Adds normal information to lines, giving each vertex of a line a normal information. This makes lines somewhat nicer, you'll need that especially when you're going to build wireframe models.</p><p>nbuf should contain n * 6 float values, for each vertex a normal vector (x,y,z), and you have 2 vertices for each line so that makes 6 float values per line in total.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pep_polygon_normals"></a>s3d_pep_polygon_normals</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pep_polygon_normals</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const float *<var class="pdparam">nbuf</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Adds normal information to polygons, giving each vertex of a polygon a normal information. With this, you can achieve smoothed edge effects.</p><p>nbuf should contain n * 9 float values, for each vertex a normal vector (x,y,z), and you have 3 vertices for each Polygon so that makes 9 float values per Polygon in total. Don't worry if you don't use this, it's kind of hard to calculate and the server will always use some proper normal values (same for every vertex, calculated by the plane which is defined by the 3 points of the polygon.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pep_polygon_tex_coord"></a>s3d_pep_polygon_tex_coord</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pep_polygon_tex_coord</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">x1</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">y1</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">x2</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">y2</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">x3</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">y3</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Pimp the last polygon pushed with some textures coordinates, x and y values for each vertex point respectively. Those values may be between 0 and 1 and are vertex points on the texture defined in the material of the polygon. If you have more polygons which should get a texture, use <a class="link" href="ch02s02.html#s3d_pep_polygon_tex_coords" title="s3d_pep_polygon_tex_coords">s3d_pep_polygon_tex_coords</a>()         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pep_polygon_tex_coords"></a>s3d_pep_polygon_tex_coords</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pep_polygon_tex_coords</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const float *<var class="pdparam">tbuf</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Pimp the latest n polygons with texture coordinates. tbuf has 6*n float values for its entries, which are supplied in the order as in <a class="link" href="ch02s02.html#s3d_pep_polygon_tex_coord" title="s3d_pep_polygon_tex_coord">s3d_pep_polygon_tex_coord</a>()         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pep_material_texture"></a>s3d_pep_material_texture</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pep_material_texture</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">tex</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Assign the latest material a texture referenced by the index tex. Of course, you will have pushed this texture with <a class="link" href="ch02s02.html#s3d_push_texture" title="s3d_push_texture">s3d_push_texture</a>()         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pep_vertex"></a>s3d_pep_vertex</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pep_vertex</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">x</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">y</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">z</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Alter the latest pushed vertex, overwriting with the supplied values.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pep_vertices"></a>s3d_pep_vertices</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pep_vertices</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const float *<var class="pdparam">vbuf</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Alter the latest n pushed vertex. vbuf holds the values which are used to overwrite the old data, n entries with each 3 floats specifying x,y,z of the vertices.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pep_line"></a>s3d_pep_line</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pep_line</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">v1</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">v2</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">material</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Alter the latest pushed line, overwriting with the supplied values.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pep_lines"></a>s3d_pep_lines</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_pep_lines</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const uint32_t *<var class="pdparam">lbuf</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Alter the latest n pushed lines. lbuf holds the values which are used to overwrite the old data, n entries with each 3 uint32_t specifying first, second vertex and material of each line.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_load_line_normals"></a>s3d_load_line_normals</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_load_line_normals</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const float *<var class="pdparam">nbuf</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">start</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Just as <a class="link" href="ch02s02.html#s3d_pep_line_normals" title="s3d_pep_line_normals">s3d_pep_line_normals</a>(), with the difference you won't alter the latest n lines but n lines starting with index start.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_load_polygon_normals"></a>s3d_load_polygon_normals</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_load_polygon_normals</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const float *<var class="pdparam">nbuf</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">start</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Just as <a class="link" href="ch02s02.html#s3d_pep_polygon_normals" title="s3d_pep_polygon_normals">s3d_pep_polygon_normals</a>(), with the difference you won't alter the latest n polygons but n polygons starting with index start.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_load_polygon_tex_coords"></a>s3d_load_polygon_tex_coords</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_load_polygon_tex_coords</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>const float *<var class="pdparam">tbuf</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">start</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Just as <a class="link" href="ch02s02.html#s3d_pep_polygon_tex_coords" title="s3d_pep_polygon_tex_coords">s3d_pep_polygon_tex_coords</a>(), with the difference you won't alter the latest n polygons but n polygons starting with index start.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_load_texture"></a>s3d_load_texture</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_load_texture</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">tex</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">xpos</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">ypos</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">w</var>, </td></tr><tr><td>&#160;</td><td>uint16_t <var class="pdparam">h</var>, </td></tr><tr><td>&#160;</td><td>const uint8_t *<var class="pdparam">data</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>This will load an 32bit rgba image supplied in data at position xpos,ypos of the texture tex. The image has the width w and height h. This can be used to update only parts of the texture. It's no problem to supply big textures, as the image will be sent to server in fragments. Of course, you will have created the texture with <a class="link" href="ch02s02.html#s3d_push_texture" title="s3d_push_texture">s3d_push_texture</a>, have an material assigned to the texture with <a class="link" href="ch02s02.html#s3d_pep_material_texture" title="s3d_pep_material_texture">s3d_pep_material_texture</a>() and have your polygons set sane polygon texture coords using <a class="link" href="ch02s02.html#s3d_pep_polygon_tex_coord" title="s3d_pep_polygon_tex_coord">s3d_pep_polygon_tex_coord</a>().         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_new_object"></a>s3d_new_object</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_new_object</strong>(</code></td><td><code>void)</code>;</td><td>&#160;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Creates a new object, returning the object id.</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Of course, you won't forget to toggle it visible, won't you? 
        </p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_del_object"></a>s3d_del_object</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_del_object</strong>(</code></td><td>int <var class="pdparam">oid</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Deletes the object referenced by oid.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_clone"></a>s3d_clone</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_clone</strong>(</code></td><td>int <var class="pdparam">oid</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Clones an already existing object. They get just look the same as the parent-object and will change when the parent-object changes. Cloning especially makes sense if you want to use the same object a lot of times. Move and transform is independent from the parent. The function returns the childs object id.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_clone_target"></a>s3d_clone_target</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_clone_target</strong>(</code></td><td>int <var class="pdparam">oid</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">toid</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Changes the clone target of oid to another object (toid). This assumes you've got oid from <a class="link" href="ch02s02.html#s3d_clone" title="s3d_clone">s3d_clone</a> before.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_link"></a>s3d_link</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_link</strong>(</code></td><td>int <var class="pdparam">oid_from</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">oid_to</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>A linked object will move along with it's link parent. For example if you have a book on a table, you can link the book to the table so the book will "keep on the table" if you move the table around in space. It will also rotate with the table etc.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_unlink"></a>s3d_unlink</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_unlink</strong>(</code></td><td>int <var class="pdparam">oid</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Remove the link of object oid to its target.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_flags_on"></a>s3d_flags_on</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_flags_on</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">flags</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Turn some flags on for object.</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>If you don't toggle OF_VISIBLE on, you won't see your object. usually you want this. (at least after you *push()d all your content) 
        </p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_flags_off"></a>s3d_flags_off</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_flags_off</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>uint32_t <var class="pdparam">flags</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Turn some flags off for object.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_translate"></a>s3d_translate</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_translate</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">x</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">y</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">z</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Move the object to some position in space. when you create an object, it's always located at 0.0 , 0.0, 0.0.</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Translation is absolute, not relative!
</p></div><pre class="programlisting"> <a class="link" href="ch02s02.html#s3d_translate" title="s3d_translate">s3d_translate</a>(object, 2, 0, 0);
 <a class="link" href="ch02s02.html#s3d_translate" title="s3d_translate">s3d_translate</a>(object, 4, 0, 0);
 // object will end up at 4,0,0 and not 6,0,0!!
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_rotate"></a>s3d_rotate</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_rotate</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">x</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">y</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">z</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Rotate an object around the x, y and z-axis respectively. x,y,z may have values between [0,360] degrees.</p><p>You will usually only rotate around one axis, leaving the unused fields on 0, I guess. If you want to rotate around more than one axis, please note: The order of the rotation applies is y-axis, x-axis, and then z-axis. You can think of it as the earth position coordinates: x is the longitude, y is the latitude, and z is the rotation at this point of the earth around your bodies axis. (I wonder if that makes it any clearer ;)</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Rotate is absolute, not relative!
</p></div><pre class="programlisting"> <a class="link" href="ch02s02.html#s3d_rotate" title="s3d_rotate">s3d_rotate</a>(object, 90,  0, 0);
 <a class="link" href="ch02s02.html#s3d_rotate" title="s3d_rotate">s3d_rotate</a>(object, 180, 0, 0);
 // object will be rotated 180 degrees around the x-axis, not 270 degress!
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_scale"></a>s3d_scale</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_scale</strong>(</code></td><td>int <var class="pdparam">object</var>, </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">s</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Scales the object. about factor s. s=1 will be the original size, -1 will mirror it.</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>s=0 is forbidden and will be ignored! <a class="link" href="ch02s02.html#s3d_scale" title="s3d_scale">s3d_scale</a> is also absolute, not relative! 
        </p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_import_model_file"></a>s3d_import_model_file</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_import_model_file</strong>(</code></td><td>const char *<var class="pdparam">fname</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Imports an 3d object file and returns the object number. Quite a number of formats are supported, like 3D Studio (.3ds, .prj), Lightwave (.lw, .lwb, .lwo), Quake Models (.md3), or simply everything libg3d supports. :)</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Of course, you won't forget to toggle it visible, won't you? 
        </p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_open_file"></a>s3d_open_file</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_open_file</strong>(</code></td><td>const char *<var class="pdparam">fname</var>, </td></tr><tr><td>&#160;</td><td>char **<var class="pdparam">pointer</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>This opens the file fname, setting *pointer to it's memory position. the function will return the size of buffer. you can free() the pointer when you're finished.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_select_font"></a>s3d_select_font</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_select_font</strong>(</code></td><td>const char *<var class="pdparam">mask</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>This selects a font for the <a class="link" href="ch02s02.html#s3d_draw_string" title="s3d_draw_string">s3d_draw_string</a>() function.</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Of course, you won't forget to toggle it visible, won't you?
</p></div><pre class="programlisting"> <a class="link" href="ch02s02.html#s3d_select_font" title="s3d_select_font">s3d_select_font</a>("vera"); // will use the vera font face
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_draw_string"></a>s3d_draw_string</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_draw_string</strong>(</code></td><td>const char *<var class="pdparam">str</var>, </td></tr><tr><td>&#160;</td><td>float *<var class="pdparam">xlen</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Renders the string str with in Truetype format with the height 1, returns the length of the rendered string in *xlen (or set len=NULL to disable this).</p><pre class="programlisting"> char str="hello world!";
 float len;
 <a class="link" href="ch02s02.html#s3d_select_font" title="s3d_select_font">s3d_select_font</a>("vera");
 <a class="link" href="ch02s02.html#s3d_draw_string" title="s3d_draw_string">s3d_draw_string</a>(str, len);

 // not interested in the length? do that: <a class="link" href="ch02s02.html#s3d_draw_string" title="s3d_draw_string">s3d_draw_string</a>(str, NULL);
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_strlen"></a>s3d_strlen</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">float <strong class="fsfunc">s3d_strlen</strong>(</code></td><td>const char *<var class="pdparam">str</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Returns the length of the string if it were rendered with the currently selected font. That might be useful to estimate the size used for a text and render the background or bounding box before inserting the text.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_vector_length"></a>s3d_vector_length</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">float <strong class="fsfunc">s3d_vector_length</strong>(</code></td><td>const float <var class="pdparam">vector</var>[]<code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Calculates and returns the length of the given vector (which should be of the type float[3]). More info on wikipedia http://en.wikipedia.org/wiki/Vector_(spatial)         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_vector_dot_product"></a>s3d_vector_dot_product</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">float <strong class="fsfunc">s3d_vector_dot_product</strong>(</code></td><td>const float <var class="pdparam">vector1</var>[], </td></tr><tr><td>&#160;</td><td>const float <var class="pdparam">vector2</var>[]<code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Calculates and returns the dot product of vector1 and vector2. All vectors should have the format float[3]. More info on wikipedia. http://en.wikipedia.org/wiki/Vector_(spatial)         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_vector_subtract"></a>s3d_vector_subtract</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">s3d_vector_subtract</strong>(</code></td><td>const float <var class="pdparam">vector1</var>[], </td></tr><tr><td>&#160;</td><td>const float <var class="pdparam">vector2</var>[], </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">result_vector</var>[]<code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Subtracts vector1 from vector2, writing result into result_vector. All vectors should have the format float[3]. More info on wikipedia. http://en.wikipedia.org/wiki/Vector_(spatial)         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_vector_angle"></a>s3d_vector_angle</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">float <strong class="fsfunc">s3d_vector_angle</strong>(</code></td><td>const float <var class="pdparam">vector1</var>[], </td></tr><tr><td>&#160;</td><td>const float <var class="pdparam">vector2</var>[]<code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Calculates and returns the angle between vector1 and vector2. Please note that the resulting angle is between 0 and PI, therefore not covering the whole period! To convert in degrees just do result*180/M_PI. All vectors should have the format float[3]. More info on wikipedia. http://en.wikipedia.org/wiki/Vector_(spatial)         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_angle_to_cam"></a>s3d_angle_to_cam</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">float <strong class="fsfunc">s3d_angle_to_cam</strong>(</code></td><td>const float <var class="pdparam">obj_pos</var>[], </td></tr><tr><td>&#160;</td><td>const float <var class="pdparam">cam_pos</var>[], </td></tr><tr><td>&#160;</td><td>float *<var class="pdparam">angle_rad</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Given obj_pos and cam_pos in the format float[3], angle_rad about which angle the object should be rotated around the y-axis so that it faces the camera. This might become handy if you have some text floating in space and want it to face the camera. http://en.wikipedia.org/wiki/Vector_(spatial)         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_vector_cross_product"></a>s3d_vector_cross_product</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">s3d_vector_cross_product</strong>(</code></td><td>const float <var class="pdparam">vector1</var>[], </td></tr><tr><td>&#160;</td><td>const float <var class="pdparam">vector2</var>[], </td></tr><tr><td>&#160;</td><td>float <var class="pdparam">result_vector</var>[]<code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Calculates and returns the cross product of vector1 and vector2. All vectors should have the format float[3]. More info on wikipedia. http://en.wikipedia.org/wiki/Vector_(spatial)         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_push_event"></a>s3d_push_event</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">s3d_push_event</strong>(</code></td><td>struct s3d_evt *<var class="pdparam">newevt</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Pushes an event onto the event-stack. Usually you don't need to do this manually.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_pop_event"></a>s3d_pop_event</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">struct s3d_evt *<strong class="fsfunc">s3d_pop_event</strong>(</code></td><td><code>void)</code>;</td><td>&#160;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Pops the latest event from the stack. Don't forget to free() both the event and its buffer! Returns a pointer to struct <a class="link" href="ch02s03.html#structs3d_evt" title="struct s3d_evt">s3d_evt</a>.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_find_event"></a>s3d_find_event</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">struct s3d_evt *<strong class="fsfunc">s3d_find_event</strong>(</code></td><td>uint8_t <var class="pdparam">event</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Finds the latest occurrence of an event, giving the event type as argument. Returns a pointer to struct <a class="link" href="ch02s03.html#structs3d_evt" title="struct s3d_evt">s3d_evt</a>.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_delete_event"></a>s3d_delete_event</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_delete_event</strong>(</code></td><td>const struct s3d_evt *<var class="pdparam">devt</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Deletes an event, the argument is the pointer to the event which is to be deleted (maybe obtained from <a class="link" href="ch02s02.html#s3d_find_event" title="s3d_find_event">s3d_find_event</a>).         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_set_callback"></a>s3d_set_callback</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">s3d_set_callback</strong>(</code></td><td>uint8_t <var class="pdparam">event</var>, </td></tr><tr><td>&#160;</td><td>s3d_cb <var class="pdparam">func</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Sets a callback for a certain event. this is very useful for event-oriented applications. event callbacks will not interrupt each other or the mainloop.</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Defining callbacks will only work after calling <a class="link" href="ch02s02.html#s3d_init" title="s3d_init">s3d_init</a>()
</p></div><pre class="programlisting"> #include &lt;inttypes.h&gt;

 void obj_click(struct <a class="link" href="ch02s03.html#structs3d_evt" title="struct s3d_evt">s3d_evt</a> event)
 {
         printf("object id %"PRIu32" got clicked", *((uint32_t *)event-&gt;buf));
 }
 ...
 <a class="link" href="ch02s02.html#s3d_set_callback" title="s3d_set_callback">s3d_set_callback</a>(S3D_EVENT_NEW_OBJECT, obj_click);
 // this will tell you when a object got clicked
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_clear_callback"></a>s3d_clear_callback</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">s3d_clear_callback</strong>(</code></td><td>uint8_t <var class="pdparam">event</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Clears the callback which is associated with the event.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_ignore_callback"></a>s3d_ignore_callback</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">s3d_ignore_callback</strong>(</code></td><td>uint8_t <var class="pdparam">event</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Sets the callback on ignore, that means it won't be queued up for later use. An incoming event of this type will simply be skipped.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_get_callback"></a>s3d_get_callback</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">s3d_cb <strong class="fsfunc">s3d_get_callback</strong>(</code></td><td>uint8_t <var class="pdparam">event</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>Returns the Callback-function of the event.</p><pre class="programlisting"> struct <a class="link" href="ch02s03.html#structs3d_evt" title="struct s3d_evt">s3d_evt</a> e;
 ...
 <a class="link" href="ch02s02.html#s3d_get_callback" title="s3d_get_callback">s3d_get_callback</a>(S3D_EVENT_KEY)(e);
 // will call the key-handling function with argument e.
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_process_stack"></a>s3d_process_stack</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">s3d_process_stack</strong>(</code></td><td><code>void)</code>;</td><td>&#160;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>This function goes through all function of the event-stack and will call functions. this is useful when you define a new function but still have a lot of events of this type on the stack.</p><p>Deprecated</p><p>This is probably obsolete         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_mcp_focus"></a>s3d_mcp_focus</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_mcp_focus</strong>(</code></td><td>int <var class="pdparam">object</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>This is an mcp-only function. It gives focus (for receiving key-strokes etc.) to an app referenced by it's mcp-object-id.         </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3d_net_check"></a>s3d_net_check</h3></div></div></div><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;s3d.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">s3d_net_check</strong>(</code></td><td><code>void)</code>;</td><td>&#160;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div><p>This functions is for programs which do not employ a mainloop, hence they need to check for new events on their own. Programs like these must make sure to call this function from time to time to convince the server that they did not freeze or bail out.         </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="ch02s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&#160;2.&#160;libs3d - The S3D API&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Data types</td></tr></table></div></body></html>