mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 14:25:34 +00:00
Fixed bug #2962 - when SDL_RenderReadPixels format = 0, used format of the target texture
include/SDL_render.h, format: "0 to use the format of the rendering target "
This commit is contained in:
parent
7f1feee02a
commit
9dc201d448
|
@ -4177,7 +4177,11 @@ SDL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
|||
FlushRenderCommands(renderer); /* we need to render before we read the results. */
|
||||
|
||||
if (!format) {
|
||||
format = SDL_GetWindowPixelFormat(renderer->window);
|
||||
if (renderer->target == NULL) {
|
||||
format = SDL_GetWindowPixelFormat(renderer->window);
|
||||
} else {
|
||||
format = renderer->target->format;
|
||||
}
|
||||
}
|
||||
|
||||
real_rect.x = (int)SDL_floor(renderer->viewport.x);
|
||||
|
|
Loading…
Reference in a new issue