diff options
| author | raysan5 <[email protected]> | 2020-09-14 16:03:45 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2020-09-14 16:03:45 +0200 |
| commit | 50736199620240c00e36a9168cde0b1ff47c5034 (patch) | |
| tree | c27142050013718149ca9f89791243c98955358e /src | |
| parent | 43b9113c0c776d7b1b7f6205dbf9816ca237e808 (diff) | |
| download | raylib-50736199620240c00e36a9168cde0b1ff47c5034.tar.gz raylib-50736199620240c00e36a9168cde0b1ff47c5034.zip | |
REVIEWED: GetTextureData(), allow retrieving 32bit float data
Diffstat (limited to 'src')
| -rw-r--r-- | src/rlgl.h | 2 | ||||
| -rw-r--r-- | src/textures.c | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -2944,7 +2944,7 @@ void *rlReadTexturePixels(Texture2D texture) if ((glInternalFormat != -1) && (texture.format < COMPRESSED_DXT1_RGB)) { - pixels = (unsigned char *)RL_MALLOC(size); + pixels = RL_MALLOC(size); glGetTexImage(GL_TEXTURE_2D, 0, glFormat, glType, pixels); } else TRACELOG(LOG_WARNING, "TEXTURE: [ID %i] Data retrieval not suported for pixel format (%i)", texture.id, texture.format); diff --git a/src/textures.c b/src/textures.c index 982a97ed..2ffd804c 100644 --- a/src/textures.c +++ b/src/textures.c @@ -2835,7 +2835,7 @@ Image GetTextureData(Texture2D texture) { Image image = { 0 }; - if (texture.format < 8) + if (texture.format < COMPRESSED_DXT1_RGB) { image.data = rlReadTexturePixels(texture); |
