本文整理汇总了C++中ogre::ResourcePtr::reload方法的典型用法代码示例。如果您正苦于以下问题:C++ ResourcePtr::reload方法的具体用法?C++ ResourcePtr::reload怎么用?C++ ResourcePtr::reload使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::ResourcePtr
的用法示例。
在下文中一共展示了ResourcePtr::reload方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reloadShaders
bool reloadShaders(std_srvs::Empty::Request&, std_srvs::Empty::Response&)
{
ROS_INFO("Reloading materials.");
{
Ogre::ResourceManager::ResourceMapIterator it = Ogre::MaterialManager::getSingleton().getResourceIterator();
while (it.hasMoreElements())
{
Ogre::ResourcePtr resource = it.getNext();
resource->reload();
}
}
ROS_INFO("Reloading high-level gpu shaders.");
{
Ogre::ResourceManager::ResourceMapIterator it = Ogre::HighLevelGpuProgramManager::getSingleton().getResourceIterator();
while (it.hasMoreElements())
{
Ogre::ResourcePtr resource = it.getNext();
resource->reload();
}
}
ROS_INFO("Reloading gpu shaders.");
{
Ogre::ResourceManager::ResourceMapIterator it = Ogre::GpuProgramManager::getSingleton().getResourceIterator();
while (it.hasMoreElements())
{
Ogre::ResourcePtr resource = it.getNext();
resource->reload();
}
}
return true;
}
示例2: runCommand
void GUIManager::runCommand(const std::string &command, const std::string &args)
{
if (command == ToggleInputMode.getCommand()) {
getInput().toggleInputMode();
} else if (command == ToggleGui.getCommand()) {
S_LOG_VERBOSE("Toggle Gui Initiated -- " << getInput().getInputMode());
if (mEnabled) {
S_LOG_INFO("Disabling GUI");
mEnabled = false;
getInput().removeAdapter(mCEGUIAdapter);
} else {
S_LOG_INFO("Enabling GUI");
mEnabled = true;
getInput().addAdapter(mCEGUIAdapter);
}
} else if (command == ReloadGui.getCommand()) {
Ogre::TextureManager* texMgr = Ogre::TextureManager::getSingletonPtr();
Ogre::ResourcePtr resource = texMgr->getByName("cegui/" + getDefaultScheme() + ".png");
if (!resource.isNull()) {
resource->reload();
}
}
}
示例3: reloadResource
void ResourceManager::reloadResource(Ogre::ResourceManager* resMgr, const std::string& resourceName, const std::string& resourceGroup)
{
Ogre::ResourcePtr rPtr = resMgr->load(resourceName, resourceGroup);
if (rPtr.isNull()) LOG_META(FORMAT("The resource '%1%' no longer exists!", resourceName));
rPtr->reload();
if (rPtr->isLoaded())
LOG_META(FORMAT("The resource '%1%' wasn`t unloaded!", resourceName));
else
LOG_META(FORMAT("The resource '%1%' was unloaded!", resourceName));
}
示例4: LoadResource
void LoadResource(Ogre::ResourceManager* resMgr, const std::string& resourceName, const std::string& resourceGroup)
{
Ogre::ResourcePtr rPtr = resMgr->load(resourceName, resourceGroup);
if (rPtr.isNull())
{
StringUtil::StrStreamType msg;
msg << "Resource no longer exists: " << resourceName;
Ogre::LogManager::getSingleton().logMessage(msg.str());
return;
}
rPtr->reload();
if (rPtr->isLoaded())
{
StringUtil::StrStreamType msg;
msg << "Resource was reloaded: " << resourceName;
Ogre::LogManager::getSingleton().logMessage(msg.str());
}
else
{
StringUtil::StrStreamType msg;
msg << "Resource was not reloaded: " << 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());
}
}