当前位置: 首页>>代码示例>>C++>>正文


C++ ResourcePtr::unload方法代码示例

本文整理汇总了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());
    }
}
开发者ID:rbaravalle,项目名称:Pysys,代码行数:53,代码来源:ReloadMaterial.cpp

示例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));
}
开发者ID:Phosfor,项目名称:Pseudoform-2,代码行数:18,代码来源:ResourceManager.cpp


注:本文中的ogre::ResourcePtr::unload方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。