本文整理汇总了C++中ogre::ResourcePtr::unload方法的典型用法代码示例。如果您正苦于以下问题:C++ ResourcePtr::unload方法的具体用法?C++ ResourcePtr::unload怎么用?C++ ResourcePtr::unload使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::ResourcePtr
的用法示例。
在下文中一共展示了ResourcePtr::unload方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UnloadResource
void UnloadResource(Ogre::ResourceManager* resMgr, const std::string& resourceName)
{
Ogre::ResourcePtr rPtr = resMgr->getResourceByName(resourceName);
if (rPtr.isNull())
{
StringUtil::StrStreamType msg;
msg << "Resource no longer exists: " << resourceName;
Ogre::LogManager::getSingleton().logMessage(msg.str());
return;
}
rPtr->unload();
if (rPtr->isLoaded())
{
StringUtil::StrStreamType msg;
msg << "Resource was not unloaded: " << resourceName;
Ogre::LogManager::getSingleton().logMessage(msg.str());
}
else
{
StringUtil::StrStreamType msg;
msg << "Resource was unloaded: " << resourceName;
Ogre::LogManager::getSingleton().logMessage(msg.str());
}
resMgr->remove(resourceName);
rPtr = resMgr->getResourceByName(resourceName);
if (rPtr.isNull())
{
StringUtil::StrStreamType msg;
msg << "Resource was removed: " << resourceName;
Ogre::LogManager::getSingleton().logMessage(msg.str());
}
else
{
StringUtil::StrStreamType msg;
msg << "Resource was not removed: " << resourceName;
Ogre::LogManager::getSingleton().logMessage(msg.str());
}
if (resMgr->resourceExists(resourceName))
{
StringUtil::StrStreamType msg;
msg << "Resource still exists: " << resourceName;
Ogre::LogManager::getSingleton().logMessage(msg.str());
}
else
{
StringUtil::StrStreamType msg;
msg << "Resource no longer exists: " << resourceName;
Ogre::LogManager::getSingleton().logMessage(msg.str());
}
}
示例2: unloadResource
void ResourceManager::unloadResource(Ogre::ResourceManager* resMgr, const std::string& resourceName)
{
Ogre::ResourcePtr rPtr = resMgr->getByName(resourceName);
if (rPtr.isNull()) return
rPtr->unload();
if (rPtr->isLoaded())
LOG_META(FORMAT("The resource '%1%' wasn`t unloaded!", resourceName));
else
LOG_META(FORMAT("The resource '%1%' was unloaded!", resourceName));
resMgr->remove(resourceName);
rPtr = resMgr->getByName(resourceName);
if (!rPtr.isNull())
LOG_META(FORMAT("The resource '%1%' wasn`t removed!", resourceName));
else
LOG_META(FORMAT("The resource '%1%' was removed!", resourceName));
}