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.

On OSX

Here's a list of things you need to do to set up an XCode project for building a Heilan library (note: I'm not an XCode guru, so there may be some things that could be done better):

  1. Create a BSD Dynamic Library project in XCode.
  2. In the project settings (General) make sure 'Cross-Develop Using Target SDK:' is set to 'Mac OS X 10.4 (Universal)'.
  3. In the Target settings:
  4. Clear 'Installation Directory'.
  5. Change 'Strip Style' to 'Debugging Symbols'.
  6. Clear 'Dynamic Library Install Name'.
  7. Add '-dynamiclib -flat_namespace -undefined dynamic_lookup -Bdynamic' to 'Other Linker Flags'.
  8. Clear 'Private Headers Folder Path' and 'Public Headers Folder Path', enter a 'Product Name'.
  9. Add an entry to 'Header Search Paths' pointing to the HeilanBrowser headers ('<your_path>/HeilanBrowser/include').