From 2525bc7d305f6dcab3beb75535da25a488c969b0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 30 Jun 2002 15:47:00 +0000 Subject: Implemented GL_EXT_multi_draw_arrays: glMultiDrawArraysEXT() and glMultiDrawElementsEXT(). --- src/mesa/main/varray.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'src/mesa/main/varray.c') diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index e913869366..3fd318e7d4 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1,4 +1,4 @@ -/* $Id: varray.c,v 1.45 2002/06/15 02:38:16 brianp Exp $ */ +/* $Id: varray.c,v 1.46 2002/06/30 15:47:01 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -799,3 +799,41 @@ _mesa_UnlockArraysEXT( void ) if (ctx->Driver.UnlockArraysEXT) ctx->Driver.UnlockArraysEXT( ctx ); } + + + +/* GL_EXT_multi_draw_arrays */ +/* Somebody forgot to spec the first and count parameters as const! */ +void +_mesa_MultiDrawArraysEXT( GLenum mode, GLint *first, + GLsizei *count, GLsizei primcount ) +{ + GET_CURRENT_CONTEXT(ctx); + GLint i; + + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + + for (i = 0; i < primcount; i++) { + if (count[i] > 0) { + (ctx->Exec->DrawArrays)(mode, first[i], count[i]); + } + } +} + + +/* GL_EXT_multi_draw_arrays */ +void +_mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type, + const GLvoid **indices, GLsizei primcount ) +{ + GET_CURRENT_CONTEXT(ctx); + GLint i; + + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + + for (i = 0; i < primcount; i++) { + if (count[i] > 0) { + (ctx->Exec->DrawElements)(mode, count[i], type, indices[i]); + } + } +} -- cgit v1.2.3