aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2015-08-29 17:01:36 +0200
committerraysan5 <raysan5@gmail.com>2015-08-29 17:01:36 +0200
commit5cfd59258ae4c308aab1055430f10955e5188736 (patch)
treeff3965753150478352a3d1bbe1f1225af6a6514a /src
parent9dd20577cd4dcbadd3bcad5958a7572c5ad45237 (diff)
downloadraylib-5cfd59258ae4c308aab1055430f10955e5188736.tar.gz
raylib-5cfd59258ae4c308aab1055430f10955e5188736.zip
Detected issue
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rlgl.c b/src/rlgl.c
index 6dea10c0..12eb7a9e 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -1938,15 +1938,17 @@ Model rlglLoadModel(VertexData mesh)
}
// Read screen pixel data (color buffer)
+// ISSUE: Non pre-multiplied alpha when reading from backbuffer!
+// TODO: Multiply alpha
unsigned char *rlglReadScreenPixels(int width, int height)
{
- unsigned char *screenData = (unsigned char *)malloc(width * height * sizeof(unsigned char) * 4);
+ unsigned char *screenData = (unsigned char *)malloc(width*height*sizeof(unsigned char)*4);
// NOTE: glReadPixels returns image flipped vertically -> (0,0) is the bottom left corner of the framebuffer
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, screenData);
// Flip image vertically!
- unsigned char *imgData = (unsigned char *)malloc(width * height * sizeof(unsigned char) * 4);
+ unsigned char *imgData = (unsigned char *)malloc(width*height*sizeof(unsigned char)*4);
for (int y = height-1; y >= 0; y--)
{