fix GL_BACK color material bug
[mesa.git] / src / mesa / main / varray.c
index 31c378aac087b137b45f0ecd06f5c91a3a54a5a3..072426c6ea018d0fbbc20a1cda3e510c4f476c46 100644 (file)
@@ -1,8 +1,8 @@
-/* $Id: varray.c,v 1.19 2000/02/02 19:17:57 brianp Exp $ */
+/* $Id: varray.c,v 1.22 2000/06/12 15:30:51 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
- * Version:  3.1
+ * Version:  3.3
  * 
  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved.
  * 
@@ -370,6 +370,63 @@ static void gl_CVAEltPointer( GLcontext *ctx, GLenum type, const GLvoid *ptr )
 #endif
 
 
+
+void
+_mesa_VertexPointerEXT(GLint size, GLenum type, GLsizei stride,
+                       GLsizei count, const GLvoid *ptr)
+{
+   (void) count;
+   _mesa_VertexPointer(size, type, stride, ptr);
+}
+
+
+void
+_mesa_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count,
+                       const GLvoid *ptr)
+{
+   (void) count;
+   _mesa_NormalPointer(type, stride, ptr);
+}
+
+
+void
+_mesa_ColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count,
+                      const GLvoid *ptr)
+{
+   (void) count;
+   _mesa_ColorPointer(size, type, stride, ptr);
+}
+
+
+void
+_mesa_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count,
+                      const GLvoid *ptr)
+{
+   (void) count;
+   _mesa_IndexPointer(type, stride, ptr);
+}
+
+
+void
+_mesa_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride,
+                         GLsizei count, const GLvoid *ptr)
+{
+   (void) count;
+   _mesa_TexCoordPointer(size, type, stride, ptr);
+}
+
+
+void
+_mesa_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr)
+{
+   (void) count;
+   _mesa_EdgeFlagPointer(stride, ptr);
+}
+
+
+
+
+
 /* KW: Batch function to exec all the array elements in the input
  *     buffer prior to transform.  Done only the first time a vertex
  *     buffer is executed or compiled.
@@ -681,6 +738,7 @@ _mesa_DrawArrays(GLenum mode, GLint start, GLsizei count)
 
         VB->NextPrimitive[VB->CopyStart] = VB->Count;
         VB->Primitive[VB->CopyStart] = mode;
+        ctx->Array.Flag[count] |= VERT_END_VB;
 
          /* Transform and render.
          */
@@ -816,7 +874,7 @@ _mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indice
       return;
    }
 
-   if (mode > GL_POLYGON) {
+   if (mode < 0 || mode > GL_POLYGON) {
       gl_error( ctx, GL_INVALID_ENUM, "glDrawArrays(mode)" );
       return;
    }
@@ -1122,6 +1180,13 @@ _mesa_DrawRangeElements(GLenum mode, GLuint start,
       return;
    }
 
+#if 0
+   /*
+    * XXX something in locked arrays is broken!  If start = 0,
+    * end = 1 and count = 2 we'll take the LockArrays path and
+    * get incorrect results.  See Scott McMillan's bug of 3 Jan 2000.
+    * For now, don't use locked arrays.
+    */
    if (!ctx->Array.LockCount && 2*count > (GLint) 3*(end-start)) {
       glLockArraysEXT( start, end );
       glDrawElements( mode, count, type, indices );
@@ -1129,6 +1194,9 @@ _mesa_DrawRangeElements(GLenum mode, GLuint start,
    } else {
       glDrawElements( mode, count, type, indices );
    }
+#else
+   glDrawElements( mode, count, type, indices );
+#endif
 }