Fix navagation error about Android GLES2 example.

Android GLES2 example use event queue without initializing window rectangle with graphics context,that produce navigation error.
This commit is contained in:
limbolily 2020-01-06 14:48:34 +08:00 committed by Robert Osfield
parent aa94cd4fef
commit 8011d9414b

View File

@ -103,7 +103,9 @@ void OsgMainApp::initOsgWindow(int x,int y,int width,int height){
osg::notify(osg::ALWAYS)<<"Testing"<<std::endl; osg::notify(osg::ALWAYS)<<"Testing"<<std::endl;
_viewer = new osgViewer::Viewer(); _viewer = new osgViewer::Viewer();
_viewer->setUpViewerAsEmbeddedInWindow(x, y, width, height); osgViewer::GraphicsWindowEmbedded* window = _viewer->setUpViewerAsEmbeddedInWindow(x, y, width, height);
_viewer->getEventQueue()->setGraphicsContext(window);
_viewer->getEventQueue()->syncWindowRectangleWithGraphicsContext();
_viewer->setThreadingModel(osgViewer::ViewerBase::SingleThreaded); _viewer->setThreadingModel(osgViewer::ViewerBase::SingleThreaded);
_root = new osg::Group(); _root = new osg::Group();