23 January 2013

Boost removal, improved library support and VS 2012 builds

We've developed a cut-down implementation of the boost::filesystem features we required in our FileSystemUtils.h header, allowing us to remove our dependency on Boost. As ever this is permissively licensed so feel free to use that file if it meets your needs outside of RCC++, and extend / modify as you need.

Additionally, we've added the capability to link libraries at runtime, in both Windows and Mac OS X builds. A simple example for how to use this with the glewfw library is to create a header which you include instead of the glewfw.h header as follows:
#pragma once

#include <GL/glewfw.h>
#include "RuntimeLinkLibrary.h"

#ifdef _WIN32
RUNTIME_COMPILER_LINKLIBRARY( "glewfw.lib");
RUNTIME_COMPILER_LINKLIBRARY( "opengl32.lib");
#endif
#ifdef __APPLE__
    RUNTIME_COMPILER_LINKLIBRARY( "-framework glewfw");
    RUNTIME_COMPILER_LINKLIBRARY( "-framework OpenGL");
#endif
When included by runtime compiled code, the library will be linked during compilation as and when required. Note that for OS X, we need to specify frameworks with "-framework [name]" and "-l[name]" where [name] is the framework or library (see ld documentation on Apple's developer site). You can link to both static and dynamic libraries this way, but the use of dynamic libraries should be preferred. With dynamic libraries only one instance will be loaded by the executable, and resources (such as graphics data) can be preserved without serialization between runtime compiles.

Being able to use libraries is a significant improvement in functionality. For example, core rendering functionality can now be runtime compiled.

Furthermore, we've fixed up the Visual Studio property sheets so the solution will now build with Visual Studio 2012 (including the express version), though you'll need to upgrade the solution so that it uses the default VS 2012 toolset (called v110) if you want or need to. Visual Studio should prompt you to upgrade the solution when opened.
There's quite a lot more, For full list check out the commits..