From fa8aca87896241a01789b50ab6153c0c931260fc Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 16 Jun 2026 13:06:16 +0200 Subject: [PATCH] Update rlgl.h --- src/rlgl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rlgl.h b/src/rlgl.h index 1c2f0c95e..ed5e50fb1 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3783,10 +3783,10 @@ void *rlReadTexturePixels(unsigned int id, int width, int height, int format) glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels); #else // Reading data as original texture format, in some platforms (RPI, Wasm) it works - pixels = (unsigned char *)RL_MALLOC(GetPixelDataSize(texture.width, texture.height, texture.format)); + pixels = (unsigned char *)RL_MALLOC(GetPixelDataSize(width, height, format)); unsigned int glInternalFormat = 0, glFormat = 0, glType = 0; - rlGetGlTextureFormats(texture.format, &glInternalFormat, &glFormat, &glType); - glReadPixels(0, 0, texture.width, texture.height, glFormat, glType, pixels); + rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType); + glReadPixels(0, 0, width, height, glFormat, glType, pixels); #endif glBindFramebuffer(GL_FRAMEBUFFER, 0);