fix render issue
This commit is contained in:
parent
4da7c85309
commit
4cec567d06
|
|
@ -179,7 +179,10 @@ namespace kiwano
|
||||||
device_context_->SaveDrawingState(drawing_state_block_.Get());
|
device_context_->SaveDrawingState(drawing_state_block_.Get());
|
||||||
|
|
||||||
device_context_->BeginDraw();
|
device_context_->BeginDraw();
|
||||||
return S_OK;
|
|
||||||
|
HRESULT hr = d3d_res_->ClearRenderTarget(clear_color_);
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT Renderer::EndDraw()
|
HRESULT Renderer::EndDraw()
|
||||||
|
|
@ -196,11 +199,6 @@ namespace kiwano
|
||||||
hr = d3d_res_->Present(vsync_);
|
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)
|
if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
|
||||||
{
|
{
|
||||||
// 如果 Direct3D 设备在执行过程中消失,将丢弃当前的设备相关资源
|
// 如果 Direct3D 设备在执行过程中消失,将丢弃当前的设备相关资源
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue