From: DeaDDooMER Date: Sun, 19 Feb 2023 22:30:39 +0000 (+0300) Subject: gl: fix screenshoting on gles X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=789dadda373cbc77a36d095f041489a225894516;p=d2df-sdl.git gl: fix screenshoting on gles --- diff --git a/src/game/renders/opengl/r_render.pas b/src/game/renders/opengl/r_render.pas index 0a27c45..88c5079 100644 --- a/src/game/renders/opengl/r_render.pas +++ b/src/game/renders/opengl/r_render.pas @@ -1110,15 +1110,10 @@ implementation InitImage(img); if NewImage(gWinSizeX, gWinSizeY, TImageFormat.ifA8R8G8B8, img) then begin - {$IFDEF ENDIAN_LITTLE} - typ := GL_UNSIGNED_INT_8_8_8_8_REV; - {$ELSE} - typ := GL_UNSIGNED_INT_8_8_8_8; - {$ENDIF} - glReadPixels(0, 0, gWinSizeX, gWinSizeY, GL_BGRA, typ, img.bits); + glReadPixels(0, 0, gWinSizeX, gWinSizeY, GL_RGBA, GL_UNSIGNED_BYTE, img.bits); if glGetError() = GL_NO_ERROR then begin - if FlipImage(img) then + if FlipImage(img) and SwapChannels(img, ChannelRed, ChannelBlue) then begin ok := SaveImageToFile(fname, img); end;