summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2020-09-18 02:14:05 +0200
committerraysan5 <[email protected]>2020-09-18 02:14:05 +0200
commit04406c0f1a0a1d05cc0dfd03e43119c4f7bfdf4d (patch)
treeec1dde375ac3814759148500bd7a570b8bbf7e2f /src
parentcdc8850e6877084657a9c2be1142878e8e1a7f0a (diff)
downloadraylib-04406c0f1a0a1d05cc0dfd03e43119c4f7bfdf4d.tar.gz
raylib-04406c0f1a0a1d05cc0dfd03e43119c4f7bfdf4d.zip
Corrected minor framebuffer issue on OpenGL ES 2.0
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index d32d20db..3a25e7e8 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -2909,7 +2909,6 @@ void *rlReadTexturePixels(Texture2D texture)
unsigned int fboId = rlLoadFramebuffer(texture.width, texture.height);
// TODO: Create depth texture/renderbuffer for fbo?
-
glBindFramebuffer(GL_FRAMEBUFFER, fboId);
glBindTexture(GL_TEXTURE_2D, 0);
@@ -2921,13 +2920,10 @@ void *rlReadTexturePixels(Texture2D texture)
pixels = (unsigned char *)RL_MALLOC(GetPixelDataSize(texture.width, texture.height, UNCOMPRESSED_R8G8B8A8));
glReadPixels(0, 0, texture.width, texture.height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
- // Re-attach internal FBO color texture before deleting it
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo.texture.id, 0);
-
glBindFramebuffer(GL_FRAMEBUFFER, 0);
// Clean up temporal fbo
- rlUnloadFramebuffer(fbo);
+ rlUnloadFramebuffer(fboId);
#endif
return pixels;