diff options
Diffstat (limited to 'src/glitz_context.c')
-rw-r--r-- | src/glitz_context.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/glitz_context.c b/src/glitz_context.c index fe0e637..377dd59 100644 --- a/src/glitz_context.c +++ b/src/glitz_context.c @@ -212,15 +212,14 @@ glitz_context_draw_buffers (glitz_context_t *context, if (mask) { - if (mask == (FRONT_BIT | BACK_BIT)) - context->drawable->backend->draw_buffer (context->drawable, - GLITZ_GL_FRONT_AND_BACK); - else if (mask == FRONT_BIT) - context->drawable->backend->draw_buffer (context->drawable, - GLITZ_GL_FRONT); - else - context->drawable->backend->draw_buffer (context->drawable, - GLITZ_GL_BACK); + static const glitz_gl_enum_t mode[] = { + GLITZ_GL_FRONT, + GLITZ_GL_BACK, + GLITZ_GL_FRONT_AND_BACK + }; + + context->drawable->backend->draw_buffer (context->drawable, + mode[mask - 1]); } #undef FRONT_BIT |