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

@ -24,8 +24,10 @@
class FurnaceSoftwareTexture: public FurnaceGUITexture {
public:
SWTexture* tex;
FurnaceGUITextureFormat format;
FurnaceSoftwareTexture():
tex(NULL) {}
tex(NULL),
format(GUI_TEXFORMAT_UNKNOWN) {}
};
ImTextureID FurnaceGUIRenderSoftware::getTextureID(FurnaceGUITexture* which) {
@ -33,6 +35,11 @@ ImTextureID FurnaceGUIRenderSoftware::getTextureID(FurnaceGUITexture* which) {
return t->tex;
}
FurnaceGUITextureFormat FurnaceGUIRenderSoftware::getTextureFormat(FurnaceGUITexture* which) {
FurnaceSoftwareTexture* t=(FurnaceSoftwareTexture*)which;
return t->format;
}
bool FurnaceGUIRenderSoftware::lockTexture(FurnaceGUITexture* which, void** data, int* pitch) {
FurnaceSoftwareTexture* t=(FurnaceSoftwareTexture*)which;
if (!t->tex->managed) return false;
@ -59,6 +66,7 @@ FurnaceGUITexture* FurnaceGUIRenderSoftware::createTexture(bool dynamic, int wid
}
FurnaceSoftwareTexture* ret=new FurnaceSoftwareTexture;
ret->tex=new SWTexture(width,height);
ret->format=format;
return ret;
}