Commit dce1e457 authored by Ian Romanick's avatar Ian Romanick

util: Add new piglit_ortho_projection helper function

parent 3fd47a10
......@@ -463,3 +463,25 @@ piglit_draw_rect(float x, float y, float w, float h)
glDisableClientState(GL_VERTEX_ARRAY);
}
/**
* Convenience function to configure projection matrix for window coordinates
*/
void
piglit_ortho_projection(int w, int h, GLboolean push)
{
/* Set up projection matrix so we can just draw using window
* coordinates.
*/
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (push)
glPushMatrix();
glOrtho(0, w, 0, h, -1, 1);
glMatrixMode(GL_MODELVIEW);
if (push)
glPushMatrix();
glLoadIdentity();
}
......@@ -73,6 +73,8 @@ void piglit_escape_exit_key(unsigned char key, int x, int y);
char *piglit_load_text_file(const char *file_name, unsigned *size);
void piglit_ortho_projection(int w, int h, GLboolean push);
extern GLfloat cube_face_texcoords[6][4][3];
extern const char *cube_face_names[6];
extern const GLenum cube_face_targets[6];
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