Пример #1
0
/**
 * Test that we can emit a whole load of samples as long as the indirection
 * count is low.
 */
GLboolean test_temporary_source_indirections(void)
{
    GLboolean pass = GL_TRUE;
    GLuint progname;
    char *prog;
    GLint indirections_limit, use_limit;
    GLint count;

    indirections_limit = get_program_i(GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB);

    use_limit = MIN2(indirections_limit, 1024);

    count = use_limit - 1;
    printf("testing program with %d indirections from temporary sources\n",
           count);
    prog = gen_temporary_source_indirections(count, &progname);
    if (prog != NULL) {
        if (!get_program_i(GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB)) {
            printf("Program with %d indirections unexpectedly "
                   "exceeded native limits.\n", count);
            print_program_info(prog);
            pass = GL_FALSE;
        }
        free(prog);
    }

    count = use_limit + 1;
    printf("testing program with %d indirections from temporary sources\n",
           count);
    prog = gen_temporary_source_indirections(count, &progname);
    if (prog != NULL && count > indirections_limit) {
        if (get_program_i(GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB)) {
            printf("Program with %d indirections unexpectedly "
                   "met native limits.\n", count);
            print_program_info(prog);
        }
        free(prog);
    }

    return pass;
}
Пример #2
0
/* Parse any command-line arguments passed in. */
static void parse_command_line(int argc, char *argv[]) {
    int i;

    if(argc < 2) {
        print_help(argv[0]);
        exit(EXIT_FAILURE);
    }

    for(i = 1; i < argc - 1; ++i) {
        if(!strcmp(argv[i], "--version")) {
            print_program_info();
            exit(EXIT_SUCCESS);
        }
        else if(!strcmp(argv[i], "--help")) {
            print_help(argv[0]);
            exit(EXIT_SUCCESS);
        }
        else if(!strcmp(argv[i], "--dc")) {
            version = CLIENT_VERSION_DC;
        }
        else if(!strcmp(argv[i], "--pc")) {
            version = CLIENT_VERSION_PC;
        }
        else if(!strcmp(argv[i], "--gc")) {
            version = CLIENT_VERSION_GC;
        }
        else if(!strcmp(argv[i], "--bb")) {
            version = CLIENT_VERSION_BB;
        }
        else if(!strcmp(argv[i], "--ep1")) {
            episode = 1;
        }
        else if(!strcmp(argv[i], "--ep2")) {
            episode = 2;
        }
        else if(!strcmp(argv[i], "--uncompressed")) {
            compressed = 0;
        }
        else {
            printf("Illegal command line argument: %s\n", argv[i]);
            print_help(argv[0]);
            exit(EXIT_FAILURE);
        }
    }

    /* Save the file we'll be working with. */
    filename = argv[argc - 1];
}