mirror of
https://github.com/MobileGL-Dev/MobileGlues.git
synced 2025-09-21 02:04:01 -04:00
Merge branch 'plugin' of https://github.com/Swung0x48/MobileGlues into plugin
This commit is contained in:
commit
3f6dad41e5
@ -796,17 +796,18 @@ void glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, void*
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||
|
||||
// if (format == GL_BGRA && (type == GL_UNSIGNED_INT_8_8_8_8 || type == GL_UNSIGNED_INT_8_8_8_8_REV)) {
|
||||
// void *read_pixels = malloc(width * height * 4);
|
||||
// glReadPixels(0, 0, width, height, format, type, read_pixels);
|
||||
// pixel_convert(read_pixels, &pixels, width, height, GL_RGBA, GL_UNSIGNED_BYTE, format, GL_UNSIGNED_BYTE, 0, 1);
|
||||
// free(read_pixels);
|
||||
// } else {
|
||||
// glReadPixels(0, 0, width, height, format, type, pixels);
|
||||
// }
|
||||
if (pixels != NULL && format == GL_BGRA && (type == GL_UNSIGNED_INT_8_8_8_8 || type == GL_UNSIGNED_INT_8_8_8_8_REV)) {
|
||||
void *read_pixels = malloc(width * height * 4);
|
||||
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, read_pixels);
|
||||
pixel_convert(read_pixels, &pixels, width, height, GL_RGBA, GL_UNSIGNED_BYTE, format, GL_UNSIGNED_BYTE, 0, 1);
|
||||
free(read_pixels);
|
||||
} else {
|
||||
glReadPixels(0, 0, width, height, format, type, pixels);
|
||||
}
|
||||
|
||||
|
||||
glReadPixels(0, 0, width, height, format, type, pixels);
|
||||
// glReadPixels(0, 0, width, height, format, type, pixels);
|
||||
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, oldPackAlignment);
|
||||
gles_glViewport(oldViewport[0], oldViewport[1], oldViewport[2], oldViewport[3]);
|
||||
glDeleteFramebuffers(1, &fbo);
|
||||
|
Loading…
x
Reference in New Issue
Block a user