all repos — mgba @ 0b9d6e03f11ba9c08c9fb9745f4f711a95b8915c

mGBA Game Boy Advance Emulator

Support 5_6_5 in SDL/GL port
Jeffrey Pfau jeffrey@endrift.com
Sun, 13 Jul 2014 18:31:28 -0700
commit

0b9d6e03f11ba9c08c9fb9745f4f711a95b8915c

parent

ca23c47aeb71af1a14f4a7389c32bf8d1c158e3d

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

jump to
M src/platform/sdl/gl-main.csrc/platform/sdl/gl-main.c

@@ -183,7 +183,11 @@ while (context->state < THREAD_EXITING) {

if (GBASyncWaitFrameStart(&context->sync, context->frameskip)) { glBindTexture(GL_TEXTURE_2D, renderer->tex); #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, renderer->d.outputBuffer); +#else glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, renderer->d.outputBuffer); +#endif #else glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, renderer->d.outputBuffer); #endif