句柄是以下面的方式傳遞給osgViewer::Viewer的,
osgViewer::View.getCamera().setGraphicsContext(osg::GraphicsContext);
下面是獲得此句柄的方法。
這個句柄就是MFC CView的句柄。
PostMsgToViewer(osgViewer::Viewer *pViewer,unsigned msg,WPARAM wp,LPARAM lp)
{
osgViewer::ViewerBase::Windows windows;
pViewer->getViewerBase()->getWindows(windows);
(windows.size()==)
;
osgViewer::GraphicsWindow *pWin = dynamic_cast<osgViewer::GraphicsWindow *>(windows());
PostMessage(pWin,msg,wp,lp);
}
url:http://greatverve.cnblogs.com/p/PostMsgToViewer.html
沒有環境,代碼可能不准確。