소스 검색

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--)
{

불러오는 중...
취소
저장