aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/doc/html/index.html
blob: 33366c8e5aa8e285a45e3faf88f382fe4767e5f9 (plain)
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
<!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/xhtml;charset=UTF-8"/>
<title>Irrlicht 3D Engine: Irrlicht Engine 1.8 API documentation</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="irrlichtlogo.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Irrlicht 3D Engine
   
   </div>
   
  </td>
  
  
  
   
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
   
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="dynsections.js"></script>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('index.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Irrlicht Engine 1.8 API documentation </div>  </div>
</div>
<div class="contents">
<div class="textblock"><div align="center"><div class="image">
<img src="logobig.png" alt="logobig.png"/>
</div>
</div><h2><a class="anchor" id="intro"></a>
Introduction</h2>
<p>Welcome to the Irrlicht Engine API documentation. Here you'll find any information you'll need to develop applications with the Irrlicht Engine. If you are looking for a tutorial on how to start, you'll find some on the homepage of the Irrlicht Engine at <a href="http://irrlicht.sourceforge.net">irrlicht.sourceforge.net</a> or inside the SDK in the examples directory.</p>
<p>The Irrlicht Engine is intended to be an easy-to-use 3d engine, so this documentation is an important part of it. If you have any questions or suggestions, just send a email to the author of the engine, Nikolaus Gebhardt (niko (at) irrlicht3d.org).</p>
<h2><a class="anchor" id="links"></a>
Links</h2>
<p><a href="namespaces.html">Namespaces</a>: A very good place to start reading the documentation.<br/>
 <a href="annotated.html">Class list</a>: List of all classes with descriptions.<br/>
 <a href="functions.html">Class members</a>: Good place to find forgotten features.<br/>
</p>
<h2><a class="anchor" id="irrexample"></a>
Short example</h2>
<p>A simple application, starting up the engine, loading a Quake 2 animated model file and the corresponding texture, animating and displaying it in front of a blue background and placing a user controlable 3d camera would look like the following code. I think this example shows the usage of the engine quite well:</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;<a class="code" href="irrlicht_8h.html" title="Main header file of the irrlicht, the only file needed to include.">irrlicht.h</a>&gt;</span>
 <span class="keyword">using namespace </span>irr;

 <span class="keywordtype">int</span> main()
 {
    <span class="comment">// start up the engine</span>
    <a class="code" href="classirr_1_1_irrlicht_device.html" title="The Irrlicht device. You can create it with createDevice() or createDeviceEx().">IrrlichtDevice</a> *device = <a class="code" href="namespaceirr.html#abaf4d8719cc26b0d30813abf85e47c76" title="Creates an Irrlicht device. The Irrlicht device is the root object for using the engine.">createDevice</a>(<a class="code" href="namespaceirr_1_1video.html#ae35a6de6d436c76107ad157fe42356d0a8cc3807f6f28404f3424ad7e31b3142f" title="Direct3D8 device, only available on Win32 platforms.">video::EDT_DIRECT3D8</a>,
        <a class="code" href="classirr_1_1core_1_1dimension2d.html">core::dimension2d&lt;u32&gt;</a>(640,480));

    <a class="code" href="classirr_1_1video_1_1_i_video_driver.html" title="Interface to driver which is able to perform 2d and 3d graphics functions.">video::IVideoDriver</a>* driver = device-&gt;<a class="code" href="classirr_1_1_irrlicht_device.html#ada90707ba5c645d47e000e4e0f87c4c4" title="Provides access to the video driver for drawing 3d and 2d geometry.">getVideoDriver</a>();
    <a class="code" href="classirr_1_1scene_1_1_i_scene_manager.html" title="The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff.">scene::ISceneManager</a>* scenemgr = device-&gt;<a class="code" href="classirr_1_1_irrlicht_device.html#a891b503ff4d5041296d88f23f97d7b3d" title="Provides access to the scene manager.">getSceneManager</a>();

    device-&gt;<a class="code" href="classirr_1_1_irrlicht_device.html#a3d7c98d520bf18ce1973c6f1439a7c0f" title="Sets the caption of the window.">setWindowCaption</a>(L<span class="stringliteral">&quot;Hello World!&quot;</span>);

    <span class="comment">// load and show quake2 .md2 model</span>
    <a class="code" href="classirr_1_1scene_1_1_i_scene_node.html" title="Scene node interface.">scene::ISceneNode</a>* node = scenemgr-&gt;<a class="code" href="classirr_1_1scene_1_1_i_scene_manager.html#a8e2e0cd3a27e85b4116855dd2f3365b8" title="Adds a scene node for rendering an animated mesh model.">addAnimatedMeshSceneNode</a>(
        scenemgr-&gt;<a class="code" href="classirr_1_1scene_1_1_i_scene_manager.html#a63894c3f3d46cfc385116f1705935e03" title="Get pointer to an animateable mesh. Loads the file if not loaded already.">getMesh</a>(<span class="stringliteral">&quot;quake2model.md2&quot;</span>));

    <span class="comment">// if everything worked, add a texture and disable lighting</span>
    <span class="keywordflow">if</span> (node)
    {
        node-&gt;<a class="code" href="classirr_1_1scene_1_1_i_scene_node.html#a0d5d2e05ebe08e6a432fbb4fd1d28dd0" title="Sets the texture of the specified layer in all materials of this scene node to the new texture...">setMaterialTexture</a>(0, driver-&gt;<a class="code" href="classirr_1_1video_1_1_i_video_driver.html#af4055165190e4adf221c6dc6f2434ea0" title="Get access to a named texture.">getTexture</a>(<span class="stringliteral">&quot;texture.bmp&quot;</span>));
        node-&gt;<a class="code" href="classirr_1_1scene_1_1_i_scene_node.html#a2841d5077854b9981711a403f33762cd" title="Sets all material flags at once to a new value.">setMaterialFlag</a>(<a class="code" href="namespaceirr_1_1video.html#a8a3bc00ae8137535b9fbc5f40add70d3acea597a2692b8415486a464a7f954d34" title="Will this material be lighted? Default: true.">video::EMF_LIGHTING</a>, <span class="keyword">false</span>);
    }

    <span class="comment">// add a first person shooter style user controlled camera</span>
    scenemgr-&gt;<a class="code" href="classirr_1_1scene_1_1_i_scene_manager.html#ac312cbc85161678d00192880f2cdddbb" title="Adds a camera scene node with an animator which provides mouse and keyboard control appropriate for f...">addCameraSceneNodeFPS</a>();

    <span class="comment">// draw everything</span>
    <span class="keywordflow">while</span>(device-&gt;<a class="code" href="classirr_1_1_irrlicht_device.html#a0489f8151dc43f6f41503ffb5a160b35" title="Runs the device.">run</a>() &amp;&amp; driver)
    {
        driver-&gt;<a class="code" href="classirr_1_1video_1_1_i_video_driver.html#a015b8f2f18c260a00a858181be1e9945" title="Applications must call this method before performing any rendering.">beginScene</a>(<span class="keyword">true</span>, <span class="keyword">true</span>, <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">video::SColor</a>(255,0,0,255));
        scenemgr-&gt;<a class="code" href="classirr_1_1scene_1_1_i_scene_manager.html#a04240262904667c821bd9de5e5fd9b02" title="Draws all the scene nodes.">drawAll</a>();
        driver-&gt;<a class="code" href="classirr_1_1video_1_1_i_video_driver.html#a75f61a93c5fc9fdf161c044d27bc994e" title="Presents the rendered image to the screen.">endScene</a>();
    }

    <span class="comment">// delete device</span>
    device-&gt;<a class="code" href="classirr_1_1_i_reference_counted.html#afb169a857e0d2cdb96b8821cb9bff17a" title="Drops the object. Decrements the reference counter by one.">drop</a>();
    <span class="keywordflow">return</span> 0;
 }
</pre></div><p>Irrlicht can load a lot of file formats automaticly, see <a class="el" href="classirr_1_1scene_1_1_i_scene_manager.html#a63894c3f3d46cfc385116f1705935e03" title="Get pointer to an animateable mesh. Loads the file if not loaded already.">irr::scene::ISceneManager::getMesh()</a> for a detailed list. So if you would like to replace the simple blue screen background by a cool Quake 3 Map, optimized by an octree, just insert this code somewhere before the while loop:</p>
<div class="fragment"><pre class="fragment">    <span class="comment">// add .pk3 archive to the file system</span>
    device-&gt;<a class="code" href="classirr_1_1_irrlicht_device.html#a3d8d2dee2f57aa7e6c0d14592de3e6ed" title="Provides access to the virtual file system.">getFileSystem</a>()-&gt;addZipFileArchive(<span class="stringliteral">&quot;quake3map.pk3&quot;</span>);

    <span class="comment">// load .bsp file and show it using an octree</span>
    scenemgr-&gt;<a class="code" href="classirr_1_1scene_1_1_i_scene_manager.html#a503339385ca2b33d7e8035a61c4eca84" title="Adds a scene node for rendering using a octree to the scene graph.">addOctreeSceneNode</a>(
        scenemgr-&gt;<a class="code" href="classirr_1_1scene_1_1_i_scene_manager.html#a63894c3f3d46cfc385116f1705935e03" title="Get pointer to an animateable mesh. Loads the file if not loaded already.">getMesh</a>(<span class="stringliteral">&quot;quake3map.bsp&quot;</span>));
</pre></div><p>As you can see, the engine uses namespaces. Everything in the engine is placed into the namespace 'irr', but there are also 5 sub namespaces. You can find a list of all namespaces with descriptions at the <a href="namespaces.html">namespaces page</a>. This is also a good place to start reading the documentation. If you don't want to write the namespace names all the time, just use all namespaces like this: </p>
<div class="fragment"><pre class="fragment"> <span class="keyword">using namespace </span>core;
 <span class="keyword">using namespace </span>scene;
 <span class="keyword">using namespace </span>video;
 <span class="keyword">using namespace </span>io;
 <span class="keyword">using namespace </span>gui;
</pre></div><p>There is a lot more the engine can do, but I hope this gave a short overview over the basic features of the engine. For more examples, please take a look into the examples directory of the SDK. </p>
</div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">
<a href="http://irrlicht.sourceforge.net" target="_blank">Irrlicht 
Engine</a> Documentation &copy; 2003-2012 by Nikolaus Gebhardt. Generated on Tue Nov 6 2012 11:05:59 for Irrlicht 3D Engine by
<a href="http://www.doxygen.org/index.html" target="_blank">Doxygen</a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>