From a76e52b12bf54efdeb95b7f6d8ecfdcec0ab81ae Mon Sep 17 00:00:00 2001 From: Eleni Maria Stea Date: Wed, 17 Oct 2018 18:30:12 +0300 Subject: [PATCH] added parameter -copytest-loop this is to run the copytest but with multiple drawings (it calls glutPostRedisplay). I use it to check the CopyImageSubData on Intel gen < 8 --- main.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 0ab34fe..dc9ca52 100644 --- a/main.c +++ b/main.c @@ -20,6 +20,7 @@ int texcomp(unsigned char *compix, unsigned int tofmt, unsigned char *pixels, void disp(void); void reshape(int x, int y); void keyb(unsigned char key, int x, int y); +void idle(); void gen_image(unsigned char *pixels, int xsz, int ysz); unsigned char *load_compressed_image(const char *fname, int *cszptr, int *xszptr, int *yszptr); int dump_compressed_image(const char *fname, unsigned char *data, int size, int w, int h); @@ -27,7 +28,7 @@ void print_compressed_formats(void); unsigned int tex, tex2, comp_tex; const char *texfile; -int subtest, copytest; +int subtest, copytest, loop; int main(int argc, char **argv) { @@ -43,6 +44,9 @@ int main(int argc, char **argv) subtest = 1; } else if(strcmp(argv[i], "-copytest") == 0) { copytest = 1; + } else if(strcmp(argv[i], "-copytest-loop") == 0) { + copytest = 1; + loop = 1; } else { fprintf(stderr, "invalid option: %s\n", argv[i]); return 1; @@ -65,6 +69,9 @@ int main(int argc, char **argv) glutReshapeFunc(reshape); glutKeyboardFunc(keyb); + if (loop) + glutIdleFunc(idle); + glewInit(); if(init() == -1) { @@ -232,6 +239,11 @@ void keyb(unsigned char key, int x, int y) } } +void idle() +{ + glutPostRedisplay(); +} + void gen_image(unsigned char *pixels, int xsz, int ysz) { int i, j; -- 1.7.10.4