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

@@ -125,7 +125,7 @@ public:
osg::observer_ptr< osgViewer::ViewerBase > _viewer;
virtual ~HeartBeat();
void init( osgViewer::ViewerBase *viewer );
void stopTimer();
void timerEvent( QTimerEvent *event );
@@ -869,7 +869,6 @@ void GraphicsWindowQt::requestWarpPointer( float x, float y )
QCursor::setPos( _widget->mapToGlobal(QPoint((int)x,(int)y)) );
}
class QtWindowingSystem : public osg::GraphicsContext::WindowingSystemInterface
{
public:
@@ -945,6 +944,9 @@ private:
QtWindowingSystem& operator=( const QtWindowingSystem& );
};
#if 1
REGISTER_WINDOWINGSYSTEMINTERFACE(Qt, QtWindowingSystem)
#else
// declare C entry point for static compilation.
extern "C" void OSGQT_EXPORT graphicswindow_Qt(void)
@@ -957,7 +959,7 @@ void osgQt::initQtWindowingSystem()
{
graphicswindow_Qt();
}
#endif
void osgQt::setViewer( osgViewer::ViewerBase *viewer )