本文整理汇总了C++中CTextureReference::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ CTextureReference::GetName方法的具体用法?C++ CTextureReference::GetName怎么用?C++ CTextureReference::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTextureReference
的用法示例。
在下文中一共展示了CTextureReference::GetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitSceneMaterials
void CMiniViewportEngineRenderArea::InitSceneMaterials()
{
if ( m_ScreenBuffer )
return;
if ( g_pMaterialSystem->IsTextureLoaded( "_rt_LayoffResult" ) )
{
ITexture *pTexture = g_pMaterialSystem->FindTexture( "_rt_LayoffResult", TEXTURE_GROUP_RENDER_TARGET );
m_ScreenBuffer.Init( pTexture );
}
else
{
// For now, layoff dimensions match aspect of back buffer
int nBackBufferWidth, nBackBufferHeight;
g_pMaterialSystem->GetBackBufferDimensions( nBackBufferWidth, nBackBufferHeight );
float flAspect = nBackBufferWidth / (float)nBackBufferHeight;
int nPreviewWidth = min( DEFAULT_PREVIEW_WIDTH, nBackBufferWidth );
int nPreviewHeight = ( int )( nPreviewWidth / flAspect + 0.5f );
g_pMaterialSystem->BeginRenderTargetAllocation(); // Begin allocating RTs which IFM can scribble into
// LDR final result of either HDR or LDR rendering
m_ScreenBuffer.Init( g_pMaterialSystem->CreateNamedRenderTargetTextureEx2(
"_rt_LayoffResult", nPreviewWidth, nPreviewHeight, RT_SIZE_OFFSCREEN,
g_pMaterialSystem->GetBackBufferFormat(), MATERIAL_RT_DEPTH_SHARED, TEXTUREFLAGS_BORDER ) );
g_pMaterialSystem->EndRenderTargetAllocation(); // End allocating RTs which IFM can scribble into
}
KeyValues *pVMTKeyValues = NULL;
pVMTKeyValues= new KeyValues( "UnlitGeneric" );
pVMTKeyValues->SetString( "$basetexture", m_ScreenBuffer->GetName() );
pVMTKeyValues->SetInt( "$nofog", 1 );
m_ScreenMaterial.Init( "MiniViewportEngineRenderAreaSceneMaterial", pVMTKeyValues );
m_ScreenMaterial->Refresh();
}