From 2a03cf1bab0da6a380cb1c27dd2aef8f689f9812 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Fri, 14 Mar 2014 17:17:38 -0700 Subject: [PATCH 1/2] make throttle rendering not adjust LOD --- interface/src/Application.cpp | 4 ++-- interface/src/Application.h | 3 ++- interface/src/GLCanvas.h | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 37b2810c68..50dbf1b51a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1607,8 +1607,8 @@ bool Application::isLookingAtMyAvatar(Avatar* avatar) { } void Application::updateLOD() { - // adjust it unless we were asked to disable this feature - if (!Menu::getInstance()->isOptionChecked(MenuOption::DisableAutoAdjustLOD)) { + // adjust it unless we were asked to disable this feature, or if we're currently in throttleRendering mode + if (!Menu::getInstance()->isOptionChecked(MenuOption::DisableAutoAdjustLOD) && !isThrottleRendering()) { Menu::getInstance()->autoAdjustLOD(_fps); } } diff --git a/interface/src/Application.h b/interface/src/Application.h index a9fa04904f..cbfbf4166d 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -147,6 +147,7 @@ public: glm::vec3 getMouseVoxelWorldCoordinates(const VoxelDetail& mouseVoxel); QGLWidget* getGLWidget() { return _glWidget; } + bool isThrottleRendering() const { return _glWidget->isThrottleRendering(); } MyAvatar* getAvatar() { return _myAvatar; } Audio* getAudio() { return &_audio; } Camera* getCamera() { return &_myCamera; } @@ -339,7 +340,7 @@ private: void displayRearMirrorTools(); QMainWindow* _window; - QGLWidget* _glWidget; + GLCanvas* _glWidget; // our GLCanvas has a couple extra features bool _statsExpanded; BandwidthMeter _bandwidthMeter; diff --git a/interface/src/GLCanvas.h b/interface/src/GLCanvas.h index e6dcc38977..e6d96141b4 100644 --- a/interface/src/GLCanvas.h +++ b/interface/src/GLCanvas.h @@ -17,6 +17,7 @@ class GLCanvas : public QGLWidget { Q_OBJECT public: GLCanvas(); + bool isThrottleRendering() const { return _throttleRendering; } protected: QTimer _frameTimer; From a5eb5d6515a9fe88f0c2f02d324a2bdbb973c438 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Fri, 14 Mar 2014 17:22:35 -0700 Subject: [PATCH 2/2] handle minimize case --- interface/src/GLCanvas.cpp | 4 ++++ interface/src/GLCanvas.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/interface/src/GLCanvas.cpp b/interface/src/GLCanvas.cpp index ea04002ddb..d6ef9d180c 100644 --- a/interface/src/GLCanvas.cpp +++ b/interface/src/GLCanvas.cpp @@ -19,6 +19,10 @@ GLCanvas::GLCanvas() : QGLWidget(QGLFormat(QGL::NoDepthBuffer)), { } +bool GLCanvas::isThrottleRendering() const { + return _throttleRendering || Application::getInstance()->getWindow()->isMinimized(); +} + void GLCanvas::initializeGL() { Application::getInstance()->initializeGL(); setAttribute(Qt::WA_AcceptTouchEvents); diff --git a/interface/src/GLCanvas.h b/interface/src/GLCanvas.h index e6d96141b4..ad396a48ce 100644 --- a/interface/src/GLCanvas.h +++ b/interface/src/GLCanvas.h @@ -17,7 +17,7 @@ class GLCanvas : public QGLWidget { Q_OBJECT public: GLCanvas(); - bool isThrottleRendering() const { return _throttleRendering; } + bool isThrottleRendering() const; protected: QTimer _frameTimer;