diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2000-03-10 22:11:15 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2000-03-10 22:11:15 +0000 |
commit | 089f713f0d23e9db5d011bc7e7cb742003831f64 (patch) | |
tree | cd468685979ccae479369a75a618d3c7c16c4191 /src | |
parent | 53f81339a4efe30b2c78285d2515bf33e7a954a7 (diff) |
glPopAttrib() now calls Driver's ClearColor, ClearIndex and ColorMask functions
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/attrib.c | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index fc98f0e4c57..b4322d5ab9f 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,4 +1,4 @@ -/* $Id: attrib.c,v 1.10.2.3 1999/12/12 18:30:47 keithw Exp $ */ +/* $Id: attrib.c,v 1.10.2.4 2000/03/10 22:11:15 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -434,19 +434,37 @@ void gl_PopAttrib( GLcontext* ctx ) if (ctx->Color.DrawBuffer != oldDrawBuffer) { gl_DrawBuffer(ctx, ctx->Color.DrawBuffer); } - if ((ctx->Color.AlphaFunc != oldAlphaFunc || - ctx->Color.AlphaRef != oldAlphaRef) && - ctx->Driver.AlphaFunc) - (*ctx->Driver.AlphaFunc)( ctx, ctx->Color.AlphaFunc, - ctx->Color.AlphaRef / 255.0F); if ((ctx->Color.BlendSrcRGB != oldBlendSrc || - ctx->Color.BlendSrcRGB != oldBlendDst) && + ctx->Color.BlendDstRGB != oldBlendDst) && ctx->Driver.BlendFunc) (*ctx->Driver.BlendFunc)( ctx, ctx->Color.BlendSrcRGB, ctx->Color.BlendDstRGB); if (ctx->Color.LogicOp != oldLogicOp && - ctx->Driver.LogicOpcode) + ctx->Driver.LogicOpcode) { ctx->Driver.LogicOpcode( ctx, ctx->Color.LogicOp ); + } + if (ctx->Visual->RGBAflag) { + GLubyte r = (GLint) (ctx->Color.ClearColor[0] * 255.0F); + GLubyte g = (GLint) (ctx->Color.ClearColor[1] * 255.0F); + GLubyte b = (GLint) (ctx->Color.ClearColor[2] * 255.0F); + GLubyte a = (GLint) (ctx->Color.ClearColor[3] * 255.0F); + (*ctx->Driver.ClearColor)( ctx, r, g, b, a ); + if ((ctx->Color.AlphaFunc != oldAlphaFunc || + ctx->Color.AlphaRef != oldAlphaRef) && + ctx->Driver.AlphaFunc) + (*ctx->Driver.AlphaFunc)( ctx, ctx->Color.AlphaFunc, + ctx->Color.AlphaRef / 255.0F); + if (ctx->Driver.ColorMask) { + (*ctx->Driver.ColorMask)(ctx, + ctx->Color.ColorMask[0], + ctx->Color.ColorMask[1], + ctx->Color.ColorMask[2], + ctx->Color.ColorMask[3]); + } + } + else { + (*ctx->Driver.ClearIndex)( ctx, ctx->Color.ClearIndex); + } } break; case GL_CURRENT_BIT: |