From 20e7c4633dc974617c4cd38f9c54d8de07739c24 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 7 Apr 2024 02:42:39 -0500 Subject: [PATCH] oh yeah, fix textures TODO: test on real system to make sure it actually works as intended --- src/gui/render/renderGL1.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/render/renderGL1.cpp b/src/gui/render/renderGL1.cpp index 06b57be77..221c4c941 100644 --- a/src/gui/render/renderGL1.cpp +++ b/src/gui/render/renderGL1.cpp @@ -59,7 +59,7 @@ bool FurnaceGUIRenderGL1::unlockTexture(FurnaceGUITexture* which) { if (t->lockedData==NULL) return false; C(glBindTexture(GL_TEXTURE_2D,t->id)); - C(glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,t->width,t->height,0,GL_RGBA,GL_RGBA,t->lockedData)); + C(glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,t->width,t->height,0,GL_RGBA,GL_UNSIGNED_BYTE,t->lockedData)); C(glFlush()); delete[] t->lockedData; @@ -74,7 +74,7 @@ bool FurnaceGUIRenderGL1::updateTexture(FurnaceGUITexture* which, void* data, in if (t->width*4!=pitch) return false; C(glBindTexture(GL_TEXTURE_2D,t->id)); - C(glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,t->width,t->height,0,GL_RGBA,GL_RGBA,data)); + C(glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,t->width,t->height,0,GL_RGBA,GL_UNSIGNED_BYTE,data)); return true; } @@ -102,7 +102,7 @@ FurnaceGUITexture* FurnaceGUIRenderGL1::createTexture(bool dynamic, int width, i logV("width: %d (requested)... %d (actual)",width,widthReal); logV("height: %d (requested)... %d (actual)",height,heightReal); - C(glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,widthReal,heightReal,0,GL_RGBA,GL_RGBA,NULL)); + C(glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,widthReal,heightReal,0,GL_RGBA,GL_UNSIGNED_BYTE,NULL)); t->width=width; t->height=height; t->widthReal=widthReal;