fix render issue

This commit is contained in:
Nomango 2019-08-07 20:47:41 +08:00
parent 4da7c85309
commit 4cec567d06
1 changed files with 4 additions and 6 deletions

View File

@ -179,7 +179,10 @@ namespace kiwano
device_context_->SaveDrawingState(drawing_state_block_.Get());
device_context_->BeginDraw();
return S_OK;
HRESULT hr = d3d_res_->ClearRenderTarget(clear_color_);
return hr;
}
HRESULT Renderer::EndDraw()
@ -196,11 +199,6 @@ namespace kiwano
hr = d3d_res_->Present(vsync_);
}
if (SUCCEEDED(hr))
{
hr = d3d_res_->ClearRenderTarget(clear_color_);
}
if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
{
// 如果 Direct3D 设备在执行过程中消失,将丢弃当前的设备相关资源