X-Git-Url: https://eleni.mutantstargoat.com/git/?p=test_compression;a=blobdiff_plain;f=main.c;fp=main.c;h=dc9ca52778d2f62745ae47f4c43e3b028ad698ee;hp=0ab34fe0fdde81be4148fba488b594124c63cc3c;hb=a76e52b12bf54efdeb95b7f6d8ecfdcec0ab81ae;hpb=8b77fcd0d7cef742f3df5f0c979d45a93def43cd 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;