Fixed bug 2640 - Unable to SDL_SetRenderTarget to original surface for software renderer without a window
authorSam Lantinga <slouken@libsdl.org>
Sun, 13 Jul 2014 09:04:55 -0700
changeset 9008f061a86fbb08
parent 9007 515be38f3f37
child 9009 ddbca09f8f9d
child 9487 f9fbc2d1edb0
Fixed bug 2640 - Unable to SDL_SetRenderTarget to original surface for software renderer without a window

Damian Kaczmarek

Basically this bug is probably not a common use case. My goal is to allow rendering totally without a window, for example to a screenshot and I need to rely on SDL_SetRenderTarget to properly work for a purely software renderer created by SDL_CreateSoftwareRenderer.
src/render/software/SDL_render_sw.c
     1.1 --- a/src/render/software/SDL_render_sw.c	Sat Jul 12 16:21:56 2014 -0700
     1.2 +++ b/src/render/software/SDL_render_sw.c	Sun Jul 13 09:04:55 2014 -0700
     1.3 @@ -146,6 +146,7 @@
     1.4          return NULL;
     1.5      }
     1.6      data->surface = surface;
     1.7 +    data->window = surface;
     1.8  
     1.9      renderer->WindowEvent = SW_WindowEvent;
    1.10      renderer->GetOutputSize = SW_GetOutputSize;