Skip to content
Permalink
Browse files

[Globe] Delay initial layer update to workaround some mysterious open…

…gl errors
  • Loading branch information
manisandro committed Jun 15, 2016
1 parent 7ddb292 commit f9c589e4fe8a76d5f54592d9f7b0b0759ffd7ce7
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/plugins/globe/globe_plugin.cpp
@@ -371,8 +371,6 @@ void GlobePlugin::run()
mQgisMapLayer = new osgEarth::ImageLayer( options, mTileSource );
map->addImageLayer( mQgisMapLayer );

// Add layers to the map
updateLayers();

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

void GlobePlugin::showSettings()

0 comments on commit f9c589e

Please sign in to comment.
You can’t perform that action at this time.