summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2019-12-11 23:26:42 +0100
committerRay <[email protected]>2019-12-11 23:26:42 +0100
commit03e6006ac8e756dc42d7ab0e6856c8c598888787 (patch)
tree0f62a910f148f23087104de364b2510e4db61598 /src
parente614942a2d52ea79c3a7f0fda4f0357035a6cc53 (diff)
downloadraylib-03e6006ac8e756dc42d7ab0e6856c8c598888787.tar.gz
raylib-03e6006ac8e756dc42d7ab0e6856c8c598888787.zip
Corrected bug on rlReadTexturePixels()
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index 9a746873..b9d1aa7e 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -2906,7 +2906,7 @@ void *rlReadTexturePixels(Texture2D texture)
// We read data as RGBA because FBO texture is configured as RGBA, despite binding another texture format
pixels = (unsigned char *)RL_MALLOC(GetPixelDataSize(texture.width, texture.height, UNCOMPRESSED_R8G8B8A8));
- glReadPixels(0, 0, texture.width, texture.height, UNCOMPRESSED_R8G8B8A8, GL_UNSIGNED_BYTE, pixels);
+ glReadPixels(0, 0, texture.width, texture.height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
// Re-attach internal FBO color texture before deleting it
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo.texture.id, 0);