handle device death

This commit is contained in:
tildearrow 2024-05-16 02:28:49 -05:00
parent f66d723251
commit 02fd841f67

View file

@ -271,7 +271,11 @@ void FurnaceGUIRenderDX9::clear(ImVec4 color) {
}
void FurnaceGUIRenderDX9::present() {
device->Present(NULL,NULL,NULL,NULL);
if (device->Present(NULL,NULL,NULL,NULL)==D3DERR_DEVICEREMOVED) {
logI("device is gone");
dead=true;
return false;
}
if (mustResize) {
logI("DX9: resizing buffers");
@ -302,6 +306,9 @@ void FurnaceGUIRenderDX9::present() {
priv->present.BackBufferCount=1;
if (result==D3DERR_INVALIDCALL) {
logE("OH NO");
dead=true;
mustResize=false;
return;
}
ImGui_ImplDX9_CreateDeviceObjects();