| 615 | |
| 616 | |
| 617 | int main(int argc, char **argv) |
| 618 | { |
| 619 | Display *dpy = NULL; |
| 620 | FrameTest *test[NUMWIN]; |
| 621 | int i, j, w, h; |
| 622 | char *fileName = NULL; |
| 623 | bool verbose = false; |
| 624 | |
| 625 | if(argc > 1) for(i = 1; i < argc; i++) |
| 626 | { |
| 627 | if(!stricmp(argv[i], "-h") || !strcmp(argv[i], "-?")) usage(argv); |
| 628 | else if(!stricmp(argv[i], "-gl")) |
| 629 | { |
| 630 | fprintf(stderr, "Using OpenGL for blitting ...\n"); |
| 631 | useGL = true; |
| 632 | } |
| 633 | else if(!stricmp(argv[i], "-logo")) addLogo = true; |
| 634 | else if(!stricmp(argv[i], "-anaglyph")) anaglyph = true; |
| 635 | #ifdef USEXV |
| 636 | else if(!stricmp(argv[i], "-xv")) |
| 637 | { |
| 638 | fprintf(stderr, "Using X Video ...\n"); |
| 639 | useXV = true; |
| 640 | } |
| 641 | #endif |
| 642 | else if(!stricmp(argv[i], "-rgb")) |
| 643 | { |
| 644 | fprintf(stderr, "Using RGB encoding ...\n"); |
| 645 | useRGB = true; |
| 646 | } |
| 647 | else if(!stricmp(argv[i], "-rgbbench") && i < argc - 1) |
| 648 | { |
| 649 | fileName = argv[++i]; doRgbBench = true; |
| 650 | } |
| 651 | else if(!stricmp(argv[i], "-v")) verbose = true; |
| 652 | else if(!stricmp(argv[i], "-check")) { check = true; useRGB = true; } |
| 653 | else usage(argv); |
| 654 | } |
| 655 | |
| 656 | try |
| 657 | { |
| 658 | if(doRgbBench) { rgbBench(fileName); exit(0); } |
| 659 | |
| 660 | ERRIFNOT(XInitThreads()); |
| 661 | if(!(dpy = XOpenDisplay(0))) |
| 662 | { |
| 663 | fprintf(stderr, "Could not open display %s\n", XDisplayName(0)); |
| 664 | exit(1); |
| 665 | } |
| 666 | |
| 667 | for(int format = 0; format < PIXELFORMATS - 1; format++) |
| 668 | { |
| 669 | PF *pf = pf_get(format); |
| 670 | |
| 671 | if((useXV || anaglyph || useGL) && pf->bpc != 8) continue; |
| 672 | if(DefaultDepth(dpy, DefaultScreen(dpy)) != 30 && pf->bpc == 10) |
| 673 | continue; |
| 674 |
nothing calls this directly
no test coverage detected