From 315031fa3b058dee4e36f81926500f53b533f209 Mon Sep 17 00:00:00 2001 From: limbolily Date: Mon, 6 Jan 2020 14:48:34 +0800 Subject: [PATCH] Fix navagation error about Android GLES2 example. Android GLES2 example use event queue without initializing window rectangle with graphics context,that produce navigation error. --- examples/osgAndroidExampleGLES2/jni/OsgMainApp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/osgAndroidExampleGLES2/jni/OsgMainApp.cpp b/examples/osgAndroidExampleGLES2/jni/OsgMainApp.cpp index 8d11fb14d..628e15588 100644 --- a/examples/osgAndroidExampleGLES2/jni/OsgMainApp.cpp +++ b/examples/osgAndroidExampleGLES2/jni/OsgMainApp.cpp @@ -103,7 +103,9 @@ void OsgMainApp::initOsgWindow(int x,int y,int width,int height){ osg::notify(osg::ALWAYS)<<"Testing"<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); _root = new osg::Group();