Update rlgl.h
This commit is contained in:
parent
efef4e31dd
commit
fa8aca8789
|
|
@ -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);
|
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
||||||
#else
|
#else
|
||||||
// Reading data as original texture format, in some platforms (RPI, Wasm) it works
|
// 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;
|
unsigned int glInternalFormat = 0, glFormat = 0, glType = 0;
|
||||||
rlGetGlTextureFormats(texture.format, &glInternalFormat, &glFormat, &glType);
|
rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
|
||||||
glReadPixels(0, 0, texture.width, texture.height, glFormat, glType, pixels);
|
glReadPixels(0, 0, width, height, glFormat, glType, pixels);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user