Fixed bug 3349 - GLES2_RenderReadPixels doesn't use target texture format
Simon Hug The OpenGL ES 2 renderer does not check the target texture format when using SDL_RenderReadPixels and just always uses ABGR8888. This can result in swapped or wrong colors. The attached patch adds a check and selects the target texture format, if a texture is set as the target.
This commit is contained in:
parent
225b99cc77
commit
f1c567b2c1
3 changed files with 3 additions and 3 deletions
|
@ -1414,7 +1414,7 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
|||
Uint32 pixel_format, void * pixels, int pitch)
|
||||
{
|
||||
GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
|
||||
Uint32 temp_format = SDL_PIXELFORMAT_ARGB8888;
|
||||
Uint32 temp_format = renderer->target ? renderer->target->format : SDL_PIXELFORMAT_ABGR8888;
|
||||
void *temp_pixels;
|
||||
int temp_pitch;
|
||||
GLint internalFormat;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue