Qt: Fix pausing and disable double buffering, since it is no longer needed

This commit is contained in:
Jeffrey Pfau 2015-08-06 19:42:08 -07:00
parent 870c8ebb8c
commit 9a5ac0bf72
2 changed files with 8 additions and 9 deletions

View File

@ -22,7 +22,7 @@ Display::Driver Display::s_driver = Display::Driver::QT;
Display* Display::create(QWidget* parent) {
#ifdef BUILD_GL
QGLFormat format(QGLFormat(QGL::Rgba | QGL::DoubleBuffer));
QGLFormat format(QGLFormat(QGL::Rgba | QGL::SingleBuffer));
format.setSwapInterval(1);
#endif

View File

@ -244,12 +244,9 @@ void PainterGL::stop() {
void PainterGL::pause() {
m_active = false;
// Make sure both buffers are filled
m_gl->makeCurrent();
dequeueAll();
forceDraw();
forceDraw();
m_gl->doneCurrent();
if (!m_queue.isEmpty()) {
QMetaObject::invokeMethod(this, "pause", Qt::QueuedConnection);
}
}
void PainterGL::unpause() {
@ -293,12 +290,14 @@ void PainterGL::dequeue() {
}
void PainterGL::dequeueAll() {
uint32_t* buffer;
uint32_t* buffer = 0;
m_mutex.lock();
while (!m_queue.isEmpty()) {
buffer = m_queue.dequeue();
m_free.append(buffer);
}
if (buffer) {
m_backend.d.postFrame(&m_backend.d, buffer);
}
m_mutex.unlock();
}