Irrlicht 3D Engine
Irrlicht Engine 1.8 API documentation

Introduction

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 irrlicht.sourceforge.net or inside the SDK in the examples directory.

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).

Links

Namespaces: A very good place to start reading the documentation.
Class list: List of all classes with descriptions.
Class members: Good place to find forgotten features.

Short example

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:

#include <irrlicht.h>
using namespace irr;
int main()
{
// start up the engine
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* scenemgr = device->getSceneManager();
device->setWindowCaption(L"Hello World!");
// load and show quake2 .md2 model
scenemgr->getMesh("quake2model.md2"));
// if everything worked, add a texture and disable lighting
if (node)
{
node->setMaterialTexture(0, driver->getTexture("texture.bmp"));
}
// add a first person shooter style user controlled camera
scenemgr->addCameraSceneNodeFPS();
// draw everything
while(device->run() && driver)
{
driver->beginScene(true, true, video::SColor(255,0,0,255));
scenemgr->drawAll();
driver->endScene();
}
// delete device
device->drop();
return 0;
}

Irrlicht can load a lot of file formats automaticly, see irr::scene::ISceneManager::getMesh() 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:

// add .pk3 archive to the file system
device->getFileSystem()->addZipFileArchive("quake3map.pk3");
// load .bsp file and show it using an octree
scenemgr->getMesh("quake3map.bsp"));

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 namespaces page. 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:

using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

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.

irrlicht.h
Main header file of the irrlicht, the only file needed to include.
irr::scene::ISceneManager::addAnimatedMeshSceneNode
virtual IAnimatedMeshSceneNode * addAnimatedMeshSceneNode(IAnimatedMesh *mesh, ISceneNode *parent=0, s32 id=-1, const core::vector3df &position=core::vector3df(0, 0, 0), const core::vector3df &rotation=core::vector3df(0, 0, 0), const core::vector3df &scale=core::vector3df(1.0f, 1.0f, 1.0f), bool alsoAddIfMeshPointerZero=false)=0
Adds a scene node for rendering an animated mesh model.
irr::scene::ISceneManager::drawAll
virtual void drawAll()=0
Draws all the scene nodes.
irr::scene::ISceneNode::setMaterialTexture
void setMaterialTexture(u32 textureLayer, video::ITexture *texture)
Sets the texture of the specified layer in all materials of this scene node to the new texture.
Definition: ISceneNode.h:436
irr::IReferenceCounted::drop
bool drop() const
Drops the object. Decrements the reference counter by one.
Definition: IReferenceCounted.h:116
irr::scene::ISceneManager::getMesh
virtual IAnimatedMesh * getMesh(const io::path &filename)=0
Get pointer to an animateable mesh. Loads the file if not loaded already.
irr::createDevice
IRRLICHT_API IrrlichtDevice *IRRCALLCONV createDevice(video::E_DRIVER_TYPE deviceType=video::EDT_SOFTWARE, const core::dimension2d< u32 > &windowSize=(core::dimension2d< u32 >(640, 480)), u32 bits=16, bool fullscreen=false, bool stencilbuffer=false, bool vsync=false, IEventReceiver *receiver=0)
Creates an Irrlicht device. The Irrlicht device is the root object for using the engine.
irr::video::IVideoDriver::beginScene
virtual bool beginScene(bool backBuffer=true, bool zBuffer=true, SColor color=SColor(255, 0, 0, 0), const SExposedVideoData &videoData=SExposedVideoData(), core::rect< s32 > *sourceRect=0)=0
Applications must call this method before performing any rendering.
irr::IrrlichtDevice
The Irrlicht device. You can create it with createDevice() or createDeviceEx().
Definition: IrrlichtDevice.h:43
irr::IrrlichtDevice::setWindowCaption
virtual void setWindowCaption(const wchar_t *text)=0
Sets the caption of the window.
irr::video::EDT_DIRECT3D8
@ EDT_DIRECT3D8
Direct3D8 device, only available on Win32 platforms.
Definition: EDriverTypes.h:43
irr::core::dimension2d< u32 >
irr::IrrlichtDevice::getSceneManager
virtual scene::ISceneManager * getSceneManager()=0
Provides access to the scene manager.
irr::IrrlichtDevice::getVideoDriver
virtual video::IVideoDriver * getVideoDriver()=0
Provides access to the video driver for drawing 3d and 2d geometry.
irr::scene::ISceneManager::addCameraSceneNodeFPS
virtual ICameraSceneNode * addCameraSceneNodeFPS(ISceneNode *parent=0, f32 rotateSpeed=100.0f, f32 moveSpeed=0.5f, s32 id=-1, SKeyMap *keyMapArray=0, s32 keyMapSize=0, bool noVerticalMovement=false, f32 jumpSpeed=0.f, bool invertMouse=false, bool makeActive=true)=0
Adds a camera scene node with an animator which provides mouse and keyboard control appropriate for f...
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition: aabbox3d.h:12
irr::video::EMF_LIGHTING
@ EMF_LIGHTING
Will this material be lighted? Default: true.
Definition: EMaterialFlags.h:26
irr::scene::ISceneManager
The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff.
Definition: ISceneManager.h:150
irr::video::IVideoDriver::getTexture
virtual ITexture * getTexture(const io::path &filename)=0
Get access to a named texture.
irr::IrrlichtDevice::getFileSystem
virtual io::IFileSystem * getFileSystem()=0
Provides access to the virtual file system.
irr::video::IVideoDriver::endScene
virtual bool endScene()=0
Presents the rendered image to the screen.
irr::scene::ISceneManager::addOctreeSceneNode
virtual IMeshSceneNode * addOctreeSceneNode(IAnimatedMesh *mesh, ISceneNode *parent=0, s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false)=0
Adds a scene node for rendering using a octree to the scene graph.
irr::video::SColor
Class representing a 32 bit ARGB color.
Definition: SColor.h:201
irr::video::IVideoDriver
Interface to driver which is able to perform 2d and 3d graphics functions.
Definition: IVideoDriver.h:256
irr::scene::ISceneNode
Scene node interface.
Definition: ISceneNode.h:40
irr::IrrlichtDevice::run
virtual bool run()=0
Runs the device.
irr::scene::ISceneNode::setMaterialFlag
void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue)
Sets all material flags at once to a new value.
Definition: ISceneNode.h:425
irr::io::IFileSystem::addZipFileArchive
virtual _IRR_DEPRECATED_ bool addZipFileArchive(const c8 *filename, bool ignoreCase=true, bool ignorePaths=true)
Adds a zip archive to the file system.
Definition: IFileSystem.h:228