osg::Camera::getGraphicsContext()

osg::Camera* pCamera = pOsgView->getCamera();
osg::GraphicsContext* pGraphicsContext = pCamera->getGraphicsContext();
const osg::GraphicsContext::Traits* pTraits = pGraphicsContext->getTraits();
auto pWindowData = dynamic_cast<osgViewer::GraphicsWindowWin32::WindowData*>(pTraits->inheritedWindowData.get());
if (pWindowData && pWindowData->_hwnd != NULL)
{
//...
}