mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-24 05:25:12 +00:00
handle device death
This commit is contained in:
parent
f66d723251
commit
02fd841f67
1 changed files with 8 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue