本文整理汇总了C++中Texture::DecrementUsage方法的典型用法代码示例。如果您正苦于以下问题:C++ Texture::DecrementUsage方法的具体用法?C++ Texture::DecrementUsage怎么用?C++ Texture::DecrementUsage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Texture
的用法示例。
在下文中一共展示了Texture::DecrementUsage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
RenderShader::~RenderShader()
{
// reduce the ref counts of the textures this shader was using
for (uint32_t t=0;t<Texture::__SAMPLER_LAST__;t++)
{
if (m_textures[t]!=0xffffffff)
{
Texture* tex = m_sd->ResolveTexture(m_textures[t]);
tex->DecrementUsage();
m_textures[t] = 0xffffffff;
}
}
}
示例2: ReplaceTexture
void RenderShader::ReplaceTexture(uint32_t th, uint32_t slot)
{
if (m_textures[slot]!=0xffffffff)
{
Texture* current = m_sd->ResolveTexture(m_textures[slot]);
if (current->DecrementUsage()==0)
{
#pragma TODO("delete now?")
}
}
m_textures[slot] = th;
if (th!=0xffffffff)
{
Texture* ntex = m_sd->ResolveTexture(th);
ntex->IncrementUsage();
}
}