本文整理汇总了C++中CTextureMap::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ CTextureMap::Release方法的具体用法?C++ CTextureMap::Release怎么用?C++ CTextureMap::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTextureMap
的用法示例。
在下文中一共展示了CTextureMap::Release方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReleaseTexture
void CGUITextureManager::ReleaseTexture(const CStdString& strTextureName, int iPicture)
{
CSingleLock lock(g_graphicsContext);
#ifndef _LINUX
MEMORYSTATUS stat;
GlobalMemoryStatus(&stat);
DWORD dwMegFree = stat.dwAvailPhys / (1024 * 1024);
if (dwMegFree > 29)
{
// dont release skin textures, they are reloaded each time
//if (strTextureName.GetAt(1) != ':') return;
//CLog::Log(LOGINFO, "release:%s", strTextureName.c_str());
}
#endif
ivecTextures i;
i = m_vecTextures.begin();
while (i != m_vecTextures.end())
{
CTextureMap* pMap = *i;
if (pMap->GetName() == strTextureName)
{
pMap->Release(iPicture);
if (pMap->IsEmpty() )
{
//CLog::Log(LOGINFO, " cleanup:%s", strTextureName.c_str());
delete pMap;
i = m_vecTextures.erase(i);
}
return;
}
++i;
}
CLog::Log(LOGWARNING, "%s: Unable to release texture %s", __FUNCTION__, strTextureName.c_str());
}
示例2: ReleaseTexture
void CGUITextureManager::ReleaseTexture(const std::string& strTextureName, bool immediately /*= false */)
{
CSingleLock lock(g_graphicsContext);
ivecTextures i;
i = m_vecTextures.begin();
while (i != m_vecTextures.end())
{
CTextureMap* pMap = *i;
if (pMap->GetName() == strTextureName)
{
if (pMap->Release())
{
//CLog::Log(LOGINFO, " cleanup:%s", strTextureName.c_str());
// add to our textures to free
m_unusedTextures.push_back(std::make_pair(pMap, immediately ? 0 : XbmcThreads::SystemClockMillis()));
i = m_vecTextures.erase(i);
}
return;
}
++i;
}
CLog::Log(LOGWARNING, "%s: Unable to release texture %s", __FUNCTION__, strTextureName.c_str());
}
示例3: ReleaseTexture
void CGUITextureManager::ReleaseTexture(const CStdString& strTextureName)
{
CSingleLock lock(g_graphicsContext);
ivecTextures i;
i = m_vecTextures.begin();
while (i != m_vecTextures.end())
{
CTextureMap* pMap = *i;
if (pMap->GetName() == strTextureName)
{
if (pMap->Release())
{
//CLog::Log(LOGINFO, " cleanup:%s", strTextureName.c_str());
// add to our textures to free
m_unusedTextures.push_back(pMap);
i = m_vecTextures.erase(i);
}
return;
}
++i;
}
CLog::Log(LOGWARNING, "%s: Unable to release texture %s", __FUNCTION__, strTextureName.c_str());
}