summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-10-27 11:40:20 -0700
committerEric Anholt <eric@anholt.net>2009-10-27 14:32:18 -0700
commite300dc963798c54d22da47daed4193c3f97ff9ef (patch)
treeeb6bcda9d089b23e02905fe87f43ab811cb343ea
parent6b7ebc1d6b9e80da25d4ec4bd2fc093dd91cb0dd (diff)
framework: Update the width/height and viewport on window resize.
Most tests won't handle resize appropriately, but we may want to sometimes on a specific test.
-rw-r--r--tests/util/piglit-framework.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/util/piglit-framework.c b/tests/util/piglit-framework.c
index 86185051b..c48dbe9eb 100644
--- a/tests/util/piglit-framework.c
+++ b/tests/util/piglit-framework.c
@@ -46,6 +46,14 @@ display(void)
piglit_report_result(result);
}
+static void
+reshape(int w, int h)
+{
+ piglit_width = w;
+ piglit_height = h;
+
+ glViewport(0, 0, w, h);
+}
int main(int argc, char *argv[])
{
@@ -67,6 +75,7 @@ int main(int argc, char *argv[])
glutInitDisplayMode(piglit_window_mode);
glutCreateWindow(argv[0]);
glutDisplayFunc(display);
+ glutReshapeFunc(reshape);
glutKeyboardFunc(piglit_escape_exit_key);
glewInit();