コード例 #1
0
////////////////////////////////////////////////////////////////
//
// CRenderItemManager::CreateRenderTarget
//
//
//
////////////////////////////////////////////////////////////////
CRenderTargetItem* CRenderItemManager::CreateRenderTarget ( uint uiSizeX, uint uiSizeY, bool bWithAlphaChannel, bool bForce )
{
    if ( !bForce && !CanCreateRenderItem ( CRenderTargetItem::GetClassId () ) )
        return NULL;

    CRenderTargetItem* pRenderTargetItem = new CRenderTargetItem ();
    pRenderTargetItem->PostConstruct ( this, uiSizeX, uiSizeY, bWithAlphaChannel );

    if ( !pRenderTargetItem->IsValid () )
    {
        SAFE_RELEASE ( pRenderTargetItem );
        return NULL;
    }

    UpdateMemoryUsage ();

    return pRenderTargetItem;
}
コード例 #2
0
////////////////////////////////////////////////////////////////
//
// CRenderItemManager::CreateRenderTarget
//
//
//
////////////////////////////////////////////////////////////////
CRenderTargetItem* CRenderItemManager::CreateRenderTarget ( uint uiSizeX, uint uiSizeY, bool bWithAlphaChannel, bool bForce )
{
    if ( !bForce && !CanCreateRenderItem ( CRenderTargetItem::GetClassId () ) )
        return NULL;

    // Include in memory stats only if render target is not for MTA internal use
    bool bIncludeInMemoryStats = (bForce == false);

    CRenderTargetItem* pRenderTargetItem = new CRenderTargetItem ();
    pRenderTargetItem->PostConstruct ( this, uiSizeX, uiSizeY, bWithAlphaChannel, bIncludeInMemoryStats );

    if ( !pRenderTargetItem->IsValid () )
    {
        SAFE_RELEASE ( pRenderTargetItem );
        return NULL;
    }

    UpdateMemoryUsage ();

    return pRenderTargetItem;
}