Fix for OSG without OSG_INIT_SINGLETON_PROXY

This commit is contained in:
Thomas Geymayer
2013-07-13 11:37:24 +02:00
parent 01c45633b7
commit 486011dceb

View File

@@ -87,6 +87,18 @@ namespace canvas
}
};
#ifndef OSG_INIT_SINGLETON_PROXY
/**
* http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk/include/osg/Object
*
* Helper macro that creates a static proxy object to call singleton function
* on it's construction, ensuring that the singleton gets initialized at
* startup.
*/
# define OSG_INIT_SINGLETON_PROXY(ProxyName, Func)\
static struct ProxyName{ ProxyName() { Func; } } s_##ProxyName;
#endif
OSG_INIT_SINGLETON_PROXY(
PreOrderBinProxy,
(osgUtil::RenderBin::addRenderBinPrototype("PreOrderBin", new PreOrderBin))