diff --git a/include/osg/GraphicsContext b/include/osg/GraphicsContext index ac196d5a8..33d7b0b12 100644 --- a/include/osg/GraphicsContext +++ b/include/osg/GraphicsContext @@ -597,6 +597,10 @@ struct WindowingSystemInterfaceProxy osg::ref_ptr _wsi; }; +#define REGISTER_WINDOWINGSYSTEMINTERFACE(ext, classname) \ + extern "C" void graphicswindow_##ext(void) {} \ + static osg::WindowingSystemInterfaceProxy s_proxy_##classname(#ext); + } #endif diff --git a/include/osgViewer/GraphicsWindow b/include/osgViewer/GraphicsWindow index 2ee2f24c0..b09f56e5e 100644 --- a/include/osgViewer/GraphicsWindow +++ b/include/osgViewer/GraphicsWindow @@ -274,10 +274,6 @@ class GraphicsWindowEmbedded : public GraphicsWindow }; -#define REGISTER_WINDOWINGSYSTEMINTERFACE(ext, classname) \ - extern "C" OSGVIEWER_EXPORT void graphicswindow_##ext(void) {} \ - static osg::WindowingSystemInterfaceProxy s_proxy_##classname(#ext); - struct GraphicsWindowFunctionProxy { GraphicsWindowFunctionProxy(CGraphicsWindowFunction function) { (function)(); } diff --git a/src/osgViewer/GraphicsWindowWin32.cpp b/src/osgViewer/GraphicsWindowWin32.cpp index 035258dcd..91e6c8f49 100644 --- a/src/osgViewer/GraphicsWindowWin32.cpp +++ b/src/osgViewer/GraphicsWindowWin32.cpp @@ -3147,15 +3147,9 @@ static RegisterWindowingSystemInterfaceProxy createWindowingSystemInterfaceProxy } // namespace OsgViewer -#if 1 -REGISTER_WINDOWINGSYSTEMINTERFACE(Win32, Win32WindowingSystem) -#else -// declare C entry point for static compilation. -extern "C" void OSGVIEWER_EXPORT graphicswindow_Win32(void) -{ - osg::GraphicsContext::setWindowingSystemInterface(osgViewer::Win32WindowingSystem::getInterface()); -} -#endif + +extern "C" OSGVIEWER_EXPORT void graphicswindow_Win32(void) {} +static osg::WindowingSystemInterfaceProxy s_proxy_Win32WindowingSystem("Win32"); void GraphicsWindowWin32::raiseWindow() {