Setting up Irrlicht on Ubuntu 9.10 PDF Print E-mail
Wednesday, 16 December 2009 07:49

Well, work has slowed for the year, so I thought I'd amuse myself by setting up the Irrlicht 3D engine and checking out what's been happening since I fixed up the IrrFontTool to work under Linux about a year ago.

For those who don't know what IrrFontTool is, it's used to convert a vector based font into a bitmap image which Irrlicht can use to render text much faster than it could with the operating system's font engine, helping to keep your awesome interactive application's performance at it's peak.

Download the latest Irrlicht SDK and extract it into a folder in your home directory. As usual, I'll be using a folder called workspace under home, and I'll rename the extracted folder to irrlicht, without the version number.

Irrlicht comes only with the source code for non-Windows users, so you will need to compile it, which isn't such a big deal since you'll need to compile anyway if you are planning on writing something with it.

sudo apt-get install build-essential xserver-xorg-dev x11proto-xf86vidmode-dev libxxf86vm-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libxext-dev libxft-dev

I use the very nice Code::Blocks IDE for C development under Linux.

sudo apt-get install codeblocks codeblocks-contrib

Next, it's compile time. You'll need to open a terminal window in the Irrlicht source folder and execute make.

cd ~/workspace/irrlicht/source/Irrlicht
make

If all goes well, the Irrlicht library will have been compiled. Now you'll need to put the library and the Irrlicht header files in a location where the C compiler can see them. Rather than physically moving or copying the folders, I simply symlink them into the standard folders on the boot partition.

sudo ln -s ~/workspace/irrlicht/lib/Linux/libIrrlicht.a /usr/local/lib/libIrrlicht.a
sudo ln -s ~/workspace/irrlicht/include /usr/local/include/irrlicht

Compiling the examples

Now that the library is compiled, we can test the examples. Change into the root of the examples folder and execute make.

cd ~/workspace/irrlicht/examples
make

You'll get some errors since there is one example that is specific to Windows.

Once the compilation is completed, change into the Linux folder under bin where the executables are located. You'll need to execute the examples from the terminal because you will be prompted for the renderer to use, and the prompt only appears in the terminal window. Trying to double click all but the first example (which uses the software renderer by default) will appear to do nothing.

cd ~/workspace/irrlicht/bin/Linux
./01.HelloWorld

Assuming you've got your graphics card driver installed, you'll be wanting to choose option "c", which uses the OpenGL driver, otherwise you'll have to use the software renderer.

Don't forget to put the "./" at the front of the filename, or you'll get the error "command not found".

Compiling the tools

Of course, I'm here to check out the tools, so they'll need to be compiled too.

cd ~/workspace/irrlicht/tools/GUIEditor
make
cd ~/workspace/irrlicht/tools/IrrFontTool/newFontTool
make
cd ~/workspace/irrlicht/tools/MeshConverter
make

Meshviewer and irredit are Windows only, so we'll ignore them.

The compiler will put the tools into the /bin/Linux folder where the examples compiled to.

blog comments powered by Disqus