02 July 2012

Library Support

We've just added improved support for libraries. Whilst it was previously possible to have runtime code linked against a library using the Visual Studio #pragma comment(lib, "nameOfLibrary"), the directories for library search were only specified if added as an environment variable. You can now add library directories as well as include directories, as shown in the example below for supporting DirectX:

m_pRuntimeObjectSystem = new RuntimeObjectSystem;
m_pRuntimeObjectSystem->AddIncludeDir( "%DXSDK_DIR%/Include");

#ifdef _WIN64
m_pRuntimeObjectSystem->AddLibraryDir( "%DXSDK_DIR%/lib/x64/" );
#else
m_pRuntimeObjectSystem->AddLibraryDir( "%DXSDK_DIR%/lib" );
#endif


We hope to improve upon this in future so that developers don't need to specify libraries and paths in both their project file and their code, and to support compilers which don't use the lib comment for libraries.

These features allow some significantly increased flexibility to what can be runtime coded. For example I was able to move scene rendering code to RCC++ for a project, allowing me to not only modify shaders but also C++ code on the fly.

No comments:

Post a Comment