mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix pausing and disable double buffering, since it is no longer needed
This commit is contained in:
parent
870c8ebb8c
commit
9a5ac0bf72
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
m_backend.d.postFrame(&m_backend.d, buffer);
|
||||
if (buffer) {
|
||||
m_backend.d.postFrame(&m_backend.d, buffer);
|
||||
}
|
||||
m_mutex.unlock();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue