float x0, float y0, float x1, float y1, GLfloat z,
const GLfloat color[4])
{
- static const GLuint attribs[2] = {
- 0, /* pos */
- 3 /* color */
- };
GLfloat verts[4][2][4]; /* four verts, two attribs, XYZW */
GLuint i;
verts[i][1][3] = color[3];
}
- st_draw_vertices(ctx, PIPE_PRIM_QUADS, 4, (float *) verts, 2, attribs);
+ st_draw_vertices(ctx, PIPE_PRIM_QUADS, 4, (float *) verts, 2);
}
draw_quad(GLcontext *ctx, GLfloat x0, GLfloat y0, GLfloat z,
GLfloat x1, GLfloat y1)
{
- static const GLuint attribs[2] = {
- 0, /* pos */
- 8 /* tex0 */
- };
GLfloat verts[4][2][4]; /* four verts, two attribs, XYZW */
GLuint i;
verts[i][1][3] = 1.0; /*Q*/
}
- st_draw_vertices(ctx, PIPE_PRIM_QUADS, 4, (float *) verts, 2, attribs);
+ st_draw_vertices(ctx, PIPE_PRIM_QUADS, 4, (float *) verts, 2);
}
draw_quad_colored(GLcontext *ctx, GLfloat x0, GLfloat y0, GLfloat z,
GLfloat x1, GLfloat y1, const GLfloat *color)
{
- static const GLuint attribs[3] = {
- 0, /* pos */
- 1, /* color */
- 8 /* tex0 */
- };
GLfloat verts[4][3][4]; /* four verts, three attribs, XYZW */
GLuint i;
verts[i][2][3] = 1.0; /*Q*/
}
- st_draw_vertices(ctx, PIPE_PRIM_QUADS, 4, (float *) verts, 3, attribs);
+ st_draw_vertices(ctx, PIPE_PRIM_QUADS, 4, (float *) verts, 3);
}
void
st_draw_vertices(GLcontext *ctx, unsigned prim,
unsigned numVertex, float *verts,
- unsigned numAttribs, const unsigned attribs[])
+ unsigned numAttribs)
{
const float width = ctx->DrawBuffer->Width;
const float height = ctx->DrawBuffer->Height;
unsigned i;
assert(numAttribs > 0);
- assert(attribs[0] == 0); /* position */
/* convert to clip coords */
for (i = 0; i < numVertex; i++) {
velement.vertex_buffer_index = 0;
velement.src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
velement.dst_offset = 0;
- pipe->set_vertex_element(pipe, i/**attribs[i]**/, &velement);
+ pipe->set_vertex_element(pipe, i, &velement);
}
/* draw */
void
st_draw_vertices(GLcontext *ctx, unsigned prim,
unsigned numVertex, float *verts,
- unsigned numAttribs, const unsigned attribs[]);
+ unsigned numAttribs);
#endif