mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 12:14:00 +02:00
Skip rendering when we're minimized.
This commit is contained in:
parent
d580f177a3
commit
2e119fa0fe
1 changed files with 6 additions and 4 deletions
|
@ -11,6 +11,7 @@
|
|||
#include "GLCanvas.h"
|
||||
#include <QMimeData>
|
||||
#include <QUrl>
|
||||
#include <QMainWindow>
|
||||
|
||||
GLCanvas::GLCanvas() : QGLWidget(QGLFormat(QGL::NoDepthBuffer, QGL::NoStencilBuffer)), _throttleRendering(false), _idleRenderInterval(100) {
|
||||
}
|
||||
|
@ -24,7 +25,7 @@ void GLCanvas::initializeGL() {
|
|||
}
|
||||
|
||||
void GLCanvas::paintGL() {
|
||||
if (!_throttleRendering) {
|
||||
if (!_throttleRendering && !Application::getInstance()->getWindow()->isMinimized()) {
|
||||
Application::getInstance()->paintGL();
|
||||
}
|
||||
}
|
||||
|
@ -78,10 +79,11 @@ void GLCanvas::activeChanged() {
|
|||
}
|
||||
}
|
||||
|
||||
void GLCanvas::throttleRender()
|
||||
{
|
||||
void GLCanvas::throttleRender() {
|
||||
_frameTimer.start(_idleRenderInterval);
|
||||
Application::getInstance()->paintGL();
|
||||
if (!Application::getInstance()->getWindow()->isMinimized()) {
|
||||
Application::getInstance()->paintGL();
|
||||
}
|
||||
}
|
||||
|
||||
int updateTime = 0;
|
||||
|
|
Loading…
Reference in a new issue