예제 #1
0
COGLRenderTexture::~COGLRenderTexture()
{
    if( m_beingRendered )
    {
        g_pFrameBufferManager->CloseRenderTexture(false);
        SetAsRenderTarget(false);
    }

    ShutdownPBuffer();
    SAFE_DELETE(m_pTexture);
    m_pOGLTexture = NULL;
    m_beingRendered = false;
}
예제 #2
0
// ===========================================================================
COGLRenderTexture::COGLRenderTexture(int width, int height, RenderTextureInfo* pInfo, TextureUsage usage)
    :   CRenderTexture(width, height, pInfo, usage),
#ifndef XENON
        m_pOGLTexture(NULL)
#else
        m_pxeTexture(NULL)
#endif
{
    if( usage == AS_BACK_BUFFER_SAVE )
    {
#ifndef XENON
        m_pTexture = m_pOGLTexture = new COGLTexture(width, height, usage);
#else
        m_pTexture = m_pxeTexture = new CxeTexture(width, height, usage);
#endif		
        if( !m_pTexture )
        {
            TRACE0("Error to create OGL render_texture");
            SAFE_DELETE(m_pTexture);
        }
    }

    m_width = width;
    m_height = height;
    m_beingRendered = false;
}

COGLRenderTexture::~COGLRenderTexture()
{
    if( m_beingRendered )
    {
        g_pFrameBufferManager->CloseRenderTexture(false);
        SetAsRenderTarget(false);
    }

    ShutdownPBuffer();
    SAFE_DELETE(m_pTexture);
#ifndef XENON
    m_pOGLTexture = NULL;
#else
    m_pxeTexture = NULL;
#endif
    m_beingRendered = false;
}

bool COGLRenderTexture::InitPBuffer( void )
{
    return true;
}

void COGLRenderTexture::ShutdownPBuffer(void)
{
}

bool COGLRenderTexture::SetAsRenderTarget(bool enable)
{
   return true;
}

void COGLRenderTexture::LoadTexture(TxtrCacheEntry* pEntry)
{
}

void COGLRenderTexture::StoreToRDRAM(int infoIdx)
{
}

#if 0//def __GX__
CGXRenderTexture::CGXRenderTexture(int width, int height, RenderTextureInfo* pInfo, TextureUsage usage)
: CRenderTexture(width, height, pInfo, usage)
{
//	m_pTexture = new CDirectXTexture(width, height, usage);
	m_pTexture = new COGLTexture(width, height, usage);
	if( m_pTexture )
	{
		m_width = width;
		m_height = height;
	}
	else
	{
		TRACE0("Error to create DX render_texture");
		SAFE_DELETE(m_pTexture);
	}

	m_pColorBufferSave = NULL;
	m_pDepthBufferSave = NULL;
	m_beingRendered = false;
}