Browse Source

gpu: explicitly create render targets on the Xbox 360.

legacy
Sam Hocevar sam 12 years ago
parent
commit
50de813d99
2 changed files with 21 additions and 3 deletions
  1. +0
    -1
      build/vs2010/Lol.sln
  2. +21
    -2
      src/gpu/framebuffer.cpp

+ 0
- 1
build/vs2010/Lol.sln View File

@@ -470,7 +470,6 @@ Global
{7B083DA2-FE08-4F6D-BFDD-195D5C2783EB} = {E74CF679-CA2A-47E9-B1F4-3779D6AC6B04}
{1C5B8702-290C-42DA-AA9E-671348F5B747} = {E74CF679-CA2A-47E9-B1F4-3779D6AC6B04}
{6BF81B39-EDC2-4227-9992-C2D8ABEA95AF} = {E74CF679-CA2A-47E9-B1F4-3779D6AC6B04}
{BCEE0132-8E24-49BE-AFEB-96DAD14396BA} = {E74CF679-CA2A-47E9-B1F4-3779D6AC6B04}
{32F3F8CF-D22E-45E4-BEB8-AD909E8C5515} = {33704AA4-F2B5-4138-A40D-E3E77F89ED46}
{EE203B88-44CF-4859-9D42-7A5F40FECB52} = {8C77EAA8-1077-4EF7-AE53-97C6C60A3601}
{B357514A-7881-422D-8358-161B689E7620} = {3D341D8A-E400-4B1D-BC05-B5C35487D9B5}


+ 21
- 2
src/gpu/framebuffer.cpp View File

@@ -63,7 +63,7 @@ FrameBuffer::FrameBuffer(ivec2 size)
: m_data(new FrameBufferData)
{
m_data->m_size = size;
#if defined USE_D3D9 || defined _XBOX
#if defined USE_D3D9
if (FAILED(g_d3ddevice->CreateTexture(size.x, size.y, 1,
D3DUSAGE_RENDERTARGET,
D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT,
@@ -71,6 +71,16 @@ FrameBuffer::FrameBuffer(ivec2 size)
Abort();
if (FAILED(m_data->m_texture->GetSurfaceLevel(0, &m_data->m_surface)))
Abort();
#elif defined _XBOX
if (FAILED(g_d3ddevice->CreateTexture(size.x, size.y, 1, 0,
D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT,
&m_data->m_texture, NULL)))
Abort();
if (FAILED(g_d3ddevice->CreateRenderTarget(size.x, size.y,
D3DFMT_A8R8G8B8,
D3DMULTISAMPLE_NONE, 0, 0,
&m_data->m_surface, NULL)))
Abort();
#else
# if GL_VERSION_1_1
GLenum internal_format = GL_RGBA8;
@@ -180,9 +190,18 @@ void FrameBuffer::Bind()

void FrameBuffer::Unbind()
{
#if defined USE_D3D9 || defined _XBOX
#if defined USE_D3D9
if (FAILED(g_d3ddevice->SetRenderTarget(0, m_data->m_back_surface)))
Abort();
m_data->m_back_surface->Release();
#elif defined _XBOX
if (FAILED(g_d3ddevice->Resolve(D3DRESOLVE_RENDERTARGET0, NULL,
m_data->m_texture, NULL, 0, 0, NULL,
0, 0, NULL)))
Abort();
if (FAILED(g_d3ddevice->SetRenderTarget(0, m_data->m_back_surface)))
Abort();
m_data->m_back_surface->Release();
#else
# if GL_VERSION_1_1 || GL_ES_VERSION_2_0
glBindFramebuffer(GL_FRAMEBUFFER, NULL);


Loading…
Cancel
Save