From: Ian Romanick <[email protected]> This is just like piglit_draw_rect, but it always uses generic attribute arrays.
This will be used in future commits. Signed-off-by: Ian Romanick <[email protected]> Cc: Matt Turner <[email protected]> Cc: Paul Berry <[email protected]> --- tests/util/piglit-util-gl-common.c | 28 ++++++++++++++++++++++++++++ tests/util/piglit-util-gl-common.h | 1 + 2 files changed, 29 insertions(+) diff --git a/tests/util/piglit-util-gl-common.c b/tests/util/piglit-util-gl-common.c index c097d8f..d95eeac 100644 --- a/tests/util/piglit-util-gl-common.c +++ b/tests/util/piglit-util-gl-common.c @@ -695,6 +695,34 @@ piglit_draw_rect(float x, float y, float w, float h) /** * Convenience function to draw an axis-aligned rectangle. */ +void +piglit_draw_rect_shader(float x, float y, float w, float h) +{ + float verts[4][4]; + + verts[0][0] = x; + verts[0][1] = y; + verts[0][2] = 0.0; + verts[0][3] = 1.0; + verts[1][0] = x + w; + verts[1][1] = y; + verts[1][2] = 0.0; + verts[1][3] = 1.0; + verts[2][0] = x; + verts[2][1] = y + h; + verts[2][2] = 0.0; + verts[2][3] = 1.0; + verts[3][0] = x + w; + verts[3][1] = y + h; + verts[3][2] = 0.0; + verts[3][3] = 1.0; + + piglit_draw_rect_from_arrays(verts, NULL, false); +} + +/** + * Convenience function to draw an axis-aligned rectangle. + */ GLvoid piglit_draw_rect_z(float z, float x, float y, float w, float h) { diff --git a/tests/util/piglit-util-gl-common.h b/tests/util/piglit-util-gl-common.h index 44e46ac..6056869 100644 --- a/tests/util/piglit-util-gl-common.h +++ b/tests/util/piglit-util-gl-common.h @@ -158,6 +158,7 @@ GLvoid piglit_draw_triangle(float x1, float y1, float x2, float y2, GLvoid piglit_draw_triangle_z(float z, float x1, float y1, float x2, float y2, float x3, float y3); GLvoid piglit_draw_rect(float x, float y, float w, float h); +void piglit_draw_rect_shader(float x, float y, float w, float h); GLvoid piglit_draw_rect_z(float z, float x, float y, float w, float h); GLvoid piglit_draw_rect_tex(float x, float y, float w, float h, float tx, float ty, float tw, float th); -- 1.8.1.4 _______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
