From 9339da500d6d132fc4c7e06fbbc7f388c88d438e Mon Sep 17 00:00:00 2001 From: David Reveman Date: Mon, 6 Feb 2006 22:26:04 +0000 Subject: Draw buffer and swap buffer fixes --- src/glitz_context.c | 17 ++++++++--------- src/glitz_drawable.c | 3 ++- src/glx/glitz_glx_drawable.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') 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 diff --git a/src/glitz_drawable.c b/src/glitz_drawable.c index 77fd833..cef6787 100644 --- a/src/glitz_drawable.c +++ b/src/glitz_drawable.c @@ -306,7 +306,8 @@ glitz_drawable_swap_buffer_region (glitz_drawable_t *drawable, box++; } } - drawable->backend->gl->finish (); + + drawable->backend->gl->flush (); if (surface) glitz_surface_pop_current (surface); diff --git a/src/glx/glitz_glx_drawable.c b/src/glx/glitz_glx_drawable.c index ab94294..d92ad14 100644 --- a/src/glx/glitz_glx_drawable.c +++ b/src/glx/glitz_glx_drawable.c @@ -216,7 +216,7 @@ glitz_glx_destroy (void *abstract_drawable) GLITZ_CONTEXT_CURRENT); glitz_program_map_fini (drawable->base.backend->gl, &drawable->screen_info->program_map); - glitz_program_map_init (&drawable->screen_info->program_map); + glitz_program_map_init (&drawable->screen_info->program_map); glitz_glx_pop_current (abstract_drawable); } -- cgit v1.2.3