Heilan X3D Browser

Creating a library

You should probably be able to figure out the steps to create a library yourself from libheilanextras, but here are the most important things to note.

libraryInitialise()

For Heilan to be able to load your library, you must have a libraryInitialise() function, in which you register your nodes etc. with the browser's NodeFactory instance. A simple example is:

#include "NodeFactory.h"

#include "Thing.h"

using namespace HeilanX3D;

extern "C"
{

//------------------------------------------------------------------------------
void libraryInitialise()
{
	NodeFactory::getInstance().registerNode(&Thing::constructor);
}

}
		

Linking on Linux

You should link your library to the heilanbrowser executable. To do this on Linux, you just need to make sure your CXXFLAGS for the compilation have the following flags:

CXXFLAGS="-Bdynamic -shared"
		

Linking on Windows

On Windows, Heilan is built using MSVC v6. To build your library, you will first have to build Heilan from source, which will create an import library file, 'HeilanBrowser.lib' along with the executable. Just add this file to your list of libraries in the project settings, and your library should compile and work with Heilan.