本文整理汇总了C++中CD3DTexture::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ CD3DTexture::Get方法的具体用法?C++ CD3DTexture::Get怎么用?C++ CD3DTexture::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CD3DTexture
的用法示例。
在下文中一共展示了CD3DTexture::Get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReallocTexture
CBaseTexture* CGUIFontTTFDX::ReallocTexture(unsigned int& newHeight)
{
assert(newHeight != 0);
assert(m_textureWidth != 0);
if(m_textureHeight == 0)
{
delete m_texture;
m_texture = NULL;
delete m_speedupTexture;
m_speedupTexture = NULL;
}
m_staticCache.Flush();
m_dynamicCache.Flush();
CDXTexture* pNewTexture = new CDXTexture(m_textureWidth, newHeight, XB_FMT_A8);
CD3DTexture* newSpeedupTexture = new CD3DTexture();
if (!newSpeedupTexture->Create(m_textureWidth, newHeight, 1, D3D11_USAGE_DEFAULT, DXGI_FORMAT_R8_UNORM))
{
SAFE_DELETE(newSpeedupTexture);
SAFE_DELETE(pNewTexture);
return NULL;
}
ID3D11DeviceContext* pContext = g_Windowing.GetImmediateContext();
// There might be data to copy from the previous texture
if (newSpeedupTexture && m_speedupTexture)
{
CD3D11_BOX rect(0, 0, 0, m_textureWidth, m_textureHeight, 1);
pContext->CopySubresourceRegion(newSpeedupTexture->Get(), 0, 0, 0, 0, m_speedupTexture->Get(), 0, &rect);
}
SAFE_DELETE(m_texture);
SAFE_DELETE(m_speedupTexture);
m_textureHeight = newHeight;
m_textureScaleY = 1.0f / m_textureHeight;
m_speedupTexture = newSpeedupTexture;
return pNewTexture;
}