Cleaned up the WindowingSystemInterface registration

This commit is contained in:
Robert Osfield 2018-05-18 12:52:50 +01:00
parent 1596058c10
commit ba766b88a8

View File

@ -2277,43 +2277,8 @@ public:
};
#if 1
REGISTER_WINDOWINGSYSTEMINTERFACE(X11, X11WindowingSystemInterface)
#else
struct RegisterWindowingSystemInterfaceProxy
{
RegisterWindowingSystemInterfaceProxy()
{
OSG_INFO<<"RegisterWindowingSystemInterfaceProxy()"<<std::endl;
osg::GraphicsContext::setWindowingSystemInterface(new X11WindowingSystemInterface);
}
~RegisterWindowingSystemInterfaceProxy()
{
OSG_INFO<<"~RegisterWindowingSystemInterfaceProxy()"<<std::endl;
if (osg::Referenced::getDeleteHandler())
{
osg::Referenced::getDeleteHandler()->setNumFramesToRetainObjects(0);
osg::Referenced::getDeleteHandler()->flushAll();
}
osg::GraphicsContext::setWindowingSystemInterface(0);
}
};
RegisterWindowingSystemInterfaceProxy createWindowingSystemInterfaceProxy;
// declare C entry point for static compilation.
extern "C" void graphicswindow_X11(void)
{
osg::GraphicsContext::setWindowingSystemInterface(new X11WindowingSystemInterface);
}
#endif
void GraphicsWindowX11::raiseWindow()
{
Display* display = getDisplayToUse();