mirror of https://github.com/mgba-emu/mgba.git
OpenGL: Fix frame sizing regression
This commit is contained in:
parent
06cc738b00
commit
99d07c98c5
|
@ -192,14 +192,13 @@ static void mGLES2ContextResized(struct VideoBackend* v, unsigned w, unsigned h)
|
||||||
drawW -= drawW % v->width;
|
drawW -= drawW % v->width;
|
||||||
drawH -= drawH % v->height;
|
drawH -= drawH % v->height;
|
||||||
}
|
}
|
||||||
glViewport(0, 0, w, h);
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
glClearColor(0.f, 0.f, 0.f, 1.f);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
glViewport((w - drawW) / 2, (h - drawH) / 2, drawW, drawH);
|
glViewport((w - drawW) / 2, (h - drawH) / 2, drawW, drawH);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mGLES2ContextClear(struct VideoBackend* v) {
|
static void mGLES2ContextClear(struct VideoBackend* v) {
|
||||||
UNUSED(v);
|
UNUSED(v);
|
||||||
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
glClearColor(0.f, 0.f, 0.f, 1.f);
|
glClearColor(0.f, 0.f, 0.f, 1.f);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,8 +321,6 @@ void PainterGL::setMessagePainter(MessagePainter* messagePainter) {
|
||||||
|
|
||||||
void PainterGL::resize(const QSize& size) {
|
void PainterGL::resize(const QSize& size) {
|
||||||
m_size = 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) {
|
if (m_started && !m_active) {
|
||||||
forceDraw();
|
forceDraw();
|
||||||
}
|
}
|
||||||
|
@ -419,6 +417,8 @@ void PainterGL::unpause() {
|
||||||
|
|
||||||
void PainterGL::performDraw() {
|
void PainterGL::performDraw() {
|
||||||
m_painter.beginNativePainting();
|
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_backend->drawFrame(m_backend);
|
||||||
m_painter.endNativePainting();
|
m_painter.endNativePainting();
|
||||||
if (m_messagePainter) {
|
if (m_messagePainter) {
|
||||||
|
|
Loading…
Reference in New Issue