-/* $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
-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];
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 );
}
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 );
}
}
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++;
}
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 );
}
}
}