summaryrefslogtreecommitdiff
path: root/src/mesa/main/feedback.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-01-25 16:49:20 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-01-25 16:49:20 +0000
commit3781b7bfa5bf0f4e69f8e9641b9d0a9af95c1562 (patch)
treeffe5776f882a89301233c24bfb9cae20bf141d5b /src/mesa/main/feedback.c
parentebd5feab9af92ff08c2b9280e6dfa1a44a7d1c22 (diff)
fixed VB->IndexPtr==NULL bug (Richard Guenther)
Diffstat (limited to 'src/mesa/main/feedback.c')
-rw-r--r--src/mesa/main/feedback.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c
index 2b6ff083b8..71c1025d90 100644
--- a/src/mesa/main/feedback.c
+++ b/src/mesa/main/feedback.c
@@ -1,4 +1,4 @@
-/* $Id: feedback.c,v 1.7 2000/01/17 15:40:43 brianp Exp $ */
+/* $Id: feedback.c,v 1.8 2000/01/25 16:49:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -157,13 +157,14 @@ void gl_feedback_vertex( GLcontext *ctx,
-static void gl_do_feedback_vertex( GLcontext *ctx, GLuint v, GLuint pv )
+static void feedback_vertex( GLcontext *ctx, GLuint v, GLuint pv )
{
GLfloat win[4];
GLfloat color[4];
GLfloat tc[4];
GLuint texUnit = ctx->Texture.CurrentTransformUnit;
- struct vertex_buffer *VB = ctx->VB;
+ const struct vertex_buffer *VB = ctx->VB;
+ GLuint index;
win[0] = VB->Win.data[v][0];
win[1] = VB->Win.data[v][1];
@@ -190,7 +191,12 @@ static void gl_do_feedback_vertex( GLcontext *ctx, GLuint v, GLuint pv )
VB->TexCoordPtr[texUnit]->data[v]);
}
- gl_feedback_vertex( ctx, win, color, VB->IndexPtr->data[v], tc );
+ if (VB->IndexPtr)
+ index = VB->IndexPtr->data[v];
+ else
+ index = 0;
+
+ gl_feedback_vertex( ctx, win, color, index, tc );
}
@@ -205,9 +211,9 @@ void gl_feedback_triangle( GLcontext *ctx,
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_POLYGON_TOKEN );
FEEDBACK_TOKEN( ctx, (GLfloat) 3 ); /* three vertices */
- gl_do_feedback_vertex( ctx, v0, pv );
- gl_do_feedback_vertex( ctx, v1, pv );
- gl_do_feedback_vertex( ctx, v2, pv );
+ feedback_vertex( ctx, v0, pv );
+ feedback_vertex( ctx, v1, pv );
+ feedback_vertex( ctx, v2, pv );
}
}
@@ -221,8 +227,8 @@ void gl_feedback_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv )
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) token );
- gl_do_feedback_vertex( ctx, v1, pv );
- gl_do_feedback_vertex( ctx, v2, pv );
+ feedback_vertex( ctx, v1, pv );
+ feedback_vertex( ctx, v2, pv );
ctx->StippleCounter++;
}
@@ -230,13 +236,13 @@ void gl_feedback_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv )
void gl_feedback_points( GLcontext *ctx, GLuint first, GLuint last )
{
- struct vertex_buffer *VB = ctx->VB;
+ const struct vertex_buffer *VB = ctx->VB;
GLuint i;
for (i=first;i<=last;i++) {
if (VB->ClipMask[i]==0) {
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_POINT_TOKEN );
- gl_do_feedback_vertex( ctx, i, i );
+ feedback_vertex( ctx, i, i );
}
}
}