all repos — mgba @ 99d07c98c5d03510899c50a67573498900cddfef

mGBA Game Boy Advance Emulator

OpenGL: Fix frame sizing regression
Vicki Pfau vi@endrift.com
Wed, 15 May 2019 10:16:06 -0700
commit

99d07c98c5d03510899c50a67573498900cddfef

parent

06cc738b008cb0017965b14013c3039bdd430df8

2 files changed, 4 insertions(+), 5 deletions(-)

jump to
M src/platform/opengl/gles2.csrc/platform/opengl/gles2.c

@@ -192,14 +192,13 @@ if (v->lockIntegerScaling) {

drawW -= drawW % v->width; drawH -= drawH % v->height; } - glViewport(0, 0, w, h); - glClearColor(0.f, 0.f, 0.f, 1.f); - glClear(GL_COLOR_BUFFER_BIT); + glBindFramebuffer(GL_FRAMEBUFFER, 0); glViewport((w - drawW) / 2, (h - drawH) / 2, drawW, drawH); } static void mGLES2ContextClear(struct VideoBackend* v) { UNUSED(v); + glBindFramebuffer(GL_FRAMEBUFFER, 0); glClearColor(0.f, 0.f, 0.f, 1.f); glClear(GL_COLOR_BUFFER_BIT); }
M src/platform/qt/DisplayGL.cppsrc/platform/qt/DisplayGL.cpp

@@ -321,8 +321,6 @@ }

void PainterGL::resize(const QSize& size) { m_size = size; - float r = m_surface->devicePixelRatio(); - m_backend->resized(m_backend, m_size.width() * r, m_size.height() * r); if (m_started && !m_active) { forceDraw(); }

@@ -419,6 +417,8 @@ }

void PainterGL::performDraw() { m_painter.beginNativePainting(); + float r = m_surface->devicePixelRatio(); + m_backend->resized(m_backend, m_size.width() * r, m_size.height() * r); m_backend->drawFrame(m_backend); m_painter.endNativePainting(); if (m_messagePainter) {