本文整理汇总了C++中ogre::Root::saveConfig方法的典型用法代码示例。如果您正苦于以下问题:C++ Root::saveConfig方法的具体用法?C++ Root::saveConfig怎么用?C++ Root::saveConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Root
的用法示例。
在下文中一共展示了Root::saveConfig方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
#endif
{
int ret = 0;
Ogre::Log * log = NULL;
Ogre::Root * root = NULL;
GameManager* game = NULL;
Ogre::LogManager * logMgr = NULL;
bool configCreated = false;
std::string ogreLogPath, ogreCfgPath;
srand(time(NULL));
using namespace boost::filesystem;
// Creates the Lost Marbles directory to write to
path lostMarblesDir(utils::getLostMarblesWriteDir());
try {
if(! exists(lostMarblesDir))
create_directories(lostMarblesDir);
} catch(const filesystem_error& ex) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBoxA(NULL, ex.what(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
std::cerr << "An exception has occured: " << ex.what() << std::endl;
#endif
ret = 1;
goto gracefulexit;
}
ogreLogPath = (lostMarblesDir / "Ogre.log").string();
logMgr = new Ogre::LogManager();
log = logMgr->createLog(ogreLogPath, true, true, false);
ogreCfgPath = (lostMarblesDir / "Ogre.cfg").string();
root = new Ogre::Root("Plugins.cfg",ogreCfgPath);
log->logMessage("Main Lost Marbles write directory " + lostMarblesDir.string());
log->logMessage("Log Path: " + ogreLogPath);
log->logMessage("Config Path: " + ogreCfgPath);
if(!root->restoreConfig()) {
configCreated = root->showConfigDialog();
root->saveConfig();
} else
configCreated = true;
if(configCreated) {
game = new GameManager();
try {
// initialize the game and switch to the first state
game->start(LogoState::getInstance());
} catch (Ogre::Exception& e) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBoxA(NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
std::cerr << "An exception has occured: " << e.getFullDescription() << std::endl;
#endif
ret = 1;
goto gracefulexit;
}
}
gracefulexit:
if(game) delete game;
if(root) delete root;
if(logMgr) delete logMgr;
return ret;
}