/***** Miscellaneous functions *****/
/**********************************************************************/
-/* Enalbe/Disable dithering */
-static void fxDDDither(GLcontext *ctx, GLboolean enable)
-{
- if (MESA_VERBOSE&VERBOSE_DRIVER) {
- fprintf(stderr,"fxmesa: fxDDDither()\n");
- }
-
- if (enable) {
- FX_grDitherMode(GR_DITHER_4x4);
- } else {
- FX_grDitherMode(GR_DITHER_DISABLE);
- }
-}
-
-
/* Return buffer size information */
static void fxDDBufferSize(GLcontext *ctx, GLuint *width, GLuint *height)
{
ctx->Driver.GetString=fxDDGetString;
- ctx->Driver.Dither=fxDDDither;
-
ctx->Driver.NearFar=fxDDSetNearFar;
ctx->Driver.GetParameteri=fxDDGetParameteri;
fxMesa->new_state |= FX_NEW_COLOR_MASK;
ctx->Driver.RenderStart = fxSetupFXUnits;
(void) r; (void) g; (void) b; (void) a;
- return GL_FALSE;
}
static void fxSetupColorMask(GLcontext *ctx)
ctx->Driver.RenderStart = fxSetupFXUnits;
}
break;
+ case GL_DITHER:
+ if (state) {
+ FX_grDitherMode(GR_DITHER_4x4);
+ } else {
+ FX_grDitherMode(GR_DITHER_DISABLE);
+ }
+ break;
case GL_SCISSOR_TEST:
fxMesa->new_state |= FX_NEW_SCISSOR;
ctx->Driver.RenderStart = fxSetupFXUnits;
-/* $Id: wmesa.c,v 1.5 2000/09/07 15:45:28 brianp Exp $ */
+/* $Id: wmesa.c,v 1.6 2000/09/08 21:44:56 brianp Exp $ */
/*
* File name : wmesa.c
/*
* $Log: wmesa.c,v $
+ * Revision 1.6 2000/09/08 21:44:56 brianp
+ * removed ctx->Driver.Dither function
+ *
* Revision 1.5 2000/09/07 15:45:28 brianp
* Removed ctx->Driver.LogicOp().
* ctx->Driver.Index/ColorMask() now return void.
}
-static void dither( GLcontext* ctx, GLboolean enable )
+static void enable( GLcontext* ctx, GLenum pname, GLboolean enable )
{
if (!Current)
return;
- if(enable == GL_FALSE){
- Current->dither_flag = GL_FALSE;
- if(Current->cColorBits == 8)
+ if (pname == GL_DITHER) {
+ if(enable == GL_FALSE){
+ Current->dither_flag = GL_FALSE;
+ if(Current->cColorBits == 8)
Current->pixelformat = PF_INDEX8;
- }
- else{
- if (Current->rgb_flag && Current->cColorBits == 8){
+ }
+ else{
+ if (Current->rgb_flag && Current->cColorBits == 8){
Current->pixelformat = PF_DITHER8;
Current->dither_flag = GL_TRUE;
- }
- else
+ }
+ else
Current->dither_flag = GL_FALSE;
- }
+ }
+ }
}
ctx->Driver.Index = set_index;
ctx->Driver.Color = set_color;
- ctx->Driver.Dither = dither;
+ ctx->Driver.Enable = enable;
ctx->Driver.SetBuffer = set_buffer;
ctx->Driver.GetBufferSize = buffer_size;
\r
\r
\r
-/* Set the index mode bitplane mask. */\r
-static GLboolean index_mask(GLcontext* ctx, GLuint mask)\r
-{\r
- /* can't implement */\r
- return GL_FALSE;\r
-}\r
-\r
-\r
-\r
-/* Set the RGBA drawing mask. */\r
-static GLboolean color_mask( GLcontext* ctx,\r
- GLboolean rmask, GLboolean gmask,\r
- GLboolean bmask, GLboolean amask)\r
-{\r
- /* can't implement */\r
- return GL_FALSE;\r
-}\r
-\r
-\r
-\r
-static void dither( GLcontext* ctx, GLboolean enable )\r
-{\r
- /* No op */\r
-}\r
-\r
-\r
\r
static GLboolean set_buffer( GLcontext* ctx, GLenum mode )\r
{\r
\r
ctx->Driver.Index = set_index;\r
ctx->Driver.Color = set_color;\r
- ctx->Driver.IndexMask = index_mask;\r
- ctx->Driver.ColorMask = color_mask;\r
-\r
- ctx->Driver.Dither = dither;\r
\r
ctx->Driver.SetBuffer = set_buffer;\r
ctx->Driver.GetBufferSize = buffer_size;\r
-/* $Id: xm_dd.c,v 1.1 2000/09/07 15:40:30 brianp Exp $ */
+/* $Id: xm_dd.c,v 1.2 2000/09/08 21:44:57 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
-/*
- * Enable/disable dithering
- */
-static void
-dither( GLcontext *ctx, GLboolean enable )
-{
- const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- if (enable) {
- xmesa->pixelformat = xmesa->xm_visual->dithered_pf;
- }
- else {
- xmesa->pixelformat = xmesa->xm_visual->undithered_pf;
- }
-}
-
-
/**********************************************************************/
/*** glClear implementations ***/
}
+static void
+enable( GLcontext *ctx, GLenum pname, GLboolean state )
+{
+ const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+
+ switch (pname) {
+ case GL_DITHER:
+ if (state)
+ xmesa->pixelformat = xmesa->xm_visual->dithered_pf;
+ else
+ xmesa->pixelformat = xmesa->xm_visual->undithered_pf;
+ break;
+ default:
+ ; /* silence compiler warning */
+ }
+}
+
+
+
/*
* Initialize all the DD.* function pointers depending on the color
* buffer configuration. This is mainly called by XMesaMakeCurrent.
ctx->Driver.Clear = clear_buffers;
ctx->Driver.IndexMask = index_mask;
ctx->Driver.ColorMask = color_mask;
- ctx->Driver.Dither = dither;
+ ctx->Driver.Enable = enable;
ctx->Driver.PointsFunc = xmesa_get_points_func( ctx );
ctx->Driver.LineFunc = xmesa_get_line_func( ctx );
-/* $Id: dd.h,v 1.30 2000/09/07 15:45:27 brianp Exp $ */
+/* $Id: dd.h,v 1.31 2000/09/08 21:44:55 brianp Exp $ */
/*
* Mesa 3-D graphics library
* This is called whenever glFlush() is called.
*/
- void (*Dither)( GLcontext *ctx, GLboolean enable );
- /*
- * Enable/disable dithering.
- * NOTE: This function will be removed in the future in favor
- * of the "Enable" driver function.
- */
-
void (*Error)( GLcontext *ctx );
/*
* Called whenever an error is generated. ctx->ErrorValue contains
-/* $Id: state.c,v 1.25 2000/09/08 21:28:04 brianp Exp $ */
+/* $Id: state.c,v 1.26 2000/09/08 21:44:55 brianp Exp $ */
/*
* Mesa 3-D graphics library
if (ctx->NewState & (NEW_RASTER_OPS | NEW_TEXTURE_ENABLE)) {
update_fog_mode(ctx);
update_rasterflags(ctx);
- if (ctx->Driver.Dither) {
- (*ctx->Driver.Dither)( ctx, ctx->Color.DitherFlag );
- }
/* update scissor region */
ctx->DrawBuffer->Xmin = 0;