Commit 18c673cb authored by Paul Berry's avatar Paul Berry

Add a "frustum" command to shader_runner.

Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
parent f1769a4e
......@@ -1009,6 +1009,10 @@ piglit_display(void)
do_enable_disable(line + 7, false);
} else if (string_match("enable", line)) {
do_enable_disable(line + 6, true);
} else if (string_match("frustum", line)) {
get_floats(line + 7, c, 6);
piglit_frustum_projection(false, c[0], c[1], c[2],
c[3], c[4], c[5]);
} else if (sscanf(line, "ortho %f %f %f %f",
c + 0, c + 1, c + 2, c + 3) == 4) {
piglit_gen_ortho_projection(c[0], c[1], c[2], c[3],
......
......@@ -763,6 +763,25 @@ piglit_ortho_projection(int w, int h, GLboolean push)
piglit_gen_ortho_projection(0, w, 0, h, -1, 1, push);
}
/**
* Convenience function to configure frustum projection.
*/
void
piglit_frustum_projection(GLboolean push, double l, double r, double b,
double t, double n, double f)
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (push)
glPushMatrix();
glFrustum(l, r, b, t, n, f);
glMatrixMode(GL_MODELVIEW);
if (push)
glPushMatrix();
glLoadIdentity();
}
/**
......
......@@ -182,6 +182,8 @@ void piglit_gen_ortho_projection(double left, double right, double bottom,
double top, double near_val, double far_val,
GLboolean push);
void piglit_ortho_projection(int w, int h, GLboolean push);
void piglit_frustum_projection(GLboolean push, double l, double r, double b,
double t, double n, double f);
GLuint piglit_checkerboard_texture(GLuint tex, unsigned level,
unsigned width, unsigned height,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment