src/render/direct3d/SDL_render_d3d.c
changeset 9085 7cafa57c23ec
parent 9074 86a6f6d92960
child 9619 b94b6d0bff0f
     1.1 --- a/src/render/direct3d/SDL_render_d3d.c	Sun Aug 17 14:34:41 2014 -0700
     1.2 +++ b/src/render/direct3d/SDL_render_d3d.c	Sun Aug 17 14:44:53 2014 -0700
     1.3 @@ -1831,9 +1831,10 @@
     1.4      D3DLOCKED_RECT locked;
     1.5      HRESULT result;
     1.6  
     1.7 -    result = IDirect3DDevice9_GetBackBuffer(data->device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &backBuffer);
     1.8 -    if (FAILED(result)) {
     1.9 -        return D3D_SetError("GetBackBuffer()", result);
    1.10 +    if (data->currentRenderTarget) {
    1.11 +        backBuffer = data->currentRenderTarget;
    1.12 +    } else {
    1.13 +        backBuffer = data->defaultRenderTarget;
    1.14      }
    1.15  
    1.16      result = IDirect3DSurface9_GetDesc(backBuffer, &desc);
    1.17 @@ -1874,7 +1875,6 @@
    1.18      IDirect3DSurface9_UnlockRect(surface);
    1.19  
    1.20      IDirect3DSurface9_Release(surface);
    1.21 -    IDirect3DSurface9_Release(backBuffer);
    1.22  
    1.23      return 0;
    1.24  }