all repos — mgba @ 06a0399186da39ec196382d996c8993d3ea517d3

mGBA Game Boy Advance Emulator

Qt: Fix 15- and 16-bit modes in Qt port
Jeffrey Pfau jeffrey@endrift.com
Sun, 08 Mar 2015 19:54:50 -0700
commit

06a0399186da39ec196382d996c8993d3ea517d3

parent

5feec0317fea4e258be0b8fcdd7b4bc2b5bb54d3

1 files changed, 8 insertions(+), 0 deletions(-)

jump to
M src/platform/qt/Display.cppsrc/platform/qt/Display.cpp

@@ -271,7 +271,15 @@ drawH = w * 2 / 3;

} } glViewport((w - drawW) / 2, (h - drawH) / 2, drawW, drawH); +#ifdef COLOR_16_BIT +#ifdef COLOR_5_6_5 + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, m_backing); +#else + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, m_backing); +#endif +#else glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, m_backing); +#endif glDrawArrays(GL_TRIANGLE_FAN, 0, 4); if (m_context->sync.videoFrameWait) { glFlush();