Minor tweaks to help out at a driver level.
[mesa.git] / src / mesa / main / accum.c
index d190508a6158a0e88540bc1088a21aaf521f8054..315bd33b61da9c01fef9525eda34862f00353d91 100644 (file)
@@ -1,10 +1,8 @@
-/* $Id: accum.c,v 1.38 2001/09/14 21:36:43 brianp Exp $ */
-
 /*
  * Mesa 3-D graphics library
- * Version:  3.5
+ * Version:  5.1
  *
- * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
 #include "glheader.h"
 #include "accum.h"
 #include "context.h"
+#include "imports.h"
 #include "macros.h"
-#include "mem.h"
 #include "state.h"
 #include "mtypes.h"
-#endif
-
 
 
-
-void
+void GLAPIENTRY
 _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
 {
    GLfloat tmp[4];
@@ -59,9 +50,8 @@ _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
    COPY_4FV( ctx->Accum.ClearColor, tmp );
 }
 
-/* Should really be a driver-supplied function?
- */
-void
+
+void GLAPIENTRY
 _mesa_Accum( GLenum op, GLfloat value )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -76,6 +66,11 @@ _mesa_Accum( GLenum op, GLfloat value )
    if (ctx->NewState)
       _mesa_update_state( ctx );
 
+   if (ctx->RenderMode != GL_RENDER) {
+      /* no-op */
+      return;
+   }
+
    /* Determine region to operate upon. */
    if (ctx->Scissor.Enabled) {
       xpos = ctx->Scissor.X;
@@ -93,3 +88,10 @@ _mesa_Accum( GLenum op, GLfloat value )
 
    ctx->Driver.Accum( ctx, op, value, xpos, ypos, width, height );
 }
+
+void 
+_mesa_init_accum( GLcontext *ctx )
+{
+   /* Accumulate buffer group */
+   ASSIGN_4V( ctx->Accum.ClearColor, 0.0, 0.0, 0.0, 0.0 );
+}