materialsystem/cmaterialsystem.cpp
ITexture *CMaterialSystem::CreateNamedRenderTargetTextureEx2(
	const char *pRTName, 
	int w, 
	int h, 
	RenderTargetSizeMode_t sizeMode,	// Controls how size is generated (and regenerated on video mode change).
	ImageFormat format, 
	MaterialRenderTargetDepth_t depth,
	unsigned int textureFlags, 
	unsigned int renderTargetFlags )
{
	// Only proceed if we are between BeginRenderTargetAllocation and EndRenderTargetAllocation
	if ( !m_nAllocatingRenderTargets )
	{
		Warning( "Tried to create render target outside of CMaterialSystem::BeginRenderTargetAllocation/EndRenderTargetAllocation block\n" );
		return NULL;
	}

	ITexture* pTexture = CreateNamedRenderTargetTextureEx( pRTName, w, h, sizeMode, format, depth, textureFlags, renderTargetFlags );

	pTexture->DecrementReferenceCount(); // Follow the same convention as CTextureManager::LoadTexture (return refcount of 0).
	return pTexture;
}
//-----------------------------------------------------------------------------------------------------
// New version which must be called inside BeginRenderTargetAllocation-EndRenderTargetAllocation block
//-----------------------------------------------------------------------------------------------------
New version which must be called inside BeginRenderTargetAllocation-EndRenderTargetAllocation block
New version which must be called inside BeginRenderTargetAllocation - EndRenderTargetAllocation block
ITexture *CMaterialSystem::CreateNamedRenderTargetTextureEx2(
	const char *pRTName, 
	int w, 
	int h, 
	RenderTargetSizeMode_t sizeMode,	
	ImageFormat format, 
	MaterialRenderTargetDepth_t depth,
	unsigned int textureFlags, 
	unsigned int renderTargetFlags )
{
	if ( !m_nAllocatingRenderTargets )
	{
		Warning( "Tried to create render target outside of CMaterialSystem::BeginRenderTargetAllocation/EndRenderTargetAllocation block\n" );
		return NULL;
	}
	ITexture* pTexture = CreateNamedRenderTargetTextureEx( pRTName, w, h, sizeMode, format, depth, textureFlags, renderTargetFlags );
	pTexture->DecrementReferenceCount(); 
	return pTexture;
}
ITexture * CMaterialSystem :: CreateNamedRenderTargetTextureEx2 ( const char * pRTName , int w , int h , RenderTargetSizeMode_t sizeMode , ImageFormat format , MaterialRenderTargetDepth_t depth , unsigned int textureFlags , unsigned int renderTargetFlags ) { if ( ! m_nAllocatingRenderTargets ) { Warning ( " \n " ) ; return NULL ; } ITexture * pTexture = CreateNamedRenderTargetTextureEx ( pRTName , w , h , sizeMode , format , depth , textureFlags , renderTargetFlags ) ; pTexture -> DecrementReferenceCount ( ) ; return pTexture ; }
New version which must be called inside BeginRenderTargetAllocation-EndRenderTargetAllocation block
New version which must be called inside BeginRenderTargetAllocation - EndRenderTargetAllocation block
// Controls how size is generated (and regenerated on video mode change). // Only proceed if we are between BeginRenderTargetAllocation and EndRenderTargetAllocation // Follow the same convention as CTextureManager::LoadTexture (return refcount of 0).