瀏覽代碼

Detected issue

pull/26/head
raysan5 9 年之前
父節點
當前提交
5cfd59258a
共有 1 個檔案被更改,包括 4 行新增2 行删除
  1. +4
    -2
      src/rlgl.c

+ 4
- 2
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--)
{

Loading…
取消
儲存