Added osg::GraphicsContext::WindowingSystemInterfaces singleton for managing multiple WIndowinSystemInterface

implementations being registered at the same time.

One usage case for this functionality to support usage of Wayland and X11 in the same version of the osgViewer.

As part of the new functionality there is now a osg::GraphicsContext::Traits::windowingSystemPreferrence string
that default to empty, but if defined will ensure that a specific WindowingSystemInterface is utilized when
you do a generic call like osg::createGraphicsContext().

Also implemented is standard proxy object for registering the new contexts and removing them automatically, and
declaration of standard graphicswindow_name() C entry point to help with static build linking.
This commit is contained in:
Robert Osfield
2016-05-16 13:45:31 +01:00
parent dd10619192
commit fe6238d126
12 changed files with 204 additions and 67 deletions

View File

@@ -2144,6 +2144,12 @@ public:
};
#if 1
REGISTER_WINDOWINGSYSTEMINTERFACE(X11, X11WindowingSystemInterface)
#else
struct RegisterWindowingSystemInterfaceProxy
{
RegisterWindowingSystemInterfaceProxy()
@@ -2166,7 +2172,6 @@ struct RegisterWindowingSystemInterfaceProxy
}
};
RegisterWindowingSystemInterfaceProxy createWindowingSystemInterfaceProxy;
// declare C entry point for static compilation.
@@ -2174,6 +2179,7 @@ extern "C" void graphicswindow_X11(void)
{
osg::GraphicsContext::setWindowingSystemInterface(new X11WindowingSystemInterface);
}
#endif
void GraphicsWindowX11::raiseWindow()
{