remove ^M chars, disable shading language extensions
[mesa.git] / src / mesa / main / accum.c
index 1185adbfd41855392e4400401845dd456a7047aa..c1346bab4cdd71fb5e8e1063ac224324366ce599 100644 (file)
@@ -1,9 +1,8 @@
-
 /*
  * Mesa 3-D graphics library
- * Version:  4.1
+ * Version:  6.3
  *
- * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2005  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"),
@@ -32,7 +31,7 @@
 #include "mtypes.h"
 
 
-void
+void GLAPIENTRY
 _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
 {
    GLfloat tmp[4];
@@ -51,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);
@@ -65,9 +63,27 @@ _mesa_Accum( GLenum op, GLfloat value )
       return;
    }
 
+   switch (op) {
+   case GL_ADD:
+   case GL_MULT:
+   case GL_ACCUM:
+   case GL_LOAD:
+   case GL_RETURN:
+      /* OK */
+      break;
+   default:
+      _mesa_error(ctx, GL_INVALID_ENUM, "glAccum(op)");
+      return;
+   }
+
    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;
@@ -85,3 +101,12 @@ _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 );
+}