diff options
| author | victorfisac <[email protected]> | 2017-04-06 15:28:04 +0200 |
|---|---|---|
| committer | victorfisac <[email protected]> | 2017-04-06 15:28:04 +0200 |
| commit | 54f070a0f421798dca911b48223a67ae6dc51956 (patch) | |
| tree | 07eefb8740d05754dcd875f49ea193eee1c79555 /src/textures.c | |
| parent | 256bc6e1dccfd021239dd0e5a66c377a402c3c59 (diff) | |
| parent | c47b04a2c673f3073e2cc5a47d5aa1bce029e93e (diff) | |
| download | raylib-54f070a0f421798dca911b48223a67ae6dc51956.tar.gz raylib-54f070a0f421798dca911b48223a67ae6dc51956.zip | |
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'src/textures.c')
| -rw-r--r-- | src/textures.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/textures.c b/src/textures.c index fff0e4e9..8e3a1ee1 100644 --- a/src/textures.c +++ b/src/textures.c @@ -516,12 +516,14 @@ Image GetTextureData(Texture2D texture) image.width = texture.width; image.height = texture.height; 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"); } else TraceLog(WARNING, "Texture pixel data could not be obtained"); |
