From 4b5c71e16d12f0e87de3b8a4a5bd5d69ae39daa7 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Sat, 8 Aug 2015 13:37:46 -0700 Subject: [PATCH] Merge fixes --- interface/src/Application.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 4d2739c442..a45233b85b 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -526,6 +526,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : _window->setCentralWidget(_glWidget); _window->restoreGeometry(); + _window->setVisible(true); _glWidget->setFocusPolicy(Qt::StrongFocus); _glWidget->setFocus(); @@ -547,9 +548,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : _offscreenContext->makeCurrent(); initializeGL(); - _window->setVisible(true); - _offscreenContext->makeCurrent(); - _toolWindow = new ToolWindow(); _toolWindow->setWindowFlags(_toolWindow->windowFlags() | Qt::WindowStaysOnTopHint); @@ -796,7 +794,6 @@ void Application::initializeGL() { isInitialized = true; } #endif - // Where the gpuContext is initialized and where the TRUE Backend is created and assigned gpu::Context::init(); _gpuContext = std::make_shared(); @@ -1176,6 +1173,10 @@ void Application::resizeEvent(QResizeEvent * event) { void Application::resizeGL() { PROFILE_RANGE(__FUNCTION__); + if (nullptr == _displayPlugin) { + return; + } + auto displayPlugin = getActiveDisplayPlugin(); // Set the desired FBO texture size. If it hasn't changed, this does nothing. // Otherwise, it must rebuild the FBOs @@ -4498,7 +4499,7 @@ int Application::getMaxOctreePacketsPerSecond() { } qreal Application::getDevicePixelRatio() { - return _window ? _window->windowHandle()->devicePixelRatio() : 1.0; + return (_window && _window->windowHandle()) ? _window->windowHandle()->devicePixelRatio() : 1.0; } DisplayPlugin * Application::getActiveDisplayPlugin() {