소스 검색

Corrected issue when retrieving texture from GPU

pull/260/head
Ray 8 년 전
부모
커밋
99affa0caf
1개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. +8
    -6
      src/textures.c

+ 8
- 6
src/textures.c 파일 보기

@ -516,12 +516,14 @@ Image GetTextureData(Texture2D texture)
image.width = texture.width; image.width = texture.width;
image.height = texture.height; image.height = texture.height;
image.mipmaps = 1; image.mipmaps = 1;
#if defined(GRAPHICS_API_OPENGL_ES2)
// NOTE: Data retrieved on OpenGL ES 2.0 comes as RGB (from framebuffer)
image.format = UNCOMPRESSED_R8G8B8A8;
#else
image.format = texture.format;
#endif
if (rlGetVersion() == OPENGL_ES_20)
{
// NOTE: Data retrieved on OpenGL ES 2.0 comes as RGBA (from framebuffer)
image.format = UNCOMPRESSED_R8G8B8A8;
}
else image.format = texture.format;
TraceLog(INFO, "Texture pixel data obtained successfully"); TraceLog(INFO, "Texture pixel data obtained successfully");
} }
else TraceLog(WARNING, "Texture pixel data could not be obtained"); else TraceLog(WARNING, "Texture pixel data could not be obtained");

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