本文整理汇总了C++中ogre::Root::uninstallPlugin方法的典型用法代码示例。如果您正苦于以下问题:C++ Root::uninstallPlugin方法的具体用法?C++ Root::uninstallPlugin怎么用?C++ Root::uninstallPlugin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Root
的用法示例。
在下文中一共展示了Root::uninstallPlugin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mainSetupAndRunOgre
//.........这里部分代码省略.........
HWND hwnd;
window->getCustomAttribute("WINDOW", &hwnd);
HINSTANCE hInst = (HINSTANCE)GetModuleHandle(NULL);
SetClassLong (hwnd, GCL_HICON,
(LONG)LoadIcon (hInst, MAKEINTRESOURCE (IDI_ICON1)));
# endif
#endif
SceneManager* scene_manager = root->createSceneManager("OctreeSceneManager", "SceneMgr");
Camera* camera = scene_manager->createCamera("Camera");
camera->setPosition(Vector3(0, 0, 500)); // Position it at 500 in Z direction
camera->lookAt(Vector3(0, 0, -300)); // Look back along -Z
camera->setNearClipDistance(5);
Viewport* viewport = window->addViewport(camera);
viewport->setBackgroundColour(ColourValue(0, 0, 0));
//EntityRenderer entity_renderer(scene_manager);
parse::init();
HumanClientApp app(root, window, scene_manager, camera, viewport, (GetRootDataDir() / "OISInput.cfg").string());
#ifdef FREEORION_MACOSX
ois_input_plugin = new OISInput;
root->installPlugin(ois_input_plugin);
#elif defined(OGRE_STATIC_LIB)
ois_input_plugin = new OISInput;
root->installPlugin(ois_input_plugin);
#else
root->loadPlugin(OGRE_INPUT_PLUGIN_NAME);
#endif
if (GetOptionsDB().Get<bool>("quickstart")) {
// immediately start the server, establish network connections, and
// go into a single player game, using default universe options (a
// standard quickstart, without requiring the user to click the
// quickstart button).
app.NewSinglePlayerGame(true); // acceptable to call before app()
}
std::string load_filename = GetOptionsDB().Get<std::string>("load");
if (load_filename != "") {
// immediately start the server, establish network connections, and
// go into a single player game, loading the indicated file
// (without requiring the user to click the load button).
app.LoadSinglePlayerGame(load_filename); // acceptable to call before app()
}
// run rendering loop
app(); // calls GUI::operator() which calls OgreGUI::Run() which starts rendering loop
} catch (const HumanClientApp::CleanQuit&) {
// do nothing
std::cout << "mainSetupAndRunOgre caught CleanQuit" << std::endl;
} catch (const std::invalid_argument& e) {
Logger().errorStream() << "main() caught exception(std::invalid_argument): " << e.what();
std::cerr << "main() caught exception(std::invalid_arg): " << e.what() << std::endl;
} catch (const std::runtime_error& e) {
Logger().errorStream() << "main() caught exception(std::runtime_error): " << e.what();
std::cerr << "main() caught exception(std::runtime_error): " << e.what() << std::endl;
} catch (const boost::io::format_error& e) {
Logger().errorStream() << "main() caught exception(boost::io::format_error): " << e.what();
std::cerr << "main() caught exception(boost::io::format_error): " << e.what() << std::endl;
} catch (const GG::ExceptionBase& e) {
Logger().errorStream() << "main() caught exception(" << e.type() << "): " << e.what();
std::cerr << "main() caught exception(" << e.type() << "): " << e.what() << std::endl;
} catch (const std::exception& e) {
Logger().errorStream() << "main() caught exception(std::exception): " << e.what();
std::cerr << "main() caught exception(std::exception): " << e.what() << std::endl;
} catch (...) {
Logger().errorStream() << "main() caught unknown exception.";
std::cerr << "main() caught unknown exception." << std::endl;
}
if (root) {
#ifdef FREEORION_MACOSX
root->uninstallPlugin(ois_input_plugin);
delete ois_input_plugin;
#elif defined(OGRE_STATIC_LIB)
root->uninstallPlugin(ois_input_plugin);
root->uninstallPlugin(octree_plugin);
root->uninstallPlugin(particle_fx_plugin);
root->uninstallPlugin(gl_plugin);
delete ois_input_plugin;
delete octree_plugin;
delete particle_fx_plugin;
delete gl_plugin;
#else
root->unloadPlugin(OGRE_INPUT_PLUGIN_NAME);
#endif
delete root;
}
if (log_manager)
delete log_manager;
return 0;
}
示例2: mainSetupAndRunOgre
//.........这里部分代码省略.........
RenderWindow* window = root->createRenderWindow("FreeOrion " + FreeOrionVersionString(),
width, height, fullscreen, &misc_window_params);
#ifdef FREEORION_WIN32
# ifdef IDI_ICON1
// set window icon to embedded application icon
HWND hwnd;
window->getCustomAttribute("WINDOW", &hwnd);
HINSTANCE hInst = (HINSTANCE)GetModuleHandle(NULL);
SetClassLong (hwnd, GCL_HICON,
(LONG)LoadIcon (hInst, MAKEINTRESOURCE (IDI_ICON1)));
# endif
#endif
SceneManager* scene_manager = root->createSceneManager("OctreeSceneManager", "SceneMgr");
Camera* camera = scene_manager->createCamera("Camera");
camera->setPosition(Vector3(0, 0, 500)); // Position it at 500 in Z direction
camera->lookAt(Vector3(0, 0, -300)); // Look back along -Z
camera->setNearClipDistance(5);
Viewport* viewport = window->addViewport(camera);
viewport->setBackgroundColour(ColourValue(0, 0, 0));
//EntityRenderer entity_renderer(scene_manager);
parse::init();
HumanClientApp app(root, window, scene_manager, camera, viewport, GetRootDataDir() / "OISInput.cfg");
ois_input_plugin = new OISInput;
ois_input_plugin->SetRenderWindow(window);
root->installPlugin(ois_input_plugin);
if (GetOptionsDB().Get<bool>("quickstart")) {
// immediately start the server, establish network connections, and
// go into a single player game, using default universe options (a
// standard quickstart, without requiring the user to click the
// quickstart button).
app.NewSinglePlayerGame(true); // acceptable to call before app()
}
std::string load_filename = GetOptionsDB().Get<std::string>("load");
if (!load_filename.empty()) {
// immediately start the server, establish network connections, and
// go into a single player game, loading the indicated file
// (without requiring the user to click the load button).
app.LoadSinglePlayerGame(load_filename); // acceptable to call before app()
}
// run rendering loop
app(); // calls GUI::operator() which calls OgreGUI::Run() which starts rendering loop
} catch (const HumanClientApp::CleanQuit&) {
// do nothing
std::cout << "mainSetupAndRunOgre caught CleanQuit" << std::endl;
} catch (const std::invalid_argument& e) {
Logger().errorStream() << "main() caught exception(std::invalid_argument): " << e.what();
std::cerr << "main() caught exception(std::invalid_arg): " << e.what() << std::endl;
} catch (const std::runtime_error& e) {
Logger().errorStream() << "main() caught exception(std::runtime_error): " << e.what();
std::cerr << "main() caught exception(std::runtime_error): " << e.what() << std::endl;
} catch (const boost::io::format_error& e) {
Logger().errorStream() << "main() caught exception(boost::io::format_error): " << e.what();
std::cerr << "main() caught exception(boost::io::format_error): " << e.what() << std::endl;
} catch (const GG::ExceptionBase& e) {
Logger().errorStream() << "main() caught exception(" << e.type() << "): " << e.what();
std::cerr << "main() caught exception(" << e.type() << "): " << e.what() << std::endl;
} catch (const std::exception& e) {
Logger().errorStream() << "main() caught exception(std::exception): " << e.what();
std::cerr << "main() caught exception(std::exception): " << e.what() << std::endl;
} catch (...) {
Logger().errorStream() << "main() caught unknown exception.";
std::cerr << "main() caught unknown exception." << std::endl;
}
if (root) {
root->uninstallPlugin(ois_input_plugin);
delete ois_input_plugin;
#ifdef OGRE_STATIC_LIB
root->uninstallPlugin(octree_plugin);
root->uninstallPlugin(particle_fx_plugin);
root->uninstallPlugin(gl_plugin);
delete octree_plugin;
delete particle_fx_plugin;
delete gl_plugin;
#endif
delete root;
}
if (log_manager)
delete log_manager;
return 0;
}