Ignore:
Timestamp:
Aug 20, 2012, 8:15:32 PM (8 years ago)
Author:
sam
Message:

gpu: explicitly create render targets on the Xbox 360.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gpu/framebuffer.cpp

    r1775 r1781  
    6464{
    6565    m_data->m_size = size;
    66 #if defined USE_D3D9 || defined _XBOX
     66#if defined USE_D3D9
    6767    if (FAILED(g_d3ddevice->CreateTexture(size.x, size.y, 1,
    6868                                          D3DUSAGE_RENDERTARGET,
     
    7171        Abort();
    7272    if (FAILED(m_data->m_texture->GetSurfaceLevel(0, &m_data->m_surface)))
     73        Abort();
     74#elif defined _XBOX
     75    if (FAILED(g_d3ddevice->CreateTexture(size.x, size.y, 1, 0,
     76                                          D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT,
     77                                          &m_data->m_texture, NULL)))
     78        Abort();
     79    if (FAILED(g_d3ddevice->CreateRenderTarget(size.x, size.y,
     80                                               D3DFMT_A8R8G8B8,
     81                                               D3DMULTISAMPLE_NONE, 0, 0,
     82                                               &m_data->m_surface, NULL)))
    7383        Abort();
    7484#else
     
    181191void FrameBuffer::Unbind()
    182192{
    183 #if defined USE_D3D9 || defined _XBOX
     193#if defined USE_D3D9
    184194    if (FAILED(g_d3ddevice->SetRenderTarget(0, m_data->m_back_surface)))
    185195        Abort();
     196    m_data->m_back_surface->Release();
     197#elif defined _XBOX
     198    if (FAILED(g_d3ddevice->Resolve(D3DRESOLVE_RENDERTARGET0, NULL,
     199                                    m_data->m_texture, NULL, 0, 0, NULL,
     200                                    0, 0, NULL)))
     201        Abort();
     202    if (FAILED(g_d3ddevice->SetRenderTarget(0, m_data->m_back_surface)))
     203        Abort();
     204    m_data->m_back_surface->Release();
    186205#else
    187206#   if GL_VERSION_1_1 || GL_ES_VERSION_2_0
Note: See TracChangeset for help on using the changeset viewer.