diff --git a/include/osgViewer/GraphicsWindowCarbon b/include/osgViewer/GraphicsWindowCarbon index 9e6d47cab..207a6ebdb 100644 --- a/include/osgViewer/GraphicsWindowCarbon +++ b/include/osgViewer/GraphicsWindowCarbon @@ -44,6 +44,7 @@ class GraphicsWindowCarbon : public osgViewer::GraphicsWindow { setState( new osg::State ); getState()->setContextID( osg::GraphicsContext::createNewContextID() ); + getState()->setGraphicsContext(this); } } diff --git a/include/osgViewer/GraphicsWindowX11 b/include/osgViewer/GraphicsWindowX11 index 436559be1..3a4092641 100644 --- a/include/osgViewer/GraphicsWindowX11 +++ b/include/osgViewer/GraphicsWindowX11 @@ -56,6 +56,7 @@ class GraphicsWindowX11 : public osgViewer::GraphicsWindow { setState( new osg::State ); getState()->setContextID( osg::GraphicsContext::createNewContextID() ); + getState()->setGraphicsContext(this); } } diff --git a/src/osgViewer/GraphicsWindowWin32.cpp b/src/osgViewer/GraphicsWindowWin32.cpp index 17653f7b0..fd7e2736d 100644 --- a/src/osgViewer/GraphicsWindowWin32.cpp +++ b/src/osgViewer/GraphicsWindowWin32.cpp @@ -1006,6 +1006,7 @@ GraphicsWindowWin32::GraphicsWindowWin32( osg::GraphicsContext::Traits* traits ) { setState( new osg::State ); getState()->setContextID( osg::GraphicsContext::createNewContextID() ); + getState()->setGraphicsContext(this); } }