Skip to content

Commit f9c589e

Browse files
committedJun 15, 2016
[Globe] Delay initial layer update to workaround some mysterious opengl errors
1 parent 7ddb292 commit f9c589e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/plugins/globe/globe_plugin.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,6 @@ void GlobePlugin::run()
371371
mQgisMapLayer = new osgEarth::ImageLayer( options, mTileSource );
372372
map->addImageLayer( mQgisMapLayer );
373373

374-
// Add layers to the map
375-
updateLayers();
376374

377375
// Create the frustum highlight callback
378376
mFrustumHighlightCallback = new QgsGlobeFrustumHighlightCallback(
@@ -417,9 +415,13 @@ void GlobePlugin::run()
417415
// which appear when launching the globe a second time:
418416
// Delay applySettings one event loop iteration, i.e. one update call of the GL canvas
419417
QTimer* timer = new QTimer();
418+
QTimer* timer2 = new QTimer();
420419
connect( timer, SIGNAL( timeout() ), timer, SLOT( deleteLater() ) );
420+
connect( timer2, SIGNAL( timeout() ), timer2, SLOT( deleteLater() ) );
421421
connect( timer, SIGNAL( timeout() ), this, SLOT( applySettings() ) );
422+
connect( timer2, SIGNAL( timeout() ), this, SLOT( updateLayers() ) );
422423
timer->start( 0 );
424+
timer2->start( 100 );
423425
}
424426

425427
void GlobePlugin::showSettings()

0 commit comments

Comments
 (0)
Please sign in to comment.