Пример #1
0
void Display::open(const Project& project)
{
    string plugin;

    try
    {
        plugin = get_parameters().get("plugin_name");
        // Add platform dependent extension.
#ifdef _WIN32
        plugin += ".dll";
#else
        plugin += ".so";
#endif

        plugin = project.search_paths().qualify(plugin);
    }
    catch (const ExceptionDictionaryItemNotFound&)
    {
        RENDERER_LOG_FATAL("%s", "cannot open display: bad parameters.");
        return;
    }

    try
    {
        impl = new Impl(plugin.c_str(), get_parameters());
    }
    catch (const ExceptionCannotLoadSharedLib& e)
    {
        RENDERER_LOG_FATAL("cannot open display: %s", e.what());
    }
    catch (const ExceptionSharedLibCannotGetSymbol& e)
    {
        RENDERER_LOG_FATAL("cannot open display: %s", e.what());
    }
}
Пример #2
0
void OIIOErrorHandler::operator()(int errcode, const std::string& msg)
{
    switch (errcode)
    {
      case EH_WARNING:
        RENDERER_LOG_WARNING("%s", msg.c_str());
        break;

      case EH_ERROR:
        RENDERER_LOG_ERROR("%s", msg.c_str());
        break;

      case EH_SEVERE:
        RENDERER_LOG_FATAL("%s", msg.c_str());
        break;

      case EH_DEBUG:
        RENDERER_LOG_DEBUG("%s", msg.c_str());
        break;

      default:
        RENDERER_LOG_INFO("%s", msg.c_str());
        break;
    }
}