handle other texture formats

This commit is contained in:
tildearrow 2024-05-15 04:08:50 -05:00
parent f51ad1cf1f
commit a4cba0f05c
16 changed files with 135 additions and 2 deletions

View file

@ -29,6 +29,7 @@ class FurnaceGL1Texture: public FurnaceGUITexture {
public:
GLuint id;
int width, height, widthReal, heightReal;
FurnaceGUITextureFormat format;
unsigned char* lockedData;
FurnaceGL1Texture():
id(0),
@ -36,6 +37,7 @@ class FurnaceGL1Texture: public FurnaceGUITexture {
height(0),
widthReal(0),
heightReal(0),
format(GUI_TEXFORMAT_UNKNOWN),
lockedData(NULL) {}
};
@ -56,6 +58,11 @@ float FurnaceGUIRenderGL1::getTextureV(FurnaceGUITexture* which) {
return (float)t->height/(float)t->heightReal;
}
FurnaceGUITextureFormat FurnaceGUIRenderGL1::getTextureFormat(FurnaceGUITexture* which) {
FurnaceGL1Texture* t=(FurnaceGL1Texture*)which;
return t->format;
}
bool FurnaceGUIRenderGL1::lockTexture(FurnaceGUITexture* which, void** data, int* pitch) {
FurnaceGL1Texture* t=(FurnaceGL1Texture*)which;
if (t->lockedData!=NULL) return false;
@ -125,6 +132,7 @@ FurnaceGUITexture* FurnaceGUIRenderGL1::createTexture(bool dynamic, int width, i
t->height=height;
t->widthReal=widthReal;
t->heightReal=heightReal;
t->format=format;
return t;
}