示例#1
0
//----------------------------------------------------------------------------------------------------------------------
// voglbench_init
//----------------------------------------------------------------------------------------------------------------------
static bool voglbench_init(int argc, char *argv[])
{
    VOGL_FUNC_TRACER

    colorized_console::init();
    colorized_console::set_exception_callback();
    //console::set_tool_prefix("(voglbench) ");

    tool_print_title();

    if (!init_command_line_params(argc, argv))
        return false;

#ifdef USE_TELEMETRY
    int telemetry_level = g_command_line_params().get_value_as_int("telemetry_level", 0,
                                                                 TELEMETRY_LEVEL_MIN + 1, TELEMETRY_LEVEL_MIN, TELEMETRY_LEVEL_MAX);
    telemetry_set_level(telemetry_level);
    telemetry_tick();
#endif

    vogl_common_lib_early_init();
    vogl_common_lib_global_init();

    if (g_command_line_params().get_value_as_bool("quiet"))
        console::set_output_level(cMsgError);
    else if (g_command_line_params().get_value_as_bool("debug"))
        console::set_output_level(cMsgDebug);
    else if (g_command_line_params().get_value_as_bool("verbose"))
        console::set_output_level(cMsgVerbose);

    if (g_command_line_params().get_value_as_bool("gl_debug_log"))
    {
        vogl_set_direct_gl_func_prolog(vogl_direct_gl_func_prolog, NULL);
        vogl_set_direct_gl_func_epilog(vogl_direct_gl_func_epilog, NULL);
    }

    #if VOGL_PLATFORM_HAS_SDL
        if (SDL_Init(SDL_INIT_VIDEO) < 0) 
            return false;
    #endif

    if (!load_gl())
        return false;

    bool wrap_all_gl_calls = false;
    vogl_init_actual_gl_entrypoints(vogl_get_proc_address_helper, wrap_all_gl_calls);
    return true;
}
示例#2
0
//----------------------------------------------------------------------------------------------------------------------
// voglsyms_init
//----------------------------------------------------------------------------------------------------------------------
static bool voglsyms_init(int argc, char *argv[])
{
    VOGL_FUNC_TRACER

    console::disable_prefixes();

    colorized_console::init();
    colorized_console::set_exception_callback();
    //console::set_tool_prefix("(voglsyms) ");

    tool_print_title();

    if (!init_command_line_params(argc, argv))
        return false;

    if (g_command_line_params().get_value_as_bool("quiet"))
        console::disable_output();

    return true;
}