In the subject, "copyteximage" not "copytemimage" :)

Fabian Bieler <[email protected]> writes:

> Don't mix piglit_draw_rect and additional attribute arrays.
> ---
>  tests/texturing/copyteximage.c | 45 
> ++++++++++++++++++++++++++----------------
>  1 file changed, 28 insertions(+), 17 deletions(-)
>
> diff --git a/tests/texturing/copyteximage.c b/tests/texturing/copyteximage.c
> index 432ebbc..8a5b534 100644
> --- a/tests/texturing/copyteximage.c
> +++ b/tests/texturing/copyteximage.c
> @@ -430,6 +430,26 @@ static GLboolean probe_rect(int x, int y, int w, int h,
>       return piglit_probe_rect_rgba(x, y, w, h, expected_scaled);
>  }
>  
> +/**
> + * Draw a rectangle with texture coordiantes and width and height IMAGE_SIZE.
> + *
> + * texCoordDim -- the number of components of the texture coordinates
> + * texCoords -- an array of floats with texture coordinate data
> + * x, y -- the lower left corner of the rectangle
> + */
> +static void
> +draw_rect_tex(GLint texCoordDim, const GLvoid *texCoords, GLint x, GLint y)
> +{
> +     const float s = IMAGE_SIZE;
> +     float verts[4][4] = { {x,   y,   0, 1},
> +                           {x+s, y,   0, 1},
> +                           {x+s, y+s, 0, 1},
> +                           {x,   y+s, 0, 1} };
> +
> +     glTexCoordPointer(texCoordDim, GL_FLOAT, 0, texCoords);
> +     glVertexPointer(4, GL_FLOAT, 0, verts);
> +     glDrawArrays(GL_QUADS, 0, 4);
> +}

Possible variant: the texCoordDim == 2 case could be done by
piglit_draw_rect_tex, making this just a local draw_rect_tex_3d
function.

Either way,

Reviewed-by: Eric Anholt <[email protected]>

Attachment: pgpa1wvNgRleX.pgp
Description: PGP signature

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to