1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

LibGL: Fix interpretation of BGRA byte order

This fixes byte order interpretation in several places.
This commit is contained in:
Stephan Unverwerth 2021-08-18 13:20:00 +02:00 committed by Andreas Kling
parent e9514cf6c0
commit 22905daacb
4 changed files with 39 additions and 72 deletions

View file

@ -225,7 +225,7 @@ bool GLContextWidget::load(const String& filename)
if (texture_image) {
// Upload texture data to the GL
glBindTexture(GL_TEXTURE_2D, tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, texture_image->width(), texture_image->height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, texture_image->scanline(0));
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, texture_image->width(), texture_image->height(), 0, GL_BGRA, GL_UNSIGNED_BYTE, texture_image->scanline(0));
} else {
dbgln("3DFileViewer: Couldn't load texture for {}", filename);
}