Skip to content

Commit

Permalink
Fixed resetting the current render target if the D3D device is reset …
Browse files Browse the repository at this point in the history
…while using a non-default render target.
  • Loading branch information
slouken committed Feb 18, 2014
1 parent ccce6fb commit 6b33f2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/render/direct3d/SDL_render_d3d.c
Expand Up @@ -481,6 +481,10 @@ D3D_Reset(SDL_Renderer * renderer)
IDirect3DSurface9_Release(data->defaultRenderTarget);
data->defaultRenderTarget = NULL;
}
if (data->currentRenderTarget != NULL) {
IDirect3DSurface9_Release(data->currentRenderTarget);
data->currentRenderTarget = NULL;
}

/* Release application render targets */
for (texture = renderer->textures; texture; texture = texture->next) {
Expand Down Expand Up @@ -508,6 +512,7 @@ D3D_Reset(SDL_Renderer * renderer)

IDirect3DDevice9_GetRenderTarget(data->device, 0, &data->defaultRenderTarget);
D3D_InitRenderState(data);
D3D_SetRenderTarget(renderer, renderer->target);
D3D_UpdateViewport(renderer);

/* Let the application know that render targets were reset */
Expand Down

0 comments on commit 6b33f2e

Please sign in to comment.