diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2000-01-06 09:28:38 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2000-01-06 09:28:38 +0000 |
commit | dd020f13a6d520b46aefd4453dae6b6edcc427f6 (patch) | |
tree | c0c782f7fbdf6085dd63679c9cc8b9b7c82be6d4 /src/mesa/drivers/osmesa | |
parent | d3c145b98a6ef51d1239b8a47f199d245e6f1fd3 (diff) |
updated Clear function for new mask bits
Diffstat (limited to 'src/mesa/drivers/osmesa')
-rw-r--r-- | src/mesa/drivers/osmesa/osmesa.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 5284c8c132b..ceedaf68c1a 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,4 +1,4 @@ -/* $Id: osmesa.c,v 1.6 1999/12/17 12:23:25 brianp Exp $ */ +/* $Id: osmesa.c,v 1.7 2000/01/06 09:28:38 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -558,7 +558,16 @@ static GLbitfield clear( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ) { OSMesaContext osmesa = (OSMesaContext) ctx->DriverCtx; - if (mask & GL_COLOR_BUFFER_BIT) { + const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask; + + /* we can't handle color or index masking */ + if (*colorMask != 0xffffffff || ctx->Color.IndexMask != 0xffffffff) + return mask; + + /* sanity check - we only have a front-left buffer */ + ASSERT((mask & (DD_FRONT_RIGHT_BIT | DD_BACK_LEFT_BIT | DD_BACK_RIGHT_BIT)) == 0); + + if (mask & DD_FRONT_LEFT_BIT) { if (osmesa->format==OSMESA_COLOR_INDEX) { if (all) { /* Clear whole CI buffer */ @@ -631,7 +640,8 @@ static GLbitfield clear( GLcontext *ctx, GLbitfield mask, GLboolean all, } } } - return mask & (~GL_COLOR_BUFFER_BIT); + /* have Mesa clear all other buffers */ + return mask & (~DD_FRONT_LEFT_BIT); } |