<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Irrlicht Engine: Irrlicht Engine 1.6.1 API documentation</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <table class="irrlicht" > <tr valign="middle"> <td><font size="2"><a class="qindex" href="index.html"><font color="#FFFFFF">Home</font></a> | <a class="qindex" href="namespaces.html"><font color="#FFFFFF">Namespaces</font></a> | <a class="qindex" href="hierarchy.html"><font color="#FFFFFF">Hierarchy</font></a> | <a class="qindex" href="classes.html"><font color="#FFFFFF">Alphabetical List</font></a> | <a class="qindex" href="annotated.html"><font color="#FFFFFF"> Class list</font></a> | <a class="qindex" href="files.html"><font color="#FFFFFF">Files</font></a> | <a class="qindex" href="namespacemembers.html"><font color="#FFFFFF"> Namespace Members</font></a> | <a class="qindex" href="functions.html"><font color="#FFFFFF">Class members</font></a> | <a class="qindex" href="globals.html"><font color="#FFFFFF">File members</font></a> | <a class="qindex" href="pages.html"><font color="#FFFFFF">Tutorials</font></a></font> </td> </tr> </table> <!-- Generated by Doxygen 1.5.6 --> <div class="contents"> <h1>Irrlicht Engine 1.6.1 API documentation</h1> <p> <div align="center"><div align="center"> <img src="logobig.png" alt="logobig.png"> </div> </div><h2><a class="anchor" name="intro"> Introduction</a></h2> 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> 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).<h2><a class="anchor" name="links"> Links</a></h2> <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> <h2><a class="anchor" name="irrexample"> Short example</a></h2> 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 <<a class="code" href="irrlicht_8h.html" title="Main header file of the irrlicht, the only file needed to include.">irrlicht.h</a>></span> <span class="keyword">using namespace </span>irr; <span class="keywordtype">int</span> main() { <span class="comment">// start up the engine</span> IrrlichtDevice *device = <a class="code" href="namespaceirr.html#baf4d8719cc26b0d30813abf85e47c76" title="Creates an Irrlicht device. The Irrlicht device is the root object for using the...">createDevice</a>(<a class="code" href="namespaceirr_1_1video.html#e35a6de6d436c76107ad157fe42356d08cc3807f6f28404f3424ad7e31b3142f" title="Direct3D8 device, only available on Win32 platforms.">video::EDT_DIRECT3D8</a>, core::dimension2d<u32>(640,480)); video::IVideoDriver* driver = device->getVideoDriver(); scene::ISceneManager* scenemgr = device->getSceneManager(); device->setWindowCaption(L<span class="stringliteral">"Hello World!"</span>); <span class="comment">// load and show quake2 .md2 model</span> scene::ISceneNode* node = scenemgr->addAnimatedMeshSceneNode( scenemgr->getMesh(<span class="stringliteral">"quake2model.md2"</span>)); <span class="comment">// if everything worked, add a texture and disable lighting</span> <span class="keywordflow">if</span> (node) { node->setMaterialTexture(0, driver->getTexture(<span class="stringliteral">"texture.bmp"</span>)); node->setMaterialFlag(<a class="code" href="namespaceirr_1_1video.html#8a3bc00ae8137535b9fbc5f40add70d3cea597a2692b8415486a464a7f954d34" 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->addCameraSceneNodeFPS(); <span class="comment">// draw everything</span> <span class="keywordflow">while</span>(device->run() && driver) { driver->beginScene(<span class="keyword">true</span>, <span class="keyword">true</span>, video::SColor(255,0,0,255)); scenemgr->drawAll(); driver->endScene(); } <span class="comment">// delete device</span> device->drop(); <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#63894c3f3d46cfc385116f1705935e03" 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 octtree, 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->getFileSystem()->addZipFileArchive(<span class="stringliteral">"quake3map.pk3"</span>); <span class="comment">// load .bsp file and show it using an octtree</span> scenemgr->addOctTreeSceneNode( scenemgr->getMesh(<span class="stringliteral">"quake3map.bsp"</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: <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. </div> <hr size="1"> <address style="align: right;"> <small> </small> </address> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="0"> <div align="left"><small><a href="http://irrlicht.sourceforge.net" target="_blank"><img src="irrlicht.png" alt="The Irrlicht Engine" align="middle" border=0 width=88 height=31></a></small></div></td> <td> <div align="left"><small><em><font size="2">The <a href="http://irrlicht.sourceforge.net" target="_blank">Irrlicht Engine</a> Documentation © 2003-2009 by Nikolaus Gebhardt. Generated on Sun Jan 10 09:24:02 2010 by <a href="http://www.doxygen.org" target="_blank">Doxygen</a> (1.5.6)</font></em></small></div></td> </tr> </table> <address style="align: right;"> </address> </body> </html>