oh yeah, fix textures

TODO: test on real system to make sure it actually works as intended
This commit is contained in:
tildearrow 2024-04-07 02:42:39 -05:00
parent c201e02411
commit 20e7c4633d

View file

@ -59,7 +59,7 @@ bool FurnaceGUIRenderGL1::unlockTexture(FurnaceGUITexture* which) {
if (t->lockedData==NULL) return false; if (t->lockedData==NULL) return false;
C(glBindTexture(GL_TEXTURE_2D,t->id)); 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()); C(glFlush());
delete[] t->lockedData; delete[] t->lockedData;
@ -74,7 +74,7 @@ bool FurnaceGUIRenderGL1::updateTexture(FurnaceGUITexture* which, void* data, in
if (t->width*4!=pitch) return false; if (t->width*4!=pitch) return false;
C(glBindTexture(GL_TEXTURE_2D,t->id)); 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; return true;
} }
@ -102,7 +102,7 @@ FurnaceGUITexture* FurnaceGUIRenderGL1::createTexture(bool dynamic, int width, i
logV("width: %d (requested)... %d (actual)",width,widthReal); logV("width: %d (requested)... %d (actual)",width,widthReal);
logV("height: %d (requested)... %d (actual)",height,heightReal); 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->width=width;
t->height=height; t->height=height;
t->widthReal=widthReal; t->widthReal=widthReal;